public class AnnotationProcessorImpl extends Object implements AnnotationProcessor
| Constructor and Description |
|---|
AnnotationProcessorImpl()
Creates a new instance of AnnotationProcessorImpl
|
| Modifier and Type | Method and Description |
|---|---|
ProcessingContext |
createContext()
Creates a new empty ProcessingContext instance which can be configured
before invoking the process() method.
|
AnnotationHandler |
getAnnotationHandler(Class<? extends Annotation> type) |
AnnotatedElement |
getLastAnnotatedElement(ElementType type) |
Stack<org.glassfish.apf.impl.StackElement> |
getStack() |
void |
log(Level level,
AnnotationInfo locator,
String localizedMessage)
Log a message on the default logger
|
void |
popAnnotationHandler(Class<? extends Annotation> type)
Unregisters the last annotation handler registered for an annotation type.
|
ProcessingResult |
process(ProcessingContext ctx)
Starts the annotation processing tool passing the processing context which
encapuslate all information necessary for the configuration of the tool.
|
ProcessingResult |
process(ProcessingContext ctx,
Class[] classes)
Process a set of classes from the parameter list rather than from the
processing context.
|
void |
pushAnnotationHandler(AnnotationHandler handler)
Registers a new AnnotationHandler for a particular annotation type.
|
void |
pushAnnotationHandler(String type,
AnnotationHandler handler)
This method is similar to
pushAnnotationHandler(AnnotationHandler) except that
it takes an additional String type argument which allows us to avoid extracting the information from the
AnnotationHandler. |
void |
setDelegate(AnnotationProcessorImpl delegate) |
public AnnotationProcessorImpl()
public void setDelegate(AnnotationProcessorImpl delegate)
public ProcessingContext createContext()
AnnotationProcessorcreateContext in interface AnnotationProcessorpublic void log(Level level, AnnotationInfo locator, String localizedMessage)
log in interface AnnotationProcessorpublic ProcessingResult process(ProcessingContext ctx) throws AnnotationProcessorException
process in interface AnnotationProcessorctx - is the initialized processing contextAnnotationProcessorExceptionpublic ProcessingResult process(ProcessingContext ctx, Class[] classes) throws AnnotationProcessorException
process in interface AnnotationProcessorctx - the processing contextclasses - the list of classes to processAnnotationProcessorException - if handlers fail to process
an annotationpublic void pushAnnotationHandler(AnnotationHandler handler)
AnnotationProcessorpushAnnotationHandler in interface AnnotationProcessorhandler - the annotation handler instancepublic void pushAnnotationHandler(String type, AnnotationHandler handler)
pushAnnotationHandler(AnnotationHandler) except that
it takes an additional String type argument which allows us to avoid extracting the information from the
AnnotationHandler. Calling the AnnotationHandler can lead to its instantiation where as the annotation
that a handler is responsible for handling is a metadata that can be statically extracted. This allows us to
build more lazy systems.type - handler - public void popAnnotationHandler(Class<? extends Annotation> type)
AnnotationProcessorpopAnnotationHandler in interface AnnotationProcessortype - the annotation type.public AnnotationHandler getAnnotationHandler(Class<? extends Annotation> type)
getAnnotationHandler in interface AnnotationProcessortype - the annotation typepublic AnnotatedElement getLastAnnotatedElement(ElementType type)
getLastAnnotatedElement in interface AnnotationProcessorpublic Stack<org.glassfish.apf.impl.StackElement> getStack()
Copyright © 2019. All rights reserved.