public class ValueWriterLocator extends ValueLocatorBase
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.JSONWriter, 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 |
protected ConcurrentHashMap<ClassKey,Integer> |
_knownSerTypes
Mapping from classes to resolved type constants or indexes, to use
for serialization.
|
protected CopyOnWriteArrayList<ValueWriter> |
_knownWriters |
protected JSONWriter |
_writeContext |
protected ReaderWriterModifier |
_writerModifier
Provider for reader customizer, if any; may be null.
|
protected ReaderWriterProvider |
_writerProvider
Provider for custom writers, if any; may be null.
|
protected static BeanPropertyWriter[] |
NO_PROPS_FOR_WRITE |
CACHE_FLAGS, SER_BOOLEAN, SER_BOOLEAN_ARRAY, SER_BYTE_ARRAY, SER_CALENDAR, SER_CHAR, SER_CHAR_ARRAY, SER_CHARACTER_SEQUENCE, SER_CLASS, SER_COLLECTION, SER_DATE, SER_ENUM, SER_FILE, SER_INT_ARRAY, SER_ITERABLE, SER_LIST, SER_LONG_ARRAY, SER_MAP, SER_NUMBER_BIG_DECIMAL, SER_NUMBER_BIG_INTEGER, SER_NUMBER_BYTE, SER_NUMBER_DOUBLE, SER_NUMBER_FLOAT, SER_NUMBER_INTEGER, SER_NUMBER_LONG, SER_NUMBER_SHORT, SER_OBJECT_ARRAY, SER_STRING, SER_TREE_NODE, SER_UNKNOWN, SER_URI, SER_URL, SER_UUID
Modifier | Constructor and Description |
---|---|
protected |
ValueWriterLocator(int features,
ReaderWriterProvider rwp,
ReaderWriterModifier rwm)
Constructor for the blueprint instance (and variations)
|
protected |
ValueWriterLocator(ValueWriterLocator base,
int features,
JSONWriter w) |
Modifier and Type | Method and Description |
---|---|
protected int |
_findPOJOSerializationType(Class<?> raw)
Method called to locate a serializer for given type and return numeric id.
|
protected POJODefinition |
_resolveBeanDef(Class<?> raw) |
protected BeanPropertyWriter[] |
_resolveBeanForSer(Class<?> raw,
POJODefinition beanDef) |
static ValueWriterLocator |
blueprint(ReaderWriterProvider rwp,
ReaderWriterModifier rwm) |
int |
findSerializationType(Class<?> raw)
The main lookup method used to find type identifier for
given raw class; including Bean types (if allowed).
|
ValueWriter |
getValueWriter(int index) |
ValueWriterLocator |
perOperationInstance(JSONWriter w,
int features) |
ValueWriterLocator |
with(ReaderWriterModifier rwm) |
ValueWriterLocator |
with(ReaderWriterProvider rwp) |
_findSimpleType
protected static final BeanPropertyWriter[] NO_PROPS_FOR_WRITE
protected final ConcurrentHashMap<ClassKey,Integer> _knownSerTypes
protected final CopyOnWriteArrayList<ValueWriter> _knownWriters
protected final ReaderWriterProvider _writerProvider
protected final ReaderWriterModifier _writerModifier
protected final int _features
protected final JSONWriter _writeContext
protected ValueWriterLocator(int features, ReaderWriterProvider rwp, ReaderWriterModifier rwm)
protected ValueWriterLocator(ValueWriterLocator base, int features, JSONWriter w)
public static final ValueWriterLocator blueprint(ReaderWriterProvider rwp, ReaderWriterModifier rwm)
public ValueWriterLocator with(ReaderWriterProvider rwp)
public ValueWriterLocator with(ReaderWriterModifier rwm)
public ValueWriterLocator perOperationInstance(JSONWriter w, int features)
public ValueWriter getValueWriter(int index)
public final int findSerializationType(Class<?> raw)
protected POJODefinition _resolveBeanDef(Class<?> raw)
protected int _findPOJOSerializationType(Class<?> raw)
ReaderWriterProvider
String
,
Boolean
, Number
and a small number of other JDK types
protected BeanPropertyWriter[] _resolveBeanForSer(Class<?> raw, POJODefinition beanDef)
Copyright © 2023 FasterXML. All rights reserved.