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
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontextualize(Object usage) Caller uses this method to tellFunctionabout how it is being used.abstract <A extends Annotation>
AgetAnnotation(Class<A> annotation) abstract Annotation[]abstract Class[]Gets the type of checked exceptions.abstract ClassReturns theClassobject representing the class or interface that declares the executable represented by this object.abstract StringGets the human readable name of this function.abstract Type[]abstract StringgetName()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 StringGets "className.methodName"abstract ClassReturn type of the method.abstract StringGets 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 booleanisStatic()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
RuntimeExceptioncan be checked but it's not mandatory -
getDeclaringClass
Returns theClassobject 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 tellFunctionabout 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:
IllegalAccessExceptionInvocationTargetExceptionjakarta.servlet.ServletException
-
invoke
@Deprecated public Object invoke(StaplerRequest req, StaplerResponse rsp, Object o, Object... args) throws IllegalAccessException, InvocationTargetException, javax.servlet.ServletException Deprecated.- Throws:
IllegalAccessExceptionInvocationTargetExceptionjavax.servlet.ServletException
-
getAnnotation
-
getAnnotations
-
invoke(StaplerRequest2, StaplerResponse2, Object, Object...)