Class ScannerBuilder

All Implemented Interfaces:
Serializable, ConcurrentMap<Object,Scanner>, Map<Object,Scanner>, Cache<Scanner>

class ScannerBuilder extends ConcurrentCache<Scanner>
The ScannerBuilder is used to build and cache each scanner requested. Building and caching scanners ensures that annotations can be acquired from a class quickly as a scan only needs to be performed once. Each scanner built scans the class provided as well as all the classes in the hierarchy.
See Also:
  • Constructor Details

    • ScannerBuilder

      public ScannerBuilder()
      Constructor for the ScannerBuilder object. This will create a builder for annotation scanners. Each of the scanners build will be cached internally to ensure that any further requests for the scanner are quicker.
  • Method Details

    • build

      public Scanner build(Class<?> type)
      This is used to build Scanner objects that are used to scan the provided class for annotations. Each scanner instance is cached once created to ensure it does not need to be built twice, which improves the performance.
      Parameters:
      type - this is the type to build a scanner object for
      Returns:
      this will return a scanner instance for the given type