Package org.kohsuke.stapler
Class Function
java.lang.Object
org.kohsuke.stapler.Function
- Direct Known Subclasses:
ForwardingFunction
,Function.InstanceFunction
Abstracts the difference between normal instance methods and
static duck-typed methods.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncontextualize
(Object usage) Caller uses this method to tellFunction
about how it is being used.abstract <A extends Annotation>
AgetAnnotation
(Class<A> annotation) abstract Annotation[]
abstract Class[]
Gets the type of checked exceptions.abstract Class
Returns theClass
object representing the class or interface that declares the executable represented by this object.abstract String
Gets the human readable name of this function.abstract Type[]
abstract String
getName()
Gets the method name.abstract Annotation[][]
Gets the annotations on parameters.abstract String[]
Gets the list of parameter names.abstract Class[]
Gets the type of parameters in a single array.abstract String
Gets "className.methodName"abstract Class
Return type of the method.abstract String
Gets the signature for this for use in listsinvoke
(StaplerRequest2 req, StaplerResponse2 rsp, Object o, Object... args) Invokes the method.invoke
(StaplerRequest req, StaplerResponse rsp, Object o, Object... args) Deprecated.abstract boolean
isStatic()
Returns true if and only if the function is static.static Object
-
Constructor Details
-
Function
public Function()
-
-
Method Details
-
getName
Gets the method name. -
getDisplayName
Gets the human readable name of this function. Used to assist debugging. -
getSignature
Gets the signature for this for use in lists -
getQualifiedName
Gets "className.methodName" -
getParameterTypes
Gets the type of parameters in a single array. -
getGenericParameterTypes
-
getParameterAnnotations
Gets the annotations on parameters. -
getParameterNames
Gets the list of parameter names. -
getReturnType
Return type of the method. -
getCheckedExceptionTypes
Gets the type of checked exceptions.Take care that
RuntimeException
can be checked but it's not mandatory -
getDeclaringClass
Returns theClass
object representing the class or interface that declares the executable represented by this object.- See Also:
-
isStatic
public abstract boolean isStatic()Returns true if and only if the function is static. -
contextualize
Caller uses this method to tellFunction
about how it is being used. By default, this methods ignores the given context by returningthis
. -
returnNull
- See Also:
-
RETURN_NULL
-
invoke
public Object invoke(StaplerRequest2 req, StaplerResponse2 rsp, Object o, Object... args) throws IllegalAccessException, InvocationTargetException, jakarta.servlet.ServletException Invokes the method.- Throws:
IllegalAccessException
InvocationTargetException
jakarta.servlet.ServletException
-
invoke
@Deprecated public Object invoke(StaplerRequest req, StaplerResponse rsp, Object o, Object... args) throws IllegalAccessException, InvocationTargetException, javax.servlet.ServletException Deprecated.- Throws:
IllegalAccessException
InvocationTargetException
javax.servlet.ServletException
-
getAnnotation
-
getAnnotations
-
invoke(StaplerRequest2, StaplerResponse2, Object, Object...)