Package com.fasterxml.jackson.jr.ob.impl
Class ValueWriterLocator
java.lang.Object
com.fasterxml.jackson.jr.ob.impl.ValueLocatorBase
com.fasterxml.jackson.jr.ob.impl.ValueWriterLocator
Helper object used for efficient detection of type information
relevant to our conversion needs when writing out Java Objects
as JSON.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected final ConcurrentHashMap<ClassKey,Integer> Mapping from classes to resolved type constants or indexes, to use for serialization.protected final CopyOnWriteArrayList<ValueWriter>protected final JSONWriterprotected final ReaderWriterModifierProvider for reader customizer, if any; may be null.protected final ReaderWriterProviderProvider for custom writers, if any; may be null.protected static final BeanPropertyWriter[]Fields inherited from class com.fasterxml.jackson.jr.ob.impl.ValueLocatorBase
CACHE_FLAGS, SER_BOOLEAN, SER_BOOLEAN_ARRAY, SER_BOOLEAN_WRAPPER, SER_BYTE_ARRAY, SER_CALENDAR, SER_CHAR, SER_CHAR_ARRAY, SER_CHARACTER_SEQUENCE, SER_CLASS, SER_COLLECTION, SER_DATE, SER_DOUBLE_ARRAY, SER_ENUM, SER_FILE, SER_FLOAT_ARRAY, 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_DOUBLE_WRAPPER, SER_NUMBER_FLOAT, SER_NUMBER_FLOAT_WRAPPER, SER_NUMBER_INTEGER, SER_NUMBER_INTEGER_WRAPPER, SER_NUMBER_LONG, SER_NUMBER_LONG_WRAPPER, SER_NUMBER_SHORT, SER_OBJECT_ARRAY, SER_PATH, SER_SHORT_ARRAY, SER_STRING, SER_TREE_NODE, SER_UNKNOWN, SER_URI, SER_URL, SER_UUID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedValueWriterLocator(int features, ReaderWriterProvider rwp, ReaderWriterModifier rwm) Constructor for the blueprint instance (and variations)protectedValueWriterLocator(ValueWriterLocator base, int features, JSONWriter w) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 final ValueWriterLocatorfinal intfindSerializationType(Class<?> raw) The main lookup method used to find type identifier for given raw class; including Bean types (if allowed).getValueWriter(int index) perOperationInstance(JSONWriter w, int features) with(ReaderWriterModifier rwm) with(ReaderWriterProvider rwp) Methods inherited from class com.fasterxml.jackson.jr.ob.impl.ValueLocatorBase
_findSimpleType
-
Field Details
-
NO_PROPS_FOR_WRITE
-
_knownSerTypes
Mapping from classes to resolved type constants or indexes, to use for serialization. -
_knownWriters
-
_writerProvider
Provider for custom writers, if any; may be null.- Since:
- 2.10
-
_writerModifier
Provider for reader customizer, if any; may be null.- Since:
- 2.11
-
_features
protected final int _features -
_writeContext
-
-
Constructor Details
-
ValueWriterLocator
Constructor for the blueprint instance (and variations) -
ValueWriterLocator
-
-
Method Details
-
blueprint
public static final ValueWriterLocator blueprint(ReaderWriterProvider rwp, ReaderWriterModifier rwm) -
with
-
with
-
perOperationInstance
-
getValueWriter
-
findSerializationType
The main lookup method used to find type identifier for given raw class; including Bean types (if allowed). -
_resolveBeanDef
-
_findPOJOSerializationType
Method called to locate a serializer for given type and return numeric id. Serializer can be found using one of follow methods (in order of lookups):- Custom serializer via
ReaderWriterProvider - Simple type supported out-of-the-box, for types like
String,Boolean,Numberand a small number of other JDK types - Bean-style POJOs with accessors (getters, public fields)
- Custom serializer via
-
_resolveBeanForSer
-