Interface AnnotationTargets_Targets


public interface AnnotationTargets_Targets

Annotation targets tables. Results include package source information, class source information, class relationship information and annotation targets information.

Package source information consists of a listing of packages partitioned by the class source which provided each package.

Class source information consists of a listing of classes partitioned by the class source which provided each class.

Class relationship information consists of class to interface relationships and class to superclass relationships.

Annotation information consists of the recording of package, class, field, and method annotation occurrences. Results are stored as mappings of package and class names to annotation names. Detail values for the annotation occurrences are not recorded. The particular target field or methods of the occurrences are not recorded.

Results are partitioned by scan policy (see ClassSource_Aggregate.ScanPolicy), respectively, SEED, PARTIAL, EXCLUDED, and EXTERNAL. For non-web module cases, only SEED and EXTERNAL apply. Web module cases use PARTIAL and EXCLUDED for particular cases involving metadata-complete fragment jars and for particular cases involving web module jars which were excluded by their omittion from an absolute ordering specified for the web module.

Classes are recorded for SEED, PARTIAL, and EXCLUDED regions. Classes are recorded for EXTERNAL regions only as needed to complete class relationship information.

Annotations occurrences are recorded for SEED, PARTIAL, and EXCLUDED regions. Annotation occurrences are omitted from EXTERNAL regions.

Annotation selection queries default to select SEED results, unless an explicit selection policy is specified. When specified, the selection policy is the bitwise OR of scan policy values. Results are selected from all regions which are included in specified policy.

Helpers are available for selecting classes which are the target of inherited class annotations. Particular care must be used when selecting such classes. The helpers may be used for non-inheritable class annotations, but will obtain meaningless results. Using the helpers, usually, the regions used to select the classes declaring annotations is the same as the region used to select the inheriting classes. However, the helpers allow these regions to be different.

  • Field Details

  • Method Details

    • getFactory

      Answer the factory which was used to create this targets table. Objects created from this targets table use this factory.

      Returns:
      The factory used to create this targets table.
    • addClassSource

      void addClassSource(ClassSource classSource, ClassSource_Aggregate.ScanPolicy scanPolicy)

      Add a class source to the aggregate class source held by this targets table.

      Parameters:
      classSource - The class source to add to this targets table.
      scanPolicy - The policy to set for the class source.
    • getIsDetailEnabled

      boolean getIsDetailEnabled()

      Tell if detail mode is enabled for the targets tables. Field and method annotations are recorded only when detail mode is enabled.

      At this time, detail mode is always enabled. A capability to enable/disable field and method annotation recording is provided as a future enhancement. A small performance gain is achieved by disabling field and method annotation recording. A small to large space savings is achieved by disabling field and method annotations, depending on the relative quantity of field and method annotations in the target scan space.

      Returns:
      True if detail mode is enabled. Otherwise, false.
    • scan

      void scan(ClassSource_Aggregate classSource) throws AnnotationTargets_Exception

      Perform a scan of the specified class source, injecting scan data into the annotation targets.

      Parameters:
      classSource - The class source which is to be scanned.
      Throws:
      AnnotationTargets_Exception - Thrown if an error occurred during scanning.
    • scan

      void scan(ClassSource_Aggregate classSource, Set<String> specificClassNames) throws AnnotationTargets_Exception

      Perform a scan of the specified class source, injecting scan data into the annotation targets. Scan only the specified classes.

      Parameters:
      classSource - The class source which is to be scanned.
      specificClassNames - The names of the specific classes which are to be scanned.
      Throws:
      AnnotationTargets_Exception - Thrown if an error occurred during scanning.
    • scan

      void scan(ClassSource_Aggregate classSource, boolean greedy) throws AnnotationTargets_Exception
      Throws:
      AnnotationTargets_Exception
    • isSeedClassName

      boolean isSeedClassName(String className)

      Tell if a particular named class is a seed class name.

      Parameters:
      className - The class name to test.
      Returns:
      True if the named class was scanned as a seed class. Otherwise, false. getSeedClassNames()
    • getSeedClassNames

      Set<String> getSeedClassNames()

      Answer the seed class names.

      Returns:
      The seed class names.
    • isPartialClassName

      boolean isPartialClassName(String className)

      Tell if a particular named class is a partial class.

      Parameters:
      className - The class name to test.
      Returns:
      True if the named class is a partial class. Otherwise, false. getPartialClassNames()
    • getPartialClassNames

      Set<String> getPartialClassNames()

      Answer the partial class names.

      Returns:
      The partial class names.
    • isExcludedClassName

      boolean isExcludedClassName(String className)

      Tell if a particular named class is an excluded class.

      Parameters:
      className - The class name to test.
      Returns:
      True if the named class is an excluded class. Otherwise, false. getExcludedClassNames()
    • getExcludedClassNames

      Set<String> getExcludedClassNames()

      Answer the excluded class names.

      Returns:
      The seed class names.
    • isExternalClassName

      boolean isExternalClassName(String className)

      Tell if a particular named class is an external class.

      Parameters:
      className - The class name to test.
      Returns:
      True if the named class is an external class. Otherwise, false. getExternalClassNames()
    • getExternalClassNames

      Set<String> getExternalClassNames()

      Answer the external class names.

      Returns:
      The external class names.
    • isInstanceOf

      boolean isInstanceOf(String candidateClassName, Class<?> criterionClass)

      Tell if a candidate class is an instance of a specified class.

      Parameters:
      candidateClassName - The name of the class to test.
      criterionClass - The class to test against.
      Returns:
      True if the candidate class is an instance of the criterion class. Otherwise, false.
    • getSuperclassName

      String getSuperclassName(String className)

      Answer the name of the super class of a target class. Answer null if the target class is java.lang.Object, or is an interface.

      Parameters:
      className - The name of the target class.
      Returns:
      The name of the superclass of the target class.
    • getSubclassNames

      Set<String> getSubclassNames(String className)

      Answer the name of all of the subclasses of a target class.

      Parameters:
      className - The class for which to obtain subclass names.
      Returns:
      The names of all subclasses of the target class.
    • getAllImplementorsOf

      Set<String> getAllImplementorsOf(String interfaceName)

      Answer the names of all the implementors of a target interface.

      Parameters:
      interfaceName - The name of the target interface.
      Returns:
      The names of all implementers of the target interface.
    • getAnnotatedPackages

      Set<String> getAnnotatedPackages()

      Answer the names of packages having annotations. Limit results to SEED packages.

      Returns:
      The names of the packages having annotations.
    • getAnnotatedPackages

      Set<String> getAnnotatedPackages(String annotationName)

      Answer the names of packages having the specified annotation. Limit results to SEED packages.

      Parameters:
      annotationName - The name of the annotation on which to select.
      Returns:
      The names of the packages having the specified annotation.
    • getPackageAnnotations

      Set<String> getPackageAnnotations()

      Answer all recorded SEED package annotations.

      Returns:
      The names of all recorded SEED package annotations.
    • getPackageAnnotations

      Set<String> getPackageAnnotations(String packageName)

      Answer the annotations of a specified package. Select from SEED results.

      Parameters:
      packageName - The name of the package for which to select annotations.
      Returns:
      The names of annotations of the named package, selected from SEED results.
    • getAnnotatedClasses

      Set<String> getAnnotatedClasses()

      Answer the names of classes having class annotations. Limit results to SEED classes.

      Returns:
      The names of the classes having class annotations.
    • getAnnotatedClasses

      Set<String> getAnnotatedClasses(String annotationName)

      Answer the names of classes having the specified annotation. Limit results to SEED classes.

      Parameters:
      annotationName - The name of the class annotation on which to select.
      Returns:
      The names of the classes having the specified class annotation.
    • getClassAnnotations

      Set<String> getClassAnnotations()

      Answer all recorded SEED class annotations.

      Returns:
      The names of all recorded SEED class annotations.
    • getClassAnnotations

      Set<String> getClassAnnotations(String className)

      Answer the class annotations of a specified class. Select from SEED results.

      Parameters:
      className - The name of the class for which to select class annotations.
      Returns:
      The names of class annotations of the named class, selected from SEED results.
    • getClassesWithFieldAnnotation

      Set<String> getClassesWithFieldAnnotation(String annotationName)

      Answer the names of the classes having any declared occurrence of the specified field annotation. Select from within SEED results.

      Parameters:
      annotationName - The name of the field annotation on which to select.
      Returns:
      The names of the classes having the specified field annotation.
    • getFieldAnnotations

      Set<String> getFieldAnnotations()

      Answer the names of recorded field annotations. Select from within SEED results.

      Returns:
      The names of field annotations of the named class, selected from SEED results.
    • getFieldAnnotations

      Set<String> getFieldAnnotations(String className)

      Answer the names of the field annotations recorded on the specified class. Select from within SEED results.

      Parameters:
      className - The name of the class for which to select field annotations.
      Returns:
      The names of field annotations of the named class, selected from SEED results.
    • getClassesWithMethodAnnotation

      Set<String> getClassesWithMethodAnnotation(String annotationName)

      Answer the names of the classes having any declared occurrence of the specified method annotation. Select from within SEED results.

      Parameters:
      annotationName - The name of the method annotation on which to select.
      Returns:
      The names of the classes having the specified method annotation.
    • getMethodAnnotations

      Set<String> getMethodAnnotations()

      Answer the names of the recorded annotations. Select from within SEED results.

      Returns:
      The names of method annotations, selected from SEED results.
    • getMethodAnnotations

      Set<String> getMethodAnnotations(String className)

      Answer the names of the method annotations recorded on the specified class. Select from within SEED results.

      Parameters:
      className - The name of the class for which to select method annotations.
      Returns:
      The names of method annotations of the named class, selected from SEED results.
    • getAnnotatedClasses

      Set<String> getAnnotatedClasses(String classSourceName, String annotationName)

      Answer the names of the classes having the specified class annotation. Limit the results to classes within the specified class source and to SEED results.

      Parameters:
      classSourceName - The name of the class source used to restrict the results.
      annotationName - The name of the class annotation on which to select.
      Returns:
      The names of the classes having the specified class annotation.
    • getAnnotatedClasses

      Set<String> getAnnotatedClasses(String classSourceName, String annotationName, int scanPolicies)

      Answer the names of the classes having the specified class annotation. Limit the results to classes within the specified class source and to the specified results.

      Parameters:
      classSourceName - The name of the class source used to restrict the results.
      annotationName - The name of the class annotation on which to select.
      scanPolicies - The policies for which to select annotated classes, as bitwise OR of scan policy values.
      Returns:
      The names of the classes having the specified class annotation.
    • getClassNames

      Set<String> getClassNames(int scanPolicies)

      Answer the class names in the specified regions.

      Parameters:
      scanPolicies - The scan policies for which to select class names.
      Returns:
      The names of all classes in the specified regions.
    • getAnnotatedPackages

      Set<String> getAnnotatedPackages(int scanPolicies)

      Answer the names of packages having annotations. Limit results to the specified regions.

      Parameters:
      scanPolicies - The policies for which to select annotated packages, as bitwise OR of scan policy values.
      Returns:
      The names of the packages having annotations.
    • getAnnotatedPackages

      Set<String> getAnnotatedPackages(String annotationName, int scanPolicies)

      Answer the names of packages having the specified annotation. Limit results to the specified regions.

      Parameters:
      annotationName - The name of the package annotation on which to select.
      scanPolicies - The policies for which to select annotated packages, as bitwise OR of scan policy values.
      Returns:
      The names of the packages having the specified annotation.
    • getPackageAnnotations

      Set<String> getPackageAnnotations(int scanPolicies)

      Answer the names of recorded package annotations. Restrict results to only those recorded in the specified regions.

      Parameters:
      scanPolicies - The policies for which to select package annotations, as bitwise OR of scan policy values.
      Returns:
      The names of recorded package annotations selected from the specified results.
    • getPackageAnnotations

      Set<String> getPackageAnnotations(String packageName, int scanPolicies)

      Answer the names of annotations on the specified package. Restrict results to only those recorded in the specified regions.

      Parameters:
      packageName - The name of the package for which to select annotations.
      scanPolicies - The policies for which to select package annotations, as bitwise OR of scan policy values.
      Returns:
      The names of annotations of the named package, selected from the specified results.
    • getAnnotatedClasses

      Set<String> getAnnotatedClasses(int scanPolicies)

      Answer the names of classes having class annotations. Limit results to the specified regions.

      Parameters:
      scanPolicies - The policies for which to select annotated classes, as bitwise OR of scan policy values.
      Returns:
      The names of the classes having class annotations.
    • getAnnotatedClasses

      Set<String> getAnnotatedClasses(String annotationName, int scanPolicies)

      Answer the names of classes having the specified annotation. Limit results to the specified regions.

      Parameters:
      annotationName - The name of the class annotation on which to select.
      scanPolicies - The policies for which to select annotated classes, as bitwise OR of scan policy values.
      Returns:
      The names of the classes having the specified class annotation.
    • getClassAnnotations

      Set<String> getClassAnnotations(int scanPolicies)

      Answer the names of recorded class annotations. Restrict results to only those recorded in the specified regions.

      Parameters:
      scanPolicies - The policies for which to select class annotations, as bitwise OR of scan policy values.
      Returns:
      The names of recorded class annotations selected from the specified results.
    • getClassAnnotations

      Set<String> getClassAnnotations(String className, int scanPolicies)

      Answer the names of annotations on the specified class. Restrict results to only those recorded in the specified regions.

      Parameters:
      className - The name of the class for which to select class annotations.
      scanPolicies - The policies for which to select class annotations, as bitwise OR of scan policy values.
      Returns:
      The names of class annotations of the named class, selected from the specified results.
    • getClassesWithFieldAnnotations

      Set<String> getClassesWithFieldAnnotations(int scanPolicies)

      Answer the names of the classes having any declared occurrence of a field annotation. Select from within the specified results.

      Parameters:
      scanPolicies - The policies for which to select class annotations, as bitwise OR of scan policy values.
      Returns:
      The names of the classes having a field annotation.
    • getClassesWithFieldAnnotation

      Set<String> getClassesWithFieldAnnotation(String annotationName, int scanPolicies)

      Answer the names of the classes having any declared occurrence of the specified field annotation. Select from within the specified results.

      Parameters:
      annotationName - The name of the field annotation on which to select.
      scanPolicies - The policies for which to select class annotations, as bitwise OR of scan policy values.
      Returns:
      The names of the classes having the specified field annotation.
    • getFieldAnnotations

      Set<String> getFieldAnnotations(int scanPolicies)

      Answer the names of recorded field annotations. Select from within the specified results.

      Parameters:
      scanPolicies - The policies for which to select class annotations, as bitwise OR of scan policy values.
      Returns:
      The names of field annotations of the named class, selected from the specified results.
    • getFieldAnnotations

      Set<String> getFieldAnnotations(String className, int scanPolicies)

      Answer the names of the field annotations recorded on the specified class. Select from within the specified results.

      Parameters:
      className - The name of the class for which to select field annotations.
      scanPolicies - The policies for which to select class annotations, as bitwise OR of scan policy values.
      Returns:
      The names of field annotations of the named class, selected from the specified results.
    • getClassesWithMethodAnnotations

      Set<String> getClassesWithMethodAnnotations(int scanPolicies)

      Answer the names of the classes having any method annotations. Select Select from within the specified results.

      Parameters:
      scanPolicies - The policies for which to select class annotations, as bitwise OR of scan policy values.
      Returns:
      The names of the classes having the specified method annotation.
    • getClassesWithMethodAnnotation

      Set<String> getClassesWithMethodAnnotation(String annotationName, int scanPolicies)

      Answer the names of the classes having any declared occurrence of the specified method annotation. Select from within the specified results.

      Parameters:
      annotationName - The name of the method annotation on which to select.
      scanPolicies - The policies for which to select class annotations, as bitwise OR of scan policy values.
      Returns:
      The names of the classes having the specified method annotation.
    • getMethodAnnotations

      Set<String> getMethodAnnotations(int scanPolicies)

      Answer the names of the recorded method annotations. Select from within the specified results.

      Parameters:
      scanPolicies - The policies for which to select class annotations, as bitwise OR of scan policy values.
      Returns:
      The names of method annotations of the named class, selected from the specified results.
    • getMethodAnnotations

      Set<String> getMethodAnnotations(String className, int scanPolicies)

      Answer the names of the method annotations recorded on the specified class. Select from within the specified results.

      Parameters:
      className - The name of the class for which to select method annotations.
      scanPolicies - The policies for which to select class annotations, as bitwise OR of scan policy values.
      Returns:
      The names of method annotations of the named class, selected from the specified results.
    • getAllInheritedAnnotatedClasses

      Set<String> getAllInheritedAnnotatedClasses(String annotationName)

      Utility for inherited class annotations: Find classes which have the specified class annotation, or which are a subclass of a class which has the specified class annotation.

      Restrict the result to annotations specified in SEED classes and inherited by SEED classes. (Inheritance information may traverse non SEED classes.)

      Do NOT use this method if the specified annotation type is not an inherited class annotation, as it is inefficient for that purpose. Use getAnnotatedClasses(String) instead.

      The operation does not require that the specified annotation type be an inherited class annotation. The result, however, is meaningless if the class annotation is not actually inherited.

      No similar capability is provided for method annotations. Method annotations are not inheritable. For the related handling of annotations on inherited methods, more comprehensive processing must be performed, as method overloading must be taken into account. Use java reflection or the class info store to process annotations on inherited methods.

      Parameters:
      annotationName - The class annotation for which to obtain annotations.
      Returns:
      All targets of a specified class annotation, including both declared and inheriting targets
    • getAllInheritedAnnotatedClasses

      Set<String> getAllInheritedAnnotatedClasses(String annotationName, int scanPolicies)

      Utility for inherited class annotations. Similar to getAllInheritedAnnotatedClasses(String), except that the results are restricted to annotations declared in the specified results and inherited by classes in the specified results.

      Parameters:
      annotationName - The class annotation for which to obtain annotations.
      scanPolicies - The policies for which to select classes, as bitwise OR of scan policy values. Applies to both declaring and inheriting classes considered for the results.
      Returns:
      All targets of a specified class annotation, including both declared and inheriting targets, but limited by the selection policy.
    • getAllInheritedAnnotatedClasses

      Set<String> getAllInheritedAnnotatedClasses(String annotationName, int declarerScanPolicies, int inheritorScanPolicies)

      Utility for inherited class annotations. Similar to getAllInheritedAnnotatedClasses(String), except that the results are restricted to annotations declared the specified results and inherited by classes in distinct specified results.

      Parameters:
      annotationName - The class annotation for which to obtain annotations.
      declarerScanPolicies - The policies for which to select classes, as bitwise OR of scan policy values. Used to select classes which declare an occurrence of the specified annotation.
      inheritorScanPolicies - The policies for which to select classes, as bitwise OR of scan policy values. Used to select classes which inherit from the selected annotated classes.
      Returns:
      All targets of a specified class annotation, including both declared and inheriting targets, but limited by selection policies.