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 booleanprivate Elementsprivate Filerprivate Set<TypeElement> private Messagerprivate TypesFields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClassIndexProcessor(Class<?>... classes) Used when creating subclasses of the processor which will index some annotations which cannot be itself annotated withIndexAnnotatedorIndexSubclasses. -
Method Summary
Modifier and TypeMethodDescriptionprivate StringgetFullName(TypeElement typeElement) private PackageElementgetPackage(Element typeElement) private StringgetShortName(TypeElement typeElement) private booleanhasAnnotation(TypeElement element, Class<? extends Annotation> inheritedClass) protected final voidindexAnnotations(Class<?>... classes) Adds given annotations for indexing.protected final voidindexPackages(String... packages) Adds given package for indexing.protected final voidindexSubclasses(Class<?>... classes) Adds given classes for subclass indexing.private voidindexSupertypes(TypeElement rootElement, TypeElement element) voidinit(ProcessingEnvironment processingEnv) booleanprocess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) private <K> voidputElement(Map<K, Set<String>> map, K keyElement, String valueElement) private <K> voidputElement(Map<K, Set<String>> map, K keyElement, TypeElement valueElement) private static voidreadOldIndexFile(Set<String> entries, Reader reader) private FileObjectreadOldIndexFile(Set<String> entries, String resourceName) private voidstoreAnnotation(TypeElement annotationElement, TypeElement rootElement) private voidstoreClassFromPackage(PackageElement packageElement, TypeElement rootElement) private voidstoreJavadoc(TypeElement element) private voidstoreRepeatableAnnotation(AnnotationMirror annotation, TypeElement typeElement) private voidstoreSubclass(TypeElement superTypeElement, TypeElement rootElement) private voidprivate voidwriteIndexFile(Set<String> entries, String resourceName, FileObject overrideFile) private voidprivate voidwriteSimpleNameIndexFile(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 withIndexAnnotatedorIndexSubclasses.- 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:
getSupportedSourceVersionin interfaceProcessor- Overrides:
getSupportedSourceVersionin classAbstractProcessor
-
getSupportedAnnotationTypes
- Specified by:
getSupportedAnnotationTypesin interfaceProcessor- Overrides:
getSupportedAnnotationTypesin classAbstractProcessor
-
init
- Specified by:
initin interfaceProcessor- Overrides:
initin classAbstractProcessor
-
process
- Specified by:
processin interfaceProcessor- Specified by:
processin 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
-