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