Package org.eclipse.jetty.annotations
Class ResourceAnnotationHandler
- java.lang.Object
-
- org.eclipse.jetty.annotations.AnnotationIntrospector.AbstractIntrospectableAnnotationHandler
-
- org.eclipse.jetty.annotations.ResourceAnnotationHandler
-
- All Implemented Interfaces:
AnnotationIntrospector.IntrospectableAnnotationHandler
public class ResourceAnnotationHandler extends AnnotationIntrospector.AbstractIntrospectableAnnotationHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected WebAppContext_contextprotected static java.util.List<java.lang.Class<?>>ENV_ENTRY_TYPES
-
Constructor Summary
Constructors Constructor Description ResourceAnnotationHandler(WebAppContext wac)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoHandle(java.lang.Class<?> clazz)Class level Resource annotations declare a name in the environment that will be looked up at runtime.voidhandleClass(java.lang.Class<?> clazz)voidhandleField(java.lang.Class<?> clazz, java.lang.reflect.Field field)voidhandleMethod(java.lang.Class<?> clazz, java.lang.reflect.Method method)Process a Resource annotation on a Method.booleanisEnvEntryType(java.lang.Class<?> clazz)Check if the class is one of the basic java types permitted as env-entries.booleansupportsResourceInjection(java.lang.Class<?> c)Check if the given Class is one that the specification allows to have a Resource annotation.-
Methods inherited from class org.eclipse.jetty.annotations.AnnotationIntrospector.AbstractIntrospectableAnnotationHandler
handle
-
-
-
-
Field Detail
-
ENV_ENTRY_TYPES
protected static final java.util.List<java.lang.Class<?>> ENV_ENTRY_TYPES
-
_context
protected WebAppContext _context
-
-
Constructor Detail
-
ResourceAnnotationHandler
public ResourceAnnotationHandler(WebAppContext wac)
-
-
Method Detail
-
doHandle
public void doHandle(java.lang.Class<?> clazz)
Class level Resource annotations declare a name in the environment that will be looked up at runtime. They do not specify an injection.- Specified by:
doHandlein classAnnotationIntrospector.AbstractIntrospectableAnnotationHandler
-
handleClass
public void handleClass(java.lang.Class<?> clazz)
-
handleField
public void handleField(java.lang.Class<?> clazz, java.lang.reflect.Field field)
-
handleMethod
public void handleMethod(java.lang.Class<?> clazz, java.lang.reflect.Method method)Process a Resource annotation on a Method.This will generate a JNDI entry, and an Injection to be processed when an instance of the class is created.
- Parameters:
clazz- the class to processmethod- the method to process
-
supportsResourceInjection
public boolean supportsResourceInjection(java.lang.Class<?> c)
Check if the given Class is one that the specification allows to have a Resource annotation.- Parameters:
c- the class- Returns:
- true if Resource annotation permitted, false otherwise
-
isEnvEntryType
public boolean isEnvEntryType(java.lang.Class<?> clazz)
Check if the class is one of the basic java types permitted as env-entries.- Parameters:
clazz- the class to check- Returns:
- true if class is permitted by the spec to be an env-entry value
-
-