Class ScannerBuilder.Entry

  • All Implemented Interfaces:
    java.io.Serializable, java.util.concurrent.ConcurrentMap<java.lang.Object,​java.lang.annotation.Annotation>, java.util.Map<java.lang.Object,​java.lang.annotation.Annotation>, Scanner, Cache<java.lang.annotation.Annotation>
    Enclosing class:
    ScannerBuilder

    private static class ScannerBuilder.Entry
    extends ConcurrentCache<java.lang.annotation.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.
    • Nested Class Summary

      • 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>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class root
      This class is the subject for all annotation scans performed.
    • Constructor Summary

      Constructors 
      Constructor Description
      Entry​(java.lang.Class root)
      Constructor for the Entry object is used to create a scanner that will scan the specified type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private <T extends java.lang.annotation.Annotation>
      T
      find​(java.lang.Class<T> label)
      This method will scan a class for the specified annotation.
      <T extends java.lang.annotation.Annotation>
      T
      scan​(java.lang.Class<T> type)
      This method will scan a class for the specified annotation.
      • 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
    • Field Detail

      • root

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

      • Entry

        public Entry​(java.lang.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 Detail

      • scan

        public <T extends java.lang.annotation.Annotation> T scan​(java.lang.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 java.lang.annotation.Annotation> T find​(java.lang.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