static class JsonValueSerializer.TypeSerializerRerouter extends TypeSerializer
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object |
_forObject |
protected TypeSerializer |
_typeSerializer |
Constructor and Description |
---|
TypeSerializerRerouter(TypeSerializer ts,
java.lang.Object ob) |
Modifier and Type | Method and Description |
---|---|
TypeSerializer |
forProperty(BeanProperty prop)
Method called to create contextual version, to be used for
values of given property.
|
java.lang.String |
getPropertyName()
Name of property that contains type information, if
property-based inclusion is used.
|
TypeIdResolver |
getTypeIdResolver()
Accessor for object that handles conversions between
types and matching type ids.
|
com.fasterxml.jackson.annotation.JsonTypeInfo.As |
getTypeInclusion()
Accessor for type information inclusion method
that serializer uses; indicates how type information
is embedded in resulting JSON.
|
void |
writeCustomTypePrefixForArray(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.String typeId)
Deprecated.
|
void |
writeCustomTypePrefixForObject(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.String typeId)
Deprecated.
|
void |
writeCustomTypePrefixForScalar(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.String typeId)
Deprecated.
|
void |
writeCustomTypeSuffixForArray(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.String typeId)
Deprecated.
|
void |
writeCustomTypeSuffixForObject(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.String typeId)
Deprecated.
|
void |
writeCustomTypeSuffixForScalar(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.String typeId)
Deprecated.
|
com.fasterxml.jackson.core.type.WritableTypeId |
writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator g,
com.fasterxml.jackson.core.type.WritableTypeId typeId)
Method called to write initial part of type information for given
value, along with possible wrapping to use: details are specified
by `typeId` argument.
|
void |
writeTypePrefixForArray(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen)
Deprecated.
|
void |
writeTypePrefixForArray(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.Class<?> type)
Deprecated.
|
void |
writeTypePrefixForObject(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen)
Deprecated.
|
void |
writeTypePrefixForObject(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.Class<?> type)
Deprecated.
|
void |
writeTypePrefixForScalar(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen)
Deprecated.
|
void |
writeTypePrefixForScalar(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.Class<?> type)
Deprecated.
|
com.fasterxml.jackson.core.type.WritableTypeId |
writeTypeSuffix(com.fasterxml.jackson.core.JsonGenerator g,
com.fasterxml.jackson.core.type.WritableTypeId typeId)
Method that should be called after
TypeSerializer.writeTypePrefix(JsonGenerator, WritableTypeId)
and matching value write have been called, passing WritableTypeId returned. |
void |
writeTypeSuffixForArray(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen)
Deprecated.
|
void |
writeTypeSuffixForObject(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen)
Deprecated.
|
void |
writeTypeSuffixForScalar(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen)
Deprecated.
|
_writeLegacySuffix, typeId, typeId, typeId
protected final TypeSerializer _typeSerializer
protected final java.lang.Object _forObject
public TypeSerializerRerouter(TypeSerializer ts, java.lang.Object ob)
public TypeSerializer forProperty(BeanProperty prop)
TypeSerializer
Collection
or Map
valued properties).forProperty
in class TypeSerializer
public com.fasterxml.jackson.annotation.JsonTypeInfo.As getTypeInclusion()
TypeSerializer
getTypeInclusion
in class TypeSerializer
public java.lang.String getPropertyName()
TypeSerializer
getPropertyName
in class TypeSerializer
public TypeIdResolver getTypeIdResolver()
TypeSerializer
getTypeIdResolver
in class TypeSerializer
public com.fasterxml.jackson.core.type.WritableTypeId writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator g, com.fasterxml.jackson.core.type.WritableTypeId typeId) throws java.io.IOException
TypeSerializer
See TypeSerializer.writeTypeSuffix(JsonGenerator, WritableTypeId)
for a complete
example of typical usage.
writeTypePrefix
in class TypeSerializer
g
- Generator to use for outputting type id and possible wrappingtypeId
- Details of what type id is to be written, how.java.io.IOException
public com.fasterxml.jackson.core.type.WritableTypeId writeTypeSuffix(com.fasterxml.jackson.core.JsonGenerator g, com.fasterxml.jackson.core.type.WritableTypeId typeId) throws java.io.IOException
TypeSerializer
TypeSerializer.writeTypePrefix(JsonGenerator, WritableTypeId)
and matching value write have been called, passing WritableTypeId
returned.
Usual idiom is:
// Indicator generator that type identifier may be needed; generator may write // one as suggested, modify information, or take some other action // NOTE! For Object/Array types, this will ALSO write start marker! WritableTypeId typeIdDef = typeSer.writeTypePrefix(gen, typeSer.typeId(value, JsonToken.START_OBJECT)); // serializing actual value for which TypeId may have been written... like // NOTE: do NOT write START_OBJECT before OR END_OBJECT after: g.writeStringField("message", "Hello, world!" // matching type suffix call to let generator chance to add suffix, if any // NOTE! For Object/Array types, this will ALSO write end marker! typeSer.writeTypeSuffix(gen, typeIdDef);
writeTypeSuffix
in class TypeSerializer
java.io.IOException
@Deprecated public void writeTypePrefixForScalar(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen) throws java.io.IOException
TypeSerializer
writeTypePrefix(g, typeId(value, JsonToken.VALUE_STRING));
.
See TypeSerializer.writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
for more info.writeTypePrefixForScalar
in class TypeSerializer
java.io.IOException
@Deprecated public void writeTypePrefixForObject(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen) throws java.io.IOException
TypeSerializer
writeTypePrefix(g, typeId(value, JsonToken.START_OBJECT));
.
See TypeSerializer.writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
for more info.writeTypePrefixForObject
in class TypeSerializer
java.io.IOException
@Deprecated public void writeTypePrefixForArray(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen) throws java.io.IOException
TypeSerializer
writeTypePrefix(g, typeId(value, JsonToken.START_ARRAY));
.
See TypeSerializer.writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
for more info.writeTypePrefixForArray
in class TypeSerializer
java.io.IOException
@Deprecated public void writeTypeSuffixForScalar(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen) throws java.io.IOException
TypeSerializer
writeTypeSuffix(g, typeId(value, JsonToken.VALUE_STRING));
.
See TypeSerializer.writeTypeSuffix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
for more info.writeTypeSuffixForScalar
in class TypeSerializer
java.io.IOException
@Deprecated public void writeTypeSuffixForObject(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen) throws java.io.IOException
TypeSerializer
writeTypeSuffix(g, typeId(value, JsonToken.START_OBJECT));
.
See TypeSerializer.writeTypeSuffix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
for more info.writeTypeSuffixForObject
in class TypeSerializer
java.io.IOException
@Deprecated public void writeTypeSuffixForArray(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen) throws java.io.IOException
TypeSerializer
writeTypeSuffix(g, typeId(value, JsonToken.START_ARRAY));
.
See TypeSerializer.writeTypeSuffix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
for more info.writeTypeSuffixForArray
in class TypeSerializer
java.io.IOException
@Deprecated public void writeTypePrefixForScalar(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen, java.lang.Class<?> type) throws java.io.IOException
TypeSerializer
writeTypePrefix(g, typeId(value, type, JsonToken.VALUE_STRING));
.
See TypeSerializer.writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
for more info.writeTypePrefixForScalar
in class TypeSerializer
java.io.IOException
@Deprecated public void writeTypePrefixForObject(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen, java.lang.Class<?> type) throws java.io.IOException
TypeSerializer
writeTypePrefix(g, typeId(value, type, JsonToken.START_OBJECT));
.
See TypeSerializer.writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
for more info.writeTypePrefixForObject
in class TypeSerializer
java.io.IOException
@Deprecated public void writeTypePrefixForArray(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen, java.lang.Class<?> type) throws java.io.IOException
TypeSerializer
writeTypePrefix(g, typeId(value, type, JsonToken.START_ARRAY));
.
See TypeSerializer.writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
for more info.writeTypePrefixForArray
in class TypeSerializer
java.io.IOException
@Deprecated public void writeCustomTypePrefixForScalar(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen, java.lang.String typeId) throws java.io.IOException
TypeSerializer
writeTypePrefix(g, typeId(value, JsonToken.VALUE_STRING, typeId));
.
See TypeSerializer.writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
for more info.writeCustomTypePrefixForScalar
in class TypeSerializer
java.io.IOException
@Deprecated public void writeCustomTypePrefixForObject(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen, java.lang.String typeId) throws java.io.IOException
TypeSerializer
writeTypePrefix(g, typeId(value, JsonToken.START_OBJECT, typeId));
.
See TypeSerializer.writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
for more info.writeCustomTypePrefixForObject
in class TypeSerializer
java.io.IOException
@Deprecated public void writeCustomTypePrefixForArray(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen, java.lang.String typeId) throws java.io.IOException
TypeSerializer
writeTypePrefix(g, typeId(value, JsonToken.START_ARRAY, typeId));
.
See TypeSerializer.writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
for more info.writeCustomTypePrefixForArray
in class TypeSerializer
java.io.IOException
@Deprecated public void writeCustomTypeSuffixForScalar(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen, java.lang.String typeId) throws java.io.IOException
writeCustomTypeSuffixForScalar
in class TypeSerializer
java.io.IOException
@Deprecated public void writeCustomTypeSuffixForObject(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen, java.lang.String typeId) throws java.io.IOException
writeCustomTypeSuffixForObject
in class TypeSerializer
java.io.IOException
@Deprecated public void writeCustomTypeSuffixForArray(java.lang.Object value, com.fasterxml.jackson.core.JsonGenerator gen, java.lang.String typeId) throws java.io.IOException
writeCustomTypeSuffixForArray
in class TypeSerializer
java.io.IOException