Class AnnotatedClassScanner
java.lang.Object
org.infinispan.protostream.annotations.impl.processor.AnnotatedClassScanner
Discovers the classes to process based on the package and class filter specified in the
AutoProtoSchemaBuilder
annotation.- Since:
- 4.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ProtoSchemaAnnotationprivate final Elementprivate TreeMap<String, TypeMirror> Keep them sorted by FQN for predictable and repeatable order of processing.private final Elementsprivate final Set<TypeMirror> private final Set<TypeMirror> private final Stringprivate final Stringprivate static final Logprivate final Messagerprivate final PackageElementprivate final MirrorTypeFactoryprivate final Types -
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedClassScanner(Messager messager, Elements elements, Types types, MirrorTypeFactory typeFactory, Element builderElement, ProtoSchemaAnnotation builderAnnotation) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcollectClasses(TypeElement typeElement) Checks if the type is included by given set of packages and is visible to the initializer and adds it to collected classes Map if it satisfies all conditions.(package private) voiddiscoverClasses(RoundEnvironment roundEnv) Gathers the message/enum classes to process and generate marshallers for.private static AnnotationValuegetAnnotationValue(AnnotationMirror annotation, String name) Gets the value of thenameelement of the annotation.(package private) Collection<? extends TypeMirror> (package private) String(package private) Stringprivate Set<TypeElement> Extracts the old root elements from the previously generated initializer source code.(package private) booleanTests if a given class (which may have not been specifically included) is acceptable for inclusion.private booleanisPackageIncluded(PackageElement packageElement) Checks if a package is included in the given set of packages, considering also their subpackages recursively.private booleanisPublicElement(TypeElement typeElement) Checks if the given type and all its outer types up to top level type have the PUBLIC modifier which ensures their visibility to a different package.private voidprivate voidprivate voidprivate voidprivate voidprivate voidprivate voidprivate void
-
Field Details
-
log
-
classes
Keep them sorted by FQN for predictable and repeatable order of processing. -
messager
-
elements
-
types
-
typeFactory
-
builderElement
-
builderAnnotation
-
basePackages
-
includedClasses
-
excludedClasses
-
packageOfInitializer
-
initializerClassName
-
initializerFQClassName
-
-
Constructor Details
-
AnnotatedClassScanner
AnnotatedClassScanner(Messager messager, Elements elements, Types types, MirrorTypeFactory typeFactory, Element builderElement, ProtoSchemaAnnotation builderAnnotation)
-
-
Method Details
-
getInitializerClassName
String getInitializerClassName() -
getInitializerFQClassName
String getInitializerFQClassName() -
getClasses
Collection<? extends TypeMirror> getClasses() -
getXClasses
-
discoverClasses
Gathers the message/enum classes to process and generate marshallers for.- Throws:
AnnotationProcessingException
-
visitTypeElement
-
visitProtoFactory
-
visitProtoField
-
visitProtoEnumValue
-
visitProtoAdapter
-
visitProtoTypeId
-
visitProtoName
-
visitProto
-
getOriginatingClasses
Extracts the old root elements from the previously generated initializer source code. -
getAnnotationValue
Gets the value of thenameelement of the annotation.- Throws:
NoSuchElementException- if the annotation has no element namedname
-
isClassAcceptable
Tests if a given class (which may have not been specifically included) is acceptable for inclusion. -
getBasePackages
-
collectClasses
Checks if the type is included by given set of packages and is visible to the initializer and adds it to collected classes Map if it satisfies all conditions. -
isPublicElement
Checks if the given type and all its outer types up to top level type have the PUBLIC modifier which ensures their visibility to a different package. -
isPackageIncluded
Checks if a package is included in the given set of packages, considering also their subpackages recursively.
-