|
Mirror API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AnnotationProcessorEnvironment
The environment encapsulating the state needed by an annotation processor. An annotation processing tool makes this environment available to all annotation processors.
When an annotation processing tool is invoked, it is given a set of type declarations on which to operate. These are refered to as the specified types. The type declarations said to be included in this invocation consist of the specified types and any types nested within them.
DeclarationFilter
provides a simple way to select just the items of interest
when a method returns a collection of declarations.
Method Summary | |
---|---|
void |
addListener(AnnotationProcessorListener listener)
Add a listener. |
Collection<Declaration> |
getDeclarationsAnnotatedWith(AnnotationTypeDeclaration a)
Returns the declarations annotated with the given annotation type. |
Declarations |
getDeclarationUtils()
Returns an implementation of some utility methods for operating on declarations. |
Filer |
getFiler()
Returns the filer used to create new source, class, or auxiliary files. |
Messager |
getMessager()
Returns the messager used to report errors, warnings, and other notices. |
Map<String,String> |
getOptions()
Returns the options passed to the annotation processing tool. |
PackageDeclaration |
getPackage(String name)
Returns the declaration of a package given its fully qualified name. |
Collection<TypeDeclaration> |
getSpecifiedTypeDeclarations()
Returns the declarations of the types specified when the annotation processing tool was invoked. |
TypeDeclaration |
getTypeDeclaration(String name)
Returns the declaration of a type given its fully qualified name. |
Collection<TypeDeclaration> |
getTypeDeclarations()
A convenience method that returns the declarations of the types included in this invocation of the annotation processing tool. |
Types |
getTypeUtils()
Returns an implementation of some utility methods for operating on types. |
void |
removeListener(AnnotationProcessorListener listener)
Remove a listener. |
Method Detail |
---|
Map<String,String> getOptions()
Options beginning with "-A" are processor-specific. Such options are unrecognized by the tool, but intended to be used by some annotation processor.
Messager getMessager()
Filer getFiler()
Collection<TypeDeclaration> getSpecifiedTypeDeclarations()
PackageDeclaration getPackage(String name)
name
- fully qualified package name, or "" for the unnamed package
TypeDeclaration getTypeDeclaration(String name)
name
- fully qualified type name
Collection<TypeDeclaration> getTypeDeclarations()
Collection<Declaration> getDeclarationsAnnotatedWith(AnnotationTypeDeclaration a)
a
- annotation type being requested
Declarations getDeclarationUtils()
Types getTypeUtils()
void addListener(AnnotationProcessorListener listener)
listener
- The listener to add.
NullPointerException
- if the listener is nullvoid removeListener(AnnotationProcessorListener listener)
listener
- The listener to remove.
NullPointerException
- if the listener is null
|
Mirror API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |