SerializationContext that adds methods needed by
ObjectMapper (and ObjectWriter) but that are not to be exposed
as general context during serialization.
Also note that all custom SerializationContext
implementations must sub-class this class: ObjectMapper
requires this type, not basic provider type.
| Modifier and Type | Class and Description |
|---|---|
| public static class | SerializationContextExt.
Concrete implementation defined separately so it can be declared `final`. |
| Modifier and Type | Field and Description |
|---|---|
| protected transient ArrayList | |
| protected transient Map | _seenObjectIds
Per-serialization map Object Ids that have seen so far, iff Object Id handling is enabled. |
| Access | Constructor and Description |
|---|---|
| protected | SerializationContextExt(TokenStreamFactory streamFactory, SerializationConfig config, GeneratorSettings genSettings, SerializerFactory f, SerializerCache cache)
|
| Modifier and Type | Method and Description |
|---|---|
| protected Map | _createObjectIdMap()
Overridable helper method used for creating |
| private final void | |
| private final void | |
| protected void | |
| public void | acceptJsonFormatVisitor(JavaType
The type for which to generate format javaType, JsonFormatVisitorWrapper the visitor to accept the format visitor)The method to be called by |
| public WritableObjectId | findObjectId(Object forPojo, ObjectIdGenerator<?> generatorType)
Implements abstract tools. Method called to find the Object Id for given POJO, if one has been generated. |
| public JsonGenerator | getGenerator()
Overrides tools. Accessor for the |
| public Object | includeFilterInstance(BeanPropertyDefinition forProperty, Class<?> filterClass)
Implements abstract tools. Method that can be called to construct and configure |
| public boolean | includeFilterSuppressNulls(Object filter)
Implements abstract tools. Follow-up method that may be called after calling |
| public void | serializePolymorphic(JsonGenerator gen, Object value, JavaType rootType, ValueSerializer<Object> valueSer, TypeSerializer typeSer)
Alternate serialization call used for polymorphic types, when |
| public ValueSerializer | serializerInstance(Annotated annotated, Object serDef)
Implements abstract tools. Method that can be called to construct and configure serializer instance,
either given a |
| public void | serializeValue(JsonGenerator gen, Object value)
The method to be called by |
| public void | serializeValue(JsonGenerator gen, Object value, JavaType
Type to use for locating serializer to use, instead of actual
runtime type. Must be actual type, or one of its super types rootType)The method to be called by |
| public void | serializeValue(JsonGenerator gen, Object value, JavaType
Type to use for locating serializer to use, instead of actual
runtime type, if no serializer is passed rootType, ValueSerializer<Object> Root Serializer to use, if not null ser)The method to be called by |
| public < Actual node type; usually either basic T extends JsonNode> TJsonNode or
tools. | Returns: (non-null) Root node of the resulting content tree: in case ofnull value node for which JsonNode#isNull() returns true.Java value to convert fromValue)Implements abstract tools. Method that
will convert given Java value (usually bean) into its
equivalent Tree model |
| _objectIdGenerators | back to summary |
|---|---|
| protected transient ArrayList<ObjectIdGenerator<?>> _objectIdGenerators | |
| _seenObjectIds | back to summary |
|---|---|
| protected transient Map<Object, WritableObjectId> _seenObjectIds Per-serialization map Object Ids that have seen so far, iff Object Id handling is enabled. | |
| SerializationContextExt | back to summary |
|---|---|
| protected SerializationContextExt(TokenStreamFactory streamFactory, SerializationConfig config, GeneratorSettings genSettings, SerializerFactory f, SerializerCache cache) | |
| _createObjectIdMap | back to summary |
|---|---|
| protected Map Overridable helper method used for creating | |
| _serialize | back to summary |
|---|---|
| private final void _serialize(JsonGenerator gen, Object value, ValueSerializer<Object> ser, PropertyName rootName) throws JacksonException | |
| _serialize | back to summary |
|---|---|
| private final void _serialize(JsonGenerator gen, Object value, ValueSerializer<Object> ser) throws JacksonException | |
| _serializeNull | back to summary |
|---|---|
| protected void _serializeNull(JsonGenerator gen) throws JacksonException Helper method called when root value to serialize is null | |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JavaType javaType, JsonFormatVisitorWrapper visitor) The method to be called by
| |
| findObjectId | back to summary |
|---|---|
| public WritableObjectId findObjectId(Object forPojo, ObjectIdGenerator<?> generatorType) Implements abstract tools. Doc from tools. Method called to find the Object Id for given POJO, if one has been generated. Will always return a non-null Object; contents vary depending on whether an Object Id already exists or not.
| |
| getGenerator | back to summary |
|---|---|
| public JsonGenerator getGenerator() Overrides tools. Accessor for the
| |
| includeFilterInstance | back to summary |
|---|---|
| public Object includeFilterInstance(BeanPropertyDefinition forProperty, Class<?> filterClass) Implements abstract tools. Doc from tools. Method that can be called to construct and configure
| |
| includeFilterSuppressNulls | back to summary |
|---|---|
| public boolean includeFilterSuppressNulls(Object filter) Implements abstract tools. Doc from tools. Follow-up method that may be called after calling
| |
| serializePolymorphic | back to summary |
|---|---|
| public void serializePolymorphic(JsonGenerator gen, Object value, JavaType rootType, ValueSerializer<Object> valueSer, TypeSerializer typeSer) throws JacksonException Alternate serialization call used for polymorphic types, when | |
| serializerInstance | back to summary |
|---|---|
| public ValueSerializer Implements abstract tools. Doc from tools. Method that can be called to construct and configure serializer instance,
either given a
| |
| serializeValue | back to summary |
|---|---|
| public void serializeValue(JsonGenerator gen, Object value) throws JacksonException The method to be called by | |
| serializeValue | back to summary |
|---|---|
| public void serializeValue(JsonGenerator gen, Object value, JavaType rootType) throws JacksonException The method to be called by
| |
| serializeValue | back to summary |
|---|---|
| public void serializeValue(JsonGenerator gen, Object value, JavaType rootType, ValueSerializer<Object> ser) throws JacksonException The method to be called by
| |
| valueToTree | back to summary |
|---|---|
| public <T extends JsonNode> T valueToTree(Object fromValue) throws JacksonException Implements abstract tools. Method that
will convert given Java value (usually bean) into its
equivalent Tree model Note while results are usually identical to that of serialization followed
by deserialization, this is not always the case. In some cases serialization
into intermediate representation will retain encapsulation of things like
raw value (
| |
SerializationContextExt
| Access | Constructor and Description |
|---|---|
| public | Impl(TokenStreamFactory streamFactory, SerializationConfig config, GeneratorSettings genSettings, SerializerFactory f, SerializerCache cache)
|
| Impl | back to summary |
|---|---|
| public Impl(TokenStreamFactory streamFactory, SerializationConfig config, GeneratorSettings genSettings, SerializerFactory f, SerializerCache cache) | |