Class AbstractCopyrightProcessor<T extends Annotation>

    • Field Detail

      • m_IsFirst

        protected boolean m_IsFirst
        whether the output represents the first one.
    • Constructor Detail

      • AbstractCopyrightProcessor

        public AbstractCopyrightProcessor()
    • Method Detail

      • getSupportedOptions

        public Set<String> getSupportedOptions()
        If the processor class is annotated with SupportedOptions, return an unmodifiable set with the same set of strings as the annotation. If the class is not so annotated, an empty set is returned.
        Specified by:
        getSupportedOptions in interface Processor
        getSupportedOptions in class AbstractProcessor
        the options recognized by this processor, or an empty set if none
      • getAnnotationClass

        protected abstract Class getAnnotationClass()
        Returns the annotation class to process.
        the class
      • getOutputFile

        protected abstract String getOutputFile​(String prefix)
        Returns the output file to write the information to.
        prefix - the path/filename prefix
        the full path/filename
      • getHeaderRow

        protected abstract String getHeaderRow()
        Returns the header row for the tab-separated output file.
        the header row
      • getDataRow

        protected abstract String getDataRow​(T copyright,
                                             String module,
                                             String cls,
                                             String method)
        Returns a data row for a specific annotation.
        copyright - the copyright annotation to use
        module - the module to use
        cls - the class the annotation is located in
        method - the method the annotation is located in, empty string if not applicable
      • process

        public boolean process​(Set<? extends TypeElement> annotations,
                               RoundEnvironment roundEnv)
        Processes a set of annotation types on type elements originating from the prior round and returns whether or not these annotations are claimed by this processor. If true is returned, the annotations are claimed and subsequent processors will not be asked to process them; if false is returned, the annotations are unclaimed and subsequent processors may be asked to process them. A processor may always return the same boolean value or may vary the result based on chosen criteria.

        The input set will be empty if the processor supports "*" and the root elements have no annotations. A Processor must gracefully handle an empty set of annotations.

        Specified by:
        process in interface Processor
        Specified by:
        process in class AbstractProcessor
        annotations - the annotation types requested to be processed
        roundEnv - environment for information about the current and prior round
        whether or not the set of annotations are claimed by this processor