Class ScannerBuilder.Entry

All Implemented Interfaces:
Serializable, ConcurrentMap<Object,Annotation>, Map<Object,Annotation>, Scanner, Cache<Annotation>
Enclosing class:
ScannerBuilder

private static class ScannerBuilder.Entry extends ConcurrentCache<Annotation> implements Scanner
The Entry object represents a scanner that is used to scan a specified type for annotations. All annotations scanned from the type are cached so that they do not need to be looked up twice. This ensures scanning is much quicker.
  • Field Details

    • root

      private final Class root
      This class is the subject for all annotation scans performed.
  • Constructor Details

    • Entry

      public Entry(Class root)
      Constructor for the Entry object is used to create a scanner that will scan the specified type. All annotations that are scanned are cached to ensure that they do not need to be looked up twice. This ensures that scans are quicker including ones that result in null.
      Parameters:
      root - this is the root class that is to be scanned
  • Method Details

    • scan

      public <T extends Annotation> T scan(Class<T> type)
      This method will scan a class for the specified annotation. If the annotation is found on the class, or on one of the super types then it is returned. All scans will be cached to ensure scanning is only performed once.
      Specified by:
      scan in interface Scanner
      Parameters:
      type - this is the annotation type to be scanned for
      Returns:
      this will return the annotation if it is found
    • find

      private <T extends Annotation> T find(Class<T> label)
      This method will scan a class for the specified annotation. If the annotation is found on the class, or on one of the super types then it is returned. All scans will be cached to ensure scanning is only performed once.
      Parameters:
      label - this is the annotation type to be scanned for
      Returns:
      this will return the annotation if it is found