@SupportedSourceVersion(value=RELEASE_8) @SupportedAnnotationTypes(value={"at.rseiler.spbee.core.annotation.ResultSet","at.rseiler.spbee.core.annotation.Entity","at.rseiler.spbee.core.annotation.Dao"}) public class SPBeeAnnotationProcessor extends AbstractProcessor
Registers for the following annotations:
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG |
static String |
DATA_FILE |
static String |
SPBEE_ANNOTATION_PREFIX |
processingEnv
Constructor and Description |
---|
SPBeeAnnotationProcessor() |
Modifier and Type | Method and Description |
---|---|
private AnnotationProcessingContext |
collectData(Properties config,
Set<? extends TypeElement> annotations,
RoundEnvironment roundEnvironment,
AnnotationProcessingContext context)
Collects the data from the source code and stores the data into the context.
|
private void |
generateCode(AnnotationProcessingContext context)
Generates the code based on the context.
|
private static String |
getStackTrace(Exception exception)
Transform the exception to a string with the complete stack trace.
|
void |
init(ProcessingEnvironment processingEnv) |
private Properties |
loadConfig() |
private AnnotationProcessingContext |
loadPreviousContext(Properties config)
Loads the previous context if it exists.
|
boolean |
process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnvironment) |
private void |
storeContext(AnnotationProcessingContext context)
Store the context for partial recompilations.
|
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, isInitialized
public static final String SPBEE_ANNOTATION_PREFIX
public static final String DATA_FILE
public static final String CONFIG
public void init(ProcessingEnvironment processingEnv)
init
in interface Processor
init
in class AbstractProcessor
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnvironment)
process
in interface Processor
process
in class AbstractProcessor
private Properties loadConfig()
private AnnotationProcessingContext loadPreviousContext(Properties config)
private AnnotationProcessingContext collectData(Properties config, Set<? extends TypeElement> annotations, RoundEnvironment roundEnvironment, AnnotationProcessingContext context)
annotations
- the annotationsroundEnvironment
- the environmentcontext
- the old contextprivate void generateCode(AnnotationProcessingContext context)
context
- the contextprivate void storeContext(AnnotationProcessingContext context)
context
- the context to storeCopyright © 2015. All rights reserved.