Package org.glassfish.apf
Interface ProcessingContext
public interface ProcessingContext
This interface defines the context for the annotation procesing
handler. There is only one context instance per AnnotationProcessor
invocation.
- Author:
- Jerome Dochez
-
Method Summary
Modifier and TypeMethodDescriptionorg.glassfish.api.deployment.archive.ReadableArchiveReturns the module archive that can be used to load files/resources, that assist in the processing of annotations.Return the error handler for this processing context.Return the current handler (if any) receving all the annotated elements start and stop events.Returns the Scanner implementation which is responsible for providing access to all the .class files the processing tool needs to scan.Returns the AnnotationProcessor instance this context is associated with.Removes the top handlervoidpushHandler(AnnotationContext handler) Push a new handler on the stack of handlers.voidsetArchive(org.glassfish.api.deployment.archive.ReadableArchive archive) voidsetErrorHandler(ErrorHandler errorHandler) Sets the ErrorHandler instance for all errors/warnings that may be raised during the annotation processing.voidsetProcessingInput(Scanner scanner) Sets the Scanner implementation which is responsible for accessing all the .class files the AnnotationProcessor should process.
-
Method Details
-
getProcessor
AnnotationProcessor getProcessor()Returns the AnnotationProcessor instance this context is associated with.- Returns:
- annotation processor instance
-
getProcessingInput
Scanner getProcessingInput()Returns the Scanner implementation which is responsible for providing access to all the .class files the processing tool needs to scan.- Returns:
- scanner instance
-
getArchive
org.glassfish.api.deployment.archive.ReadableArchive getArchive()Returns the module archive that can be used to load files/resources, that assist in the processing of annotations. Using the ClassLoader is preferred, but not all files can be loaded by it and this can be handy in those cases.- Returns:
- module archive
-
setArchive
void setArchive(org.glassfish.api.deployment.archive.ReadableArchive archive) -
setProcessingInput
Sets the Scanner implementation which is responsible for accessing all the .class files the AnnotationProcessor should process. -
pushHandler
Push a new handler on the stack of handlers. This handler will receive all the AnnotedElementHandler events until it is removed from the stack with a popHandler() call.- Parameters:
handler- the new events handler.
-
getHandler
AnnotatedElementHandler getHandler()Return the current handler (if any) receving all the annotated elements start and stop events.- Returns:
- the top handler
-
popHandler
AnnotatedElementHandler popHandler()Removes the top handler- Returns:
- the removed handler
-
setErrorHandler
Sets the ErrorHandler instance for all errors/warnings that may be raised during the annotation processing.- Parameters:
errorHandler- the annotation handler
-
getErrorHandler
ErrorHandler getErrorHandler()Return the error handler for this processing context.- Returns:
- the error handler
-