public class ValueReaderLocator extends Object
Note that usage pattern is such that a single "root" instance is kept
by each JSON
instance; and
an actual per-operation instance must be constructed by calling
perOperationInstance(com.fasterxml.jackson.jr.ob.impl.JSONReader, int)
: reason for this is that instances
use simple caching to handle the common case of repeating types
within JSON Arrays.
Modifier and Type | Field and Description |
---|---|
protected int |
_features
Feature flags that are enabled
|
protected Map<ClassKey,ValueReader> |
_incompleteReaders
During resolution, some readers may be in-progress, but need to be
linked: for example, with cyclic type references.
|
protected ConcurrentHashMap<ClassKey,ValueReader> |
_knownReaders
Set of
ValueReader s that we have resolved |
protected JSONReader |
_readContext |
protected Object |
_readerLock
Object used for mutex during construction of a Bean deserializer: necessary
to avoid race conditions during handling of cyclic dependencies.
|
protected ReaderWriterModifier |
_readerModifier
Provider for reader customizer, if any; may be null.
|
protected ReaderWriterProvider |
_readerProvider
Provider for custom readers, if any; may be null.
|
protected TypeResolver |
_typeResolver
For generic containers (Collections, Maps, arrays), we may need
this guy.
|
protected static int |
CACHE_FLAGS |
protected static int |
MAX_CACHED_READERS
While we should be able to cache all types in the active working set,
we should also avoid potential unbounded retention, since there is
often just one big instance per JVM (or at least ClassLoader).
|
static int |
SER_BOOLEAN |
static int |
SER_BOOLEAN_ARRAY |
static int |
SER_BYTE_ARRAY |
static int |
SER_CALENDAR |
static int |
SER_CHAR |
static int |
SER_CHAR_ARRAY |
static int |
SER_CHARACTER_SEQUENCE |
static int |
SER_CLASS |
static int |
SER_COLLECTION
All kinds of
Collection s other than List s |
static int |
SER_DATE |
static int |
SER_ENUM |
static int |
SER_FILE |
static int |
SER_INT_ARRAY |
static int |
SER_ITERABLE
Anything that implements
Iterable , but not
Collection . |
static int |
SER_LIST
All kinds of
List s. |
static int |
SER_LONG_ARRAY |
static int |
SER_MAP
All kinds of
Map s. |
static int |
SER_NUMBER_BIG_DECIMAL |
static int |
SER_NUMBER_BIG_INTEGER |
static int |
SER_NUMBER_BYTE |
static int |
SER_NUMBER_DOUBLE |
static int |
SER_NUMBER_FLOAT |
static int |
SER_NUMBER_INTEGER |
static int |
SER_NUMBER_LONG |
static int |
SER_NUMBER_SHORT |
static int |
SER_OBJECT_ARRAY
Arrays of non-primitive types
|
static int |
SER_STRING |
static int |
SER_TREE_NODE
An implementation of
TreeNode |
static int |
SER_UNKNOWN
Type not yet resolved
|
static int |
SER_URI |
static int |
SER_URL |
static int |
SER_UUID |
Modifier | Constructor and Description |
---|---|
protected |
ValueReaderLocator(ReaderWriterProvider rwp,
ReaderWriterModifier rwm)
Constructor for the blueprint instance
|
protected |
ValueReaderLocator(ValueReaderLocator base,
int features,
JSONReader r) |
protected |
ValueReaderLocator(ValueReaderLocator base,
ReaderWriterProvider rwp,
ReaderWriterModifier rwm) |
Modifier and Type | Method and Description |
---|---|
protected ValueReader |
_createReader(Class<?> contextType,
Class<?> type,
Type genericType) |
protected int |
_findSimpleType(Class<?> raw,
boolean forSer) |
protected POJODefinition |
_resolveBeanDef(Class<?> raw) |
protected BeanReader |
_resolveBeanForDeser(Class<?> raw,
POJODefinition beanDef) |
protected ValueReader |
arrayReader(Class<?> contextType,
Class<?> arrayType) |
protected ValueReader |
beanReader(Class<?> type) |
static ValueReaderLocator |
blueprint(ReaderWriterProvider rwp,
ReaderWriterModifier rwm) |
protected ValueReader |
collectionReader(Class<?> collectionType,
ResolvedType valueType) |
protected ValueReader |
collectionReader(Class<?> contextType,
Type collectionType) |
protected ValueReader |
createReader(Class<?> contextType,
Class<?> type,
Type genericType)
Factory method for creating standard readers of any declared type.
|
protected ValueReader |
enumReader(Class<?> enumType) |
ValueReader |
findReader(Class<?> raw)
Method used during deserialization to find handler for given
non-generic type: will first check for already resolved (and cached) readers
-- and return if one found -- and then if no cached reader found, create
one, cache, return.
|
protected ValueReader |
mapReader(Class<?> mapType,
ResolvedType valueType) |
protected ValueReader |
mapReader(Class<?> contextType,
Type mapType) |
ValueReaderLocator |
perOperationInstance(JSONReader r,
int features) |
ReaderWriterModifier |
readerWriterModifier() |
ReaderWriterProvider |
readerWriterProvider() |
ValueReaderLocator |
with(ReaderWriterModifier rwm) |
ValueReaderLocator |
with(ReaderWriterProvider rwp) |
protected static final int MAX_CACHED_READERS
protected final TypeResolver _typeResolver
protected final ReaderWriterProvider _readerProvider
protected final ReaderWriterModifier _readerModifier
protected final ConcurrentHashMap<ClassKey,ValueReader> _knownReaders
ValueReader
s that we have resolvedprotected Map<ClassKey,ValueReader> _incompleteReaders
protected final Object _readerLock
protected final int _features
protected final JSONReader _readContext
public static final int SER_UNKNOWN
public static final int SER_MAP
Map
s.public static final int SER_LIST
List
s.public static final int SER_COLLECTION
Collection
s other than List
spublic static final int SER_OBJECT_ARRAY
public static final int SER_INT_ARRAY
public static final int SER_LONG_ARRAY
public static final int SER_BOOLEAN_ARRAY
public static final int SER_TREE_NODE
TreeNode
public static final int SER_STRING
public static final int SER_CHARACTER_SEQUENCE
public static final int SER_CHAR_ARRAY
public static final int SER_BYTE_ARRAY
public static final int SER_NUMBER_BYTE
public static final int SER_NUMBER_SHORT
public static final int SER_NUMBER_INTEGER
public static final int SER_NUMBER_LONG
public static final int SER_NUMBER_FLOAT
public static final int SER_NUMBER_DOUBLE
public static final int SER_NUMBER_BIG_INTEGER
public static final int SER_NUMBER_BIG_DECIMAL
public static final int SER_BOOLEAN
public static final int SER_CHAR
public static final int SER_ENUM
public static final int SER_DATE
public static final int SER_CALENDAR
public static final int SER_CLASS
public static final int SER_FILE
public static final int SER_UUID
public static final int SER_URL
public static final int SER_URI
public static final int SER_ITERABLE
Iterable
, but not
Collection
.protected static final int CACHE_FLAGS
protected ValueReaderLocator(ReaderWriterProvider rwp, ReaderWriterModifier rwm)
protected ValueReaderLocator(ValueReaderLocator base, int features, JSONReader r)
protected ValueReaderLocator(ValueReaderLocator base, ReaderWriterProvider rwp, ReaderWriterModifier rwm)
public static final ValueReaderLocator blueprint(ReaderWriterProvider rwp, ReaderWriterModifier rwm)
public ValueReaderLocator with(ReaderWriterProvider rwp)
public ValueReaderLocator with(ReaderWriterModifier rwm)
public ValueReaderLocator perOperationInstance(JSONReader r, int features)
public ReaderWriterProvider readerWriterProvider()
public ReaderWriterModifier readerWriterModifier()
public ValueReader findReader(Class<?> raw)
raw
- Type-erased type of value to find reader forprotected ValueReader createReader(Class<?> contextType, Class<?> type, Type genericType)
contextType
- Context for resolving generic type parameterstype
- Type-erased type of value to construct reader forgenericType
- Full (possibly) generic type of value to construct reader for (important
for Map
, Collection
).protected ValueReader _createReader(Class<?> contextType, Class<?> type, Type genericType)
protected ValueReader arrayReader(Class<?> contextType, Class<?> arrayType)
protected ValueReader enumReader(Class<?> enumType)
protected ValueReader collectionReader(Class<?> contextType, Type collectionType)
protected ValueReader collectionReader(Class<?> collectionType, ResolvedType valueType)
protected ValueReader mapReader(Class<?> contextType, Type mapType)
protected ValueReader mapReader(Class<?> mapType, ResolvedType valueType)
protected ValueReader beanReader(Class<?> type)
protected POJODefinition _resolveBeanDef(Class<?> raw)
protected BeanReader _resolveBeanForDeser(Class<?> raw, POJODefinition beanDef)
protected int _findSimpleType(Class<?> raw, boolean forSer)
Copyright © 2020 FasterXML. All rights reserved.