Package me.gilbva.shrike.utils
Class ClassListPropertyFile
java.lang.Object
javax.annotation.processing.AbstractProcessor
me.gilbva.shrike.utils.ClassListPropertyFile
- All Implemented Interfaces:
javax.annotation.processing.Processor
- Direct Known Subclasses:
ComponentProcessor
public abstract class ClassListPropertyFile
extends javax.annotation.processing.AbstractProcessor
Base class for the annotations processors that handle components declaration files.
- Author:
- Gilberto Vento
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ClassListPropertyFile() -
Method Summary
Modifier and Type Method Description protected voidappendProperty(java.lang.String key, java.lang.String value)This method appends key=value to the output file.abstract java.lang.StringgetFileName()Gets the name for the file that will be written by this annotation processor.voidinit(javax.annotation.processing.ProcessingEnvironment processingEnv)booleanprocess(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)abstract voidprocessElement(javax.lang.model.element.Element element)This method will be called for each component class found by this processor.
-
Constructor Details
-
ClassListPropertyFile
public ClassListPropertyFile()
-
-
Method Details
-
getFileName
public abstract java.lang.String getFileName()Gets the name for the file that will be written by this annotation processor.- Returns:
- The name of the file for this annotation processor.
-
processElement
public abstract void processElement(javax.lang.model.element.Element element) throws java.io.IOExceptionThis method will be called for each component class found by this processor. the implementation of this method must call the appendClass method to write the component reference to de file.- Parameters:
element- The element representing the current component class.- Throws:
java.io.IOException- If the component cannot be written to the file.
-
init
public void init(javax.annotation.processing.ProcessingEnvironment processingEnv)- Specified by:
initin interfacejavax.annotation.processing.Processor- Overrides:
initin classjavax.annotation.processing.AbstractProcessor
-
process
public boolean process(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)- Specified by:
processin interfacejavax.annotation.processing.Processor- Specified by:
processin classjavax.annotation.processing.AbstractProcessor
-
appendProperty
protected void appendProperty(java.lang.String key, java.lang.String value) throws java.io.IOExceptionThis method appends key=value to the output file.- Parameters:
key- The full class name of the component to appendvalue- The scope of the component- Throws:
java.io.IOException- If any IO error prevents the writing.
-