public class ValueWriterLocator 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.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 int |
CACHE_FLAGS |
protected BeanPropertyWriter[] |
NO_PROPS_FOR_WRITE |
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 |
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 int |
_findSimpleType(Class<?> raw,
boolean forSer) |
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) |
protected 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
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 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)
protected int _findSimpleType(Class<?> raw, boolean forSer)
Copyright © 2020 FasterXML. All rights reserved.