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 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, typeIdprotected final TypeSerializer _typeSerializer
protected final java.lang.Object _forObject
public TypeSerializerRerouter(TypeSerializer ts, java.lang.Object ob)
public TypeSerializer forProperty(BeanProperty prop)
TypeSerializerCollection or Map
valued properties).forProperty in class TypeSerializerpublic com.fasterxml.jackson.annotation.JsonTypeInfo.As getTypeInclusion()
TypeSerializergetTypeInclusion in class TypeSerializerpublic java.lang.String getPropertyName()
TypeSerializergetPropertyName in class TypeSerializerpublic TypeIdResolver getTypeIdResolver()
TypeSerializergetTypeIdResolver in class TypeSerializerpublic 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 TypeSerializerg - Generator to use for outputting type id and possible wrappingtypeId - Details of what type id is to be written, how.java.io.IOExceptionpublic com.fasterxml.jackson.core.type.WritableTypeId writeTypeSuffix(com.fasterxml.jackson.core.JsonGenerator g,
com.fasterxml.jackson.core.type.WritableTypeId typeId)
throws java.io.IOException
TypeSerializerTypeSerializer.writeTypePrefix(JsonGenerator, WritableTypeId)
and matching value write have 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 TypeSerializerjava.io.IOException@Deprecated
public void writeTypePrefixForScalar(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen)
throws java.io.IOException
TypeSerializerwriteTypePrefix(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 TypeSerializerjava.io.IOException@Deprecated
public void writeTypePrefixForObject(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen)
throws java.io.IOException
TypeSerializerwriteTypePrefix(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 TypeSerializerjava.io.IOException@Deprecated
public void writeTypePrefixForArray(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen)
throws java.io.IOException
TypeSerializerwriteTypePrefix(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 TypeSerializerjava.io.IOException@Deprecated
public void writeTypeSuffixForScalar(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen)
throws java.io.IOException
TypeSerializerwriteTypeSuffix(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 TypeSerializerjava.io.IOException@Deprecated
public void writeTypeSuffixForObject(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen)
throws java.io.IOException
TypeSerializerwriteTypeSuffix(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 TypeSerializerjava.io.IOException@Deprecated
public void writeTypeSuffixForArray(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen)
throws java.io.IOException
TypeSerializerwriteTypeSuffix(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 TypeSerializerjava.io.IOException@Deprecated
public void writeTypePrefixForScalar(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.Class<?> type)
throws java.io.IOException
TypeSerializerwriteTypePrefix(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 TypeSerializerjava.io.IOException@Deprecated
public void writeTypePrefixForObject(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.Class<?> type)
throws java.io.IOException
TypeSerializerwriteTypePrefix(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 TypeSerializerjava.io.IOException@Deprecated
public void writeTypePrefixForArray(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.Class<?> type)
throws java.io.IOException
TypeSerializerwriteTypePrefix(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 TypeSerializerjava.io.IOException@Deprecated
public void writeCustomTypePrefixForScalar(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.String typeId)
throws java.io.IOException
TypeSerializerwriteTypePrefix(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 TypeSerializerjava.io.IOException@Deprecated
public void writeCustomTypePrefixForObject(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.String typeId)
throws java.io.IOException
TypeSerializerwriteTypePrefix(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 TypeSerializerjava.io.IOException@Deprecated
public void writeCustomTypePrefixForArray(java.lang.Object value,
com.fasterxml.jackson.core.JsonGenerator gen,
java.lang.String typeId)
throws java.io.IOException
TypeSerializerwriteTypePrefix(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 TypeSerializerjava.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 TypeSerializerjava.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 TypeSerializerjava.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 TypeSerializerjava.io.IOException