Class ScannerBuilder

  • All Implemented Interfaces:
    java.io.Serializable, java.util.concurrent.ConcurrentMap<java.lang.Object,​Scanner>, java.util.Map<java.lang.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:
    ConverterScanner
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  ScannerBuilder.Entry
      The Entry object represents a scanner that is used to scan a specified type for annotations.
      • Nested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap

        java.util.concurrent.ConcurrentHashMap.KeySetView<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      ScannerBuilder()
      Constructor for the ScannerBuilder object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Scanner build​(java.lang.Class<?> type)
      This is used to build Scanner objects that are used to scan the provided class for annotations.
      • Methods inherited from class java.util.concurrent.ConcurrentHashMap

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, get, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, put, putAll, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values
      • Methods inherited from class java.util.AbstractMap

        clone
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.simpleframework.xml.util.Cache

        isEmpty
    • Constructor Detail

      • 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 Detail

      • build

        public Scanner build​(java.lang.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