Class AnalyzeProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
org.tentackle.buildsupport.AbstractTentackleProcessor
org.tentackle.buildsupport.AnalyzeProcessor
- All Implemented Interfaces:
Processor
@SupportedAnnotationTypes("*")
@SupportedOptions("verbosity")
public class AnalyzeProcessor
extends AbstractTentackleProcessor
Annotation processor for all annotations annotated with
Analyze.
The processor claims all annotations and follows their meta-annotations recursively until it finds
@Analyze. The handler named by @Analyze is loaded via the processing classloader, instantiated, and invoked for the annotation.
The handlers write service descriptors to the service directory and
analyze info files to the analyze directory.
- Author:
- harald
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringLogfile for compilation errors during the analyze-phase.
The logfile is missing if no errors were detected.Fields inherited from class AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the generated analyze files directory.Gets the classloader to be used instead of the default.
Used to load the handlers and, if necessary, the annotation classes.Gets the generated services resource directory.booleanprocess(Set<? extends TypeElement> annotationTypes, RoundEnvironment roundEnv) voidsetAnalyzeDir(File outputDir) Sets the generated analyze files directory.voidsetProcessingClassLoader(ClassLoader processingClassLoader) Sets the classloader to be used instead of the default.voidsetServiceDir(File serviceDir) Sets the generated services resource directory.Methods inherited from class AbstractTentackleProcessor
cleanup, getProcessingEnvironment, getResourceManager, getResourceManagers, getSourceDir, getSupportedSourceVersion, init, isDebugLogging, isInfoLogging, setSourceDirMethods inherited from class AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, isInitialized
-
Field Details
-
COMPILE_ERROR_LOG
Logfile for compilation errors during the analyze-phase.
The logfile is missing if no errors were detected. Otherwise, analyze info files may be incomplete or missing.- See Also:
-
-
Constructor Details
-
AnalyzeProcessor
public AnalyzeProcessor()
-
-
Method Details
-
getProcessingClassLoader
Gets the classloader to be used instead of the default.
Used to load the handlers and, if necessary, the annotation classes. The Tentackle Maven plugin sets a classloader that also searches the project's classpath.- Returns:
- the classloader, never null (fallback to the classloader of this processor)
-
setProcessingClassLoader
Sets the classloader to be used instead of the default.- Parameters:
processingClassLoader- the classloader, null if default
-
getAnalyzeDir
-
setAnalyzeDir
Sets the generated analyze files directory.- Parameters:
outputDir- the output dir
-
getServiceDir
Gets the generated services resource directory.- Returns:
- the resources file dir
-
setServiceDir
Sets the generated services resource directory.- Parameters:
serviceDir- the resource dir
-
process
Processes all annotations that are annotated with
@Analyze, either directly or via meta-annotations. The recursive scan allows annotating only once for a group of annotations. An annotation is claimed if at least one handler was found.- Specified by:
processin interfaceProcessor- Specified by:
processin classAbstractProcessor
-