Package org.glassfish.apf
Interface AnnotationHandler
-
- All Known Implementing Classes:
AbstractAttributeHandler
,AbstractCommonAttributeHandler
,AbstractEjbHandler
,AbstractHandler
,AbstractResourceHandler
,AccessTimeoutHandler
,ActivationHandler
,AdministeredObjectDefinitionHandler
,AdministeredObjectDefinitionsHandler
,AdministeredObjectHandler
,AfterBeginHandler
,AfterCompletionHandler
,ApplicationExceptionHandler
,AroundConstructHandler
,AroundInvokeHandler
,AroundTimeoutHandler
,AsynchronousHandler
,AuthenticationMechanismHandler
,BeforeCompletionHandler
,ConcurrencyManagementHandler
,ConfigPropertyHandler
,ConnectionDefinitionHandler
,ConnectionDefinitionsHandler
,ConnectionFactoryDefinitionHandler
,ConnectionFactoryDefinitionsHandler
,ConnectorAnnotationHandler
,DataSourceDefinitionHandler
,DataSourceDefinitionsHandler
,DeclareRolesHandler
,DenyAllHandler
,EJBHandler
,EJBsHandler
,EntityManagerFactoryReferenceHandler
,EntityManagerFactoryReferencesHandler
,EntityManagerReferenceHandler
,EntityManagerReferencesHandler
,ExcludeClassInterceptorsHandler
,ExcludeDefaultInterceptorsHandler
,HandlerChainHandler
,InitHandler
,InterceptorsHandler
,JMSConnectionFactoryDefinitionHandler
,JMSConnectionFactoryDefinitionsHandler
,JMSDestinationDefinitionHandler
,JMSDestinationDefinitionsHandler
,LockHandler
,MailSessionDefinitionHandler
,MailSessionDefinitionsHandler
,ManagedBeanHandler
,MessageDrivenHandler
,MultipartConfigHandler
,PermitAllHandler
,PostActivateHandler
,PostConstructHandler
,PreDestroyHandler
,PrePassivateHandler
,RemoveHandler
,ResourceHandler
,ResourcesHandler
,RolesAllowedHandler
,RunAsHandler
,ScheduleHandler
,SchedulesHandler
,SecurityPermissionHandler
,ServletSecurityHandler
,SingletonHandler
,StatefulHandler
,StatefulTimeoutHandler
,StatelessHandler
,TimeoutHandler
,TransactionAttributeHandler
,TransactionManagementHandler
,WebFilterHandler
,WebListenerHandler
,WebServiceHandler
,WebServiceProviderHandler
,WebServiceRefHandler
,WebServiceRefsHandler
,WebServletHandler
@Contract public interface AnnotationHandler
This interface defines the contract for annotation handlers and the annotation processing engine. Each annotation handler is registered for a particular annotation type and will be called by the engine when such annotation type is encountered. The AnnotationHandler is a stateless object, no state should be stored, instead users should use the ProcessingContext. Annotation can be defined or processed in random orders on a particular type, however, a particular annotation may need other annotation to be processed before itself in order to be processed successfully. An annotation type can indicate through the @see getAnnotations() method which annotation types should be processed before itself. Each implementation of this interface must specify the annotation that it can handle usingAnnotationHandlerFor
annotation.- Author:
- Jerome Dochez
-
-
Field Summary
Fields Modifier and Type Field Description static String
ANNOTATION_HANDLER_METADATA
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Class<? extends Annotation>
getAnnotationType()
Class<? extends Annotation>[]
getTypeDependencies()
HandlerProcessingResult
processAnnotation(AnnotationInfo element)
Process a particular annotation which type is the same as the one returned by @see getAnnotationType().
-
-
-
Field Detail
-
ANNOTATION_HANDLER_METADATA
static final String ANNOTATION_HANDLER_METADATA
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAnnotationType
Class<? extends Annotation> getAnnotationType()
- Returns:
- the annotation type this annotation handler is handling
-
processAnnotation
HandlerProcessingResult processAnnotation(AnnotationInfo element) throws AnnotationProcessorException
Process a particular annotation which type is the same as the one returned by @see getAnnotationType(). All information pertinent to the annotation and its context is encapsulated in the passed AnnotationInfo instance.- Parameters:
element
- the annotation information- Throws:
AnnotationProcessorException
-
getTypeDependencies
Class<? extends Annotation>[] getTypeDependencies()
- Returns:
- an array of annotation types this annotation handler would require to be processed (if present) before it processes it's own annotation type.
-
-