Package org.simpleframework.xml.convert
Class ScannerBuilder
java.lang.Object
java.util.AbstractMap<Object,Scanner>
java.util.concurrent.ConcurrentHashMap<Object,Scanner>
org.simpleframework.xml.util.ConcurrentCache<Scanner>
org.simpleframework.xml.convert.ScannerBuilder
- All Implemented Interfaces:
Serializable
,ConcurrentMap<Object,
,Scanner> Map<Object,
,Scanner> Cache<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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
TheEntry
object represents a scanner that is used to scan a specified type for annotations.Nested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap
ConcurrentHashMap.KeySetView<K,
V> Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
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
Methods inherited from class java.util.AbstractMap
clone
-
Constructor Details
-
ScannerBuilder
public ScannerBuilder()Constructor for theScannerBuilder
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
This is used to buildScanner
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
-