Class AnnotatedClassScanner

java.lang.Object
org.infinispan.protostream.annotations.impl.processor.AnnotatedClassScanner

final class AnnotatedClassScanner extends Object
Discovers the classes to process based on the package and class filter specified in the AutoProtoSchemaBuilder annotation.
Since:
4.3
  • Field Details

    • log

      private static final Log log
    • classes

      private TreeMap<String,TypeMirror> classes
      Keep them sorted by FQN for predictable and repeatable order of processing.
    • messager

      private final Messager messager
    • elements

      private final Elements elements
    • types

      private final Types types
    • typeFactory

      private final MirrorTypeFactory typeFactory
    • builderElement

      private final Element builderElement
    • builderAnnotation

      private final ProtoSchemaAnnotation builderAnnotation
    • basePackages

      private final Set<String> basePackages
    • includedClasses

      private final Set<TypeMirror> includedClasses
    • excludedClasses

      private final Set<TypeMirror> excludedClasses
    • packageOfInitializer

      private final PackageElement packageOfInitializer
    • initializerClassName

      private final String initializerClassName
    • initializerFQClassName

      private final String initializerFQClassName
  • Constructor Details

  • Method Details

    • getInitializerClassName

      String getInitializerClassName()
    • getInitializerFQClassName

      String getInitializerFQClassName()
    • getClasses

      Collection<? extends TypeMirror> getClasses()
    • getXClasses

      Set<XClass> getXClasses()
    • discoverClasses

      void discoverClasses(RoundEnvironment roundEnv) throws AnnotationProcessingException
      Gathers the message/enum classes to process and generate marshallers for.
      Throws:
      AnnotationProcessingException
    • visitTypeElement

      private void visitTypeElement(TypeElement e)
    • visitProtoFactory

      private void visitProtoFactory(Element e)
    • visitProtoField

      private void visitProtoField(Element e)
    • visitProtoEnumValue

      private void visitProtoEnumValue(Element e)
    • visitProtoAdapter

      private void visitProtoAdapter(Element e)
    • visitProtoTypeId

      private void visitProtoTypeId(Element e)
    • visitProtoName

      private void visitProtoName(Element e)
    • visitProto

      private void visitProto(Element e)
    • getOriginatingClasses

      private Set<TypeElement> getOriginatingClasses()
      Extracts the old root elements from the previously generated initializer source code.
    • getAnnotationValue

      private static AnnotationValue getAnnotationValue(AnnotationMirror annotation, String name)
      Gets the value of the name element of the annotation.
      Throws:
      NoSuchElementException - if the annotation has no element named name
    • isClassAcceptable

      boolean isClassAcceptable(XClass c)
      Tests if a given class (which may have not been specifically included) is acceptable for inclusion.
    • getBasePackages

      private Set<String> getBasePackages()
    • collectClasses

      private void collectClasses(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.
    • isPublicElement

      private boolean isPublicElement(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.
    • isPackageIncluded

      private boolean isPackageIncluded(PackageElement packageElement)
      Checks if a package is included in the given set of packages, considering also their subpackages recursively.