Top Description Fields Constructors Methods
org.kohsuke.args4j.apt

public Class AnnotationProcessorImpl

extends AbstractProcessor
Class Inheritance
Imports
java.io.File, .FileInputStream, .FileWriter, .IOException, java.util.Arrays, .HashSet, .Properties, .Set, javax.annotation.processing.AbstractProcessor, .Messager, .ProcessingEnvironment, .Processor, .RoundEnvironment, javax.lang.model.SourceVersion, javax.lang.model.element.Element, .ExecutableElement, .TypeElement, .VariableElement, javax.lang.model.util.SimpleElementVisitor7, .Types, javax.tools.Diagnostic.Kind, org.kohsuke.args4j.Argument, .Option

Annotation Processor to be invoked by javac. This class receives options from the Main method through system properties (ouch!).
Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
private String
private Messager
private File
private Properties
private Types
Inherited from javax.annotation.processing.AbstractProcessor:
processingEnv

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private AnnotationVisitor
public Set<String>
public SourceVersion
private String
public synchronized void
init(ProcessingEnvironment
environment to access facilities the tool framework provides to the processor
processingEnv
)

Overrides javax.annotation.processing.AbstractProcessor.init.

Implements javax.annotation.processing.Processor.init.

Initializes the processor with the processing environment.

private boolean
public boolean
process(Set<? extends TypeElement>
the annotation interfaces requested to be processed
annotations
,
RoundEnvironment
environment for information about the current and prior round
roundEnv
)

Implements abstract javax.annotation.processing.AbstractProcessor.process.

Implements javax.annotation.processing.Processor.process.

Processes a set of annotation interfaces on root elements originating from the prior round and returns whether or not these annotation interfaces are claimed by this processor.

private void
private void
Inherited from javax.annotation.processing.AbstractProcessor:
getCompletionsgetSupportedOptionsisInitialized

Field Detail

formatback to summary
private String format
messengerback to summary
private Messager messenger
outDirback to summary
private File outDir
resourceback to summary
private Properties resource
typeUtilsback to summary
private Types typeUtils

Constructor Detail

AnnotationProcessorImplback to summary
public AnnotationProcessorImpl()

Method Detail

createAnnotationVisitorback to summary
private AnnotationVisitor createAnnotationVisitor(TypeElement te) throws IOException
getSupportedAnnotationTypesback to summary
public Set<String> getSupportedAnnotationTypes()

Overrides javax.annotation.processing.AbstractProcessor.getSupportedAnnotationTypes.

Implements javax.annotation.processing.Processor.getSupportedAnnotationTypes.

Doc from javax.annotation.processing.AbstractProcessor.getSupportedAnnotationTypes.

Returns the names of the annotation interfaces supported by this processor.

Returns:Set<String>

the names of the annotation interfaces supported by this processor or an empty set if none

Annotations
@Override
getSupportedSourceVersionback to summary
public SourceVersion getSupportedSourceVersion()

Overrides javax.annotation.processing.AbstractProcessor.getSupportedSourceVersion.

Implements javax.annotation.processing.Processor.getSupportedSourceVersion.

Doc from javax.annotation.processing.AbstractProcessor.getSupportedSourceVersion.

Returns the latest source version supported by this annotation processor.

Returns:SourceVersion

the latest source version supported by this annotation processor

Annotations
@Override
getUsageback to summary
private String getUsage(Option o)
initback to summary
public synchronized void init(ProcessingEnvironment processingEnv)

Overrides javax.annotation.processing.AbstractProcessor.init.

Implements javax.annotation.processing.Processor.init.

Doc from javax.annotation.processing.AbstractProcessor.init.

Initializes the processor with the processing environment.

Parameters
processingEnv:ProcessingEnvironment

environment to access facilities the tool framework provides to the processor

Annotations
@Override
isOptionHiddenback to summary
private boolean isOptionHidden(String usage)
processback to summary
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)

Implements abstract javax.annotation.processing.AbstractProcessor.process.

Implements javax.annotation.processing.Processor.process.

Doc from javax.annotation.processing.AbstractProcessor.process.

Processes a set of annotation interfaces on root elements originating from the prior round and returns whether or not these annotation interfaces are claimed by this processor. If true is returned, the annotation interfaces are claimed and subsequent processors will not be asked to process them; if false is returned, the annotation interfaces are unclaimed and subsequent processors may be asked to process them. A processor may always return the same boolean value or may vary the result based on its own chosen criteria.

The input set will be empty if the processor supports "*" and the root elements have no annotations. A Processor must gracefully handle an empty set of annotations.

Parameters
annotations:Set<? extends TypeElement>

the annotation interfaces requested to be processed

roundEnv:RoundEnvironment

environment for information about the current and prior round

Returns:boolean

Doc from javax.annotation.processing.Processor.process.

whether or not the set of annotation interfaces are claimed by this processor

Annotations
@Override
scanback to summary
private void scan(TypeElement decl, AnnotationVisitor visitor)
scanback to summary
private void scan(Element f, AnnotationVisitor visitor)