Package org.kohsuke.stapler
Class AnnotationHandler<T extends Annotation>
- java.lang.Object
-
- org.kohsuke.stapler.AnnotationHandler<T>
-
- Direct Known Subclasses:
AncestorInPath.HandlerImpl
,Header.HandlerImpl
,JsonBody.Handler
,QueryParameter.HandlerImpl
,SubmittedForm.Handler
public abstract class AnnotationHandler<T extends Annotation> extends Object
Handles stapler parameter annotations by determining what values to inject for a method call.- Author:
- Kohsuke Kawaguchi
- See Also:
InjectedParameter
-
-
Constructor Summary
Constructors Constructor Description AnnotationHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Object
convert(Class targetType, String value)
Helper method forparse(StaplerRequest, Annotation, Class, String)
to convert to the right type from String.abstract Object
parse(StaplerRequest request, T a, Class type, String parameterName)
-
-
-
Method Detail
-
parse
public abstract Object parse(StaplerRequest request, T a, Class type, String parameterName) throws javax.servlet.ServletException
- Parameters:
request
- Current request being processed. Normally the parameter injection grabs some value from here and returns it. Never null.a
- The annotation object attached on the parameter for which this handler is configured. Never nulltype
- The type of the parameter. Any value returned from this method must be assignable to this type. Never null.parameterName
- Name of the parameter.- Throws:
javax.servlet.ServletException
-
convert
protected final Object convert(Class targetType, String value)
Helper method forparse(StaplerRequest, Annotation, Class, String)
to convert to the right type from String.
-
-