Package org.simpleframework.xml.convert
Class ScannerBuilder.Entry
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.concurrent.ConcurrentHashMap<java.lang.Object,T>
-
- org.simpleframework.xml.util.ConcurrentCache<java.lang.annotation.Annotation>
-
- org.simpleframework.xml.convert.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
TheEntry
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>
-
-
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 theEntry
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>
Tfind(java.lang.Class<T> label)
This method will scan a class for the specified annotation.<T extends java.lang.annotation.Annotation>
Tscan(java.lang.Class<T> type)
This method will scan a class for the specified annotation.-
Methods inherited from class org.simpleframework.xml.util.ConcurrentCache
cache, contains, fetch, take
-
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
-
-
-
-
Constructor Detail
-
Entry
public Entry(java.lang.Class root)
Constructor for theEntry
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.
-
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
-
-