Package org.atteo.classindex.processor
Class ClassIndexProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
org.atteo.classindex.processor.ClassIndexProcessor
- All Implemented Interfaces:
Processor
Generates index files for
ClassIndex
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private Elements
private Filer
private Set
<TypeElement> private Messager
private Types
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ClassIndexProcessor
(Class<?>... classes) Used when creating subclasses of the processor which will index some annotations which cannot be itself annotated withIndexAnnotated
orIndexSubclasses
. -
Method Summary
Modifier and TypeMethodDescriptionprivate String
getFullName
(TypeElement typeElement) private PackageElement
getPackage
(Element typeElement) private String
getShortName
(TypeElement typeElement) private boolean
hasAnnotation
(TypeElement element, Class<? extends Annotation> inheritedClass) protected final void
indexAnnotations
(Class<?>... classes) Adds given annotations for indexing.protected final void
indexPackages
(String... packages) Adds given package for indexing.protected final void
indexSubclasses
(Class<?>... classes) Adds given classes for subclass indexing.private void
indexSupertypes
(TypeElement rootElement, TypeElement element) void
init
(ProcessingEnvironment processingEnv) boolean
process
(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) private <K> void
putElement
(Map<K, Set<String>> map, K keyElement, String valueElement) private <K> void
putElement
(Map<K, Set<String>> map, K keyElement, TypeElement valueElement) private static void
readOldIndexFile
(Set<String> entries, Reader reader) private FileObject
readOldIndexFile
(Set<String> entries, String resourceName) private void
storeAnnotation
(TypeElement annotationElement, TypeElement rootElement) private void
storeClassFromPackage
(PackageElement packageElement, TypeElement rootElement) private void
storeJavadoc
(TypeElement element) private void
storeRepeatableAnnotation
(AnnotationMirror annotation, TypeElement typeElement) private void
storeSubclass
(TypeElement superTypeElement, TypeElement rootElement) private void
private void
writeIndexFile
(Set<String> entries, String resourceName, FileObject overrideFile) private void
private void
writeSimpleNameIndexFile
(Set<String> elementList, String resourceName) Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedOptions, isInitialized
-
Field Details
-
subclassMap
-
annotatedMap
-
packageMap
-
annotationDriven
private boolean annotationDriven -
indexedAnnotations
-
indexedSuperclasses
-
indexedPackages
-
javadocAlreadyStored
-
types
-
filer
-
elementUtils
-
messager
-
-
Constructor Details
-
ClassIndexProcessor
public ClassIndexProcessor() -
ClassIndexProcessor
Used when creating subclasses of the processor which will index some annotations which cannot be itself annotated withIndexAnnotated
orIndexSubclasses
.- Parameters:
classes
- list of classes which the processor will be indexing
-
-
Method Details
-
indexAnnotations
Adds given annotations for indexing. -
indexSubclasses
Adds given classes for subclass indexing. -
indexPackages
Adds given package for indexing. -
getSupportedSourceVersion
- Specified by:
getSupportedSourceVersion
in interfaceProcessor
- Overrides:
getSupportedSourceVersion
in classAbstractProcessor
-
getSupportedAnnotationTypes
- Specified by:
getSupportedAnnotationTypes
in interfaceProcessor
- Overrides:
getSupportedAnnotationTypes
in classAbstractProcessor
-
init
- Specified by:
init
in interfaceProcessor
- Overrides:
init
in classAbstractProcessor
-
process
- Specified by:
process
in interfaceProcessor
- Specified by:
process
in classAbstractProcessor
-
storeRepeatableAnnotation
private void storeRepeatableAnnotation(AnnotationMirror annotation, TypeElement typeElement) throws IOException - Throws:
IOException
-
writeIndexFiles
- Throws:
IOException
-
readOldIndexFile
- Throws:
IOException
-
readOldIndexFile
- Throws:
IOException
-
writeIndexFile
private void writeIndexFile(Set<String> entries, String resourceName, FileObject overrideFile) throws IOException - Throws:
IOException
-
writeSimpleNameIndexFile
private void writeSimpleNameIndexFile(Set<String> elementList, String resourceName) throws IOException - Throws:
IOException
-
writeFile
- Throws:
IOException
-
indexSupertypes
- Throws:
IOException
-
hasAnnotation
-
storeAnnotation
private void storeAnnotation(TypeElement annotationElement, TypeElement rootElement) throws IOException - Throws:
IOException
-
storeSubclass
private void storeSubclass(TypeElement superTypeElement, TypeElement rootElement) throws IOException - Throws:
IOException
-
storeClassFromPackage
private void storeClassFromPackage(PackageElement packageElement, TypeElement rootElement) throws IOException - Throws:
IOException
-
putElement
-
putElement
-
getFullName
-
getShortName
-
getPackage
-
storeJavadoc
- Throws:
IOException
-