@SupportedSourceVersion(value=RELEASE_6)
public abstract class AbstractAnnotationProcessor
extends javax.annotation.processing.AbstractProcessor
Modifier and Type | Class and Description |
---|---|
private static class |
AbstractAnnotationProcessor.FileType |
Modifier and Type | Field and Description |
---|---|
private ProcessingContext |
ctx |
private static java.lang.String |
MSG_GENERATING_FILE
Message (File generated).
|
Constructor and Description |
---|
AbstractAnnotationProcessor() |
Modifier and Type | Method and Description |
---|---|
private void |
generateFile(AbstractAnnotationProcessor.FileType ftype, |
protected void |
generateFile(TypeModel model, |
private void |
generateMultiModelFile(AbstractAnnotationProcessor.FileType ftype, |
protected void |
generateMultiModelFile(java.util.Collection<? extends TypeModel> model, |
protected void |
generateMultiModelResourceFile(java.util.Collection<? extends TypeModel> model, |
protected void |
generateResourceFile(TypeModel model,
Generates the resource file to "-s" directory with specified filename path.
|
protected void |
generateSourceFile(TypeModel model,
Generates the source file to "-s" directory with filename derived from
TypeModel.getQualifiedName() . |
protected ProcessingContext |
getProcessingContext() |
protected abstract java.lang.Class<? extends java.lang.annotation.Annotation>[] |
getSupportedAnnotations()
The same purpose as
AbstractAnnotationProcessor.getSupportedAnnotationTypes() , but this method
supports strong type validation (by compiler) of supported Annotation. |
java.util.Set<java.lang.String> |
getSupportedAnnotationTypes() |
void |
init(javax.annotation.processing.ProcessingEnvironment processingEnv) |
protected abstract boolean |
process() |
boolean |
process(java.util.Set<? extends javax.lang.model.element.TypeElement> aAnnotations, |
private void |
replaceTargetFolder(javax.tools.FileObject fileObject,
Replaces existing target folder in file object from "generated/java" to "generated/${targetFolder}".
|
init
in interface javax.annotation.processing.Processor
init
in class javax.annotation.processing.AbstractProcessor
AbstractProcessor.init(javax.annotation.processing.ProcessingEnvironment)
getSupportedAnnotationTypes
in interface javax.annotation.processing.Processor
getSupportedAnnotationTypes
in class javax.annotation.processing.AbstractProcessor
AbstractProcessor.getSupportedAnnotationTypes()
AbstractAnnotationProcessor.getSupportedAnnotationTypes()
, but this method
supports strong type validation (by compiler) of supported Annotation. We
recommend to use this method instead of @SupportedAnnotationTypes
annotation on processor.SupportedAnnotationTypes
.process
in interface javax.annotation.processing.Processor
process
in class javax.annotation.processing.AbstractProcessor
AbstractProcessor.process(java.util.Set,
javax.annotation.processing.RoundEnvironment)
TypeModel.getQualifiedName()
.model
- The model to be generated by template to source-file.templateName
- The template to be used for output body of the source
file.model
- The model to be generated by template to resource-file.templateName
- The template to be used for output body of the resource
file.outputFilePathname
- The full path name added to source-dir.For
example "resources/myresource.xml"fileObject
- File object to be replacedtargetFolder
- New folder "generated/${targetFolder}" to be used instead of "generated/java"