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

    Fields inherited from class javax.annotation.processing.AbstractProcessor

    processingEnv
  • Constructor Summary

    Constructors 
    Constructor Description
    ClassListPropertyFile()  
  • Method Summary

    Modifier and Type Method Description
    protected void appendProperty​(java.lang.String key, java.lang.String value)
    This method appends key=value to the output file.
    abstract java.lang.String getFileName()
    Gets the name for the file that will be written by this annotation processor.
    void init​(javax.annotation.processing.ProcessingEnvironment processingEnv)  
    boolean process​(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)  
    abstract void processElement​(javax.lang.model.element.Element element)
    This method will be called for each component class found by this processor.

    Methods inherited from class javax.annotation.processing.AbstractProcessor

    getCompletions, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, isInitialized

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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.IOException
      This 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:
      init in interface javax.annotation.processing.Processor
      Overrides:
      init in class javax.annotation.processing.AbstractProcessor
    • process

      public boolean process​(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)
      Specified by:
      process in interface javax.annotation.processing.Processor
      Specified by:
      process in class javax.annotation.processing.AbstractProcessor
    • appendProperty

      protected void appendProperty​(java.lang.String key, java.lang.String value) throws java.io.IOException
      This method appends key=value to the output file.

      Parameters:
      key - The full class name of the component to append
      value - The scope of the component
      Throws:
      java.io.IOException - If any IO error prevents the writing.