Deprecated
as a consequence of StdSerializer being deprecated. See corresponding docs for further information.
ReferenceType.
Implements most of functionality, only leaving couple of abstract
methods for sub-classes to implement.
| Modifier and Type | Field and Description |
|---|---|
| protected transient PropertySerializerMap | _dynamicSerializers
If element type cannot be statically determined, mapping from runtime type to serializer is handled using this object |
| protected final BeanProperty | |
| protected final JavaType | _referredType
Value type |
| protected final Object | _suppressableValue
Value that indicates suppression mechanism to use for values contained;
either "filter" (of which |
| protected final boolean | _suppressNulls
Flag that indicates what to do with `null` values, distinct from
handling of |
| protected final NameTransformer | _unwrapper
In case of unwrapping, need name transformer. |
| protected final JsonSerializer | _valueSerializer
Serializer for content values, if statically known. |
| protected final TypeSerializer | _valueTypeSerializer
Type serializer used for values, if any. |
| public static final Object | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | ReferenceTypeSerializer(ReferenceType fullType, boolean staticTyping, TypeSerializer vts, JsonSerializer<Object> ser)
|
| protected | ReferenceTypeSerializer(ReferenceTypeSerializer<?> base, BeanProperty property, TypeSerializer vts, JsonSerializer<?> valueSer, NameTransformer unwrapper, Object suppressableValue, boolean suppressNulls)
Deprecated
as a consequence of
ReferenceTypeSerializer being deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
| private final JsonSerializer | _findCachedSerializer(SerializerProvider provider, Class<?> rawType)
Helper method that encapsulates logic of retrieving and caching required serializer. |
| private final JsonSerializer | |
| protected abstract Object | |
| protected abstract Object | |
| protected abstract boolean | |
| protected boolean | |
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType
Type of element (entity like property) being visited typeHint)Overrides com. Implements com. |
| public JsonSerializer | createContextual(SerializerProvider
Serializer provider to use for accessing config, other serializers provider, BeanProperty Method or field that represents the property
(and is used to access value to serialize).
Should be available; but there may be cases where caller cannot provide it and
null is passed instead (in which case impls usually pass 'this' serializer as is) property)Implements com. |
| public JavaType | |
| public boolean | isEmpty(SerializerProvider provider, T value)
Overrides com. |
| public boolean | isUnwrappingSerializer()
Overrides com. |
| public void | serialize(T
Value to serialize; can not be null. ref, JsonGenerator Generator used to output resulting Json content g, SerializerProvider Provider that can be used to get serializers for
serializing Objects value contains, if any. provider)Implements abstract com. |
| public void | serializeWithType(T
Value to serialize; can not be null. ref, JsonGenerator Generator used to output resulting Json content g, SerializerProvider Provider that can be used to get serializers for
serializing Objects value contains, if any. provider, TypeSerializer Type serializer to use for including type information typeSer)Overrides com. |
| public JsonSerializer | unwrappingSerializer(NameTransformer
Name transformation to use to convert between names
of unwrapper properties transformer)Overrides com. |
| public abstract ReferenceTypeSerializer | withContentInclusion(Object suppressableValue, boolean suppressNulls)
Deprecated
as a consequence of
Mutant factory method called to create a differently constructed instance,
specifically with different exclusion rules for contained value.
ReferenceTypeSerializer being deprecated.
|
| protected abstract ReferenceTypeSerializer | withResolved(BeanProperty prop, TypeSerializer vts, JsonSerializer<?> valueSer, NameTransformer unwrapper)
Deprecated
as a consequence of
Mutant factory method called when changes are needed; should construct
newly configured instance with new values as indicated.
ReferenceTypeSerializer being deprecated.
|
| _dynamicSerializers | back to summary |
|---|---|
| protected transient PropertySerializerMap _dynamicSerializers If element type cannot be statically determined, mapping from runtime type to serializer is handled using this object | |
| _property | back to summary |
|---|---|
| protected final BeanProperty _property | |
| _referredType | back to summary |
|---|---|
| protected final JavaType _referredType Value type | |
| _suppressableValue | back to summary |
|---|---|
| protected final Object _suppressableValue Value that indicates suppression mechanism to use for values contained;
either "filter" (of which
| |
| _suppressNulls | back to summary |
|---|---|
| protected final boolean _suppressNulls Flag that indicates what to do with `null` values, distinct from
handling of
| |
| _unwrapper | back to summary |
|---|---|
| protected final NameTransformer _unwrapper In case of unwrapping, need name transformer. | |
| _valueSerializer | back to summary |
|---|---|
| protected final JsonSerializer<Object> _valueSerializer Serializer for content values, if statically known. | |
| _valueTypeSerializer | back to summary |
|---|---|
| protected final TypeSerializer _valueTypeSerializer Type serializer used for values, if any. | |
| MARKER_FOR_EMPTY | back to summary |
|---|---|
public static final Object MARKER_FOR_EMPTY
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| ReferenceTypeSerializer | back to summary |
|---|---|
| public ReferenceTypeSerializer(ReferenceType fullType, boolean staticTyping, TypeSerializer vts, JsonSerializer<Object> ser) | |
| ReferenceTypeSerializer | back to summary |
|---|---|
| protected ReferenceTypeSerializer(ReferenceTypeSerializer<?> base, BeanProperty property, TypeSerializer vts, JsonSerializer<?> valueSer, NameTransformer unwrapper, Object suppressableValue, boolean suppressNulls)
Deprecated as a consequence of
| |
| _findCachedSerializer | back to summary |
|---|---|
| private final JsonSerializer Helper method that encapsulates logic of retrieving and caching required serializer. | |
| _findSerializer | back to summary |
|---|---|
| private final JsonSerializer | |
| _getReferenced | back to summary |
|---|---|
| protected abstract Object _getReferenced(T value) | |
| _getReferencedIfPresent | back to summary |
|---|---|
| protected abstract Object _getReferencedIfPresent(T value) | |
| _isValuePresent | back to summary |
|---|---|
| protected abstract boolean _isValuePresent(T value) Method called to see if there is a value present or not. Note that value itself may still be `null`, even if present, if referential type allows three states (absent, present-null, present-non-null); some only allow two (absent, present-non-null). | |
| _useStatic | back to summary |
|---|---|
| protected boolean _useStatic(SerializerProvider provider, BeanProperty property, JavaType referredType) | |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException Overrides com. Implements com. Doc from com. Default implementation specifies no format. This behavior is usually overriden by custom serializers.
| |
| createContextual | back to summary |
|---|---|
| public JsonSerializer Implements com. Doc from com. Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property. Note that instance that this method is called on is typically shared one and as a result method should NOT modify this instance but rather construct and return a new instance. This instance should only be returned as-is, in case it is already suitable for use.
| |
| getReferredType | back to summary |
|---|---|
public JavaType getReferredType()
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty(SerializerProvider provider, T value) Overrides com. Doc from com. Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values). Default implementation will consider only null values to be empty. Note replaces
| |
| isUnwrappingSerializer | back to summary |
|---|---|
| public boolean isUnwrappingSerializer() Overrides com. Doc from com. Accessor for checking whether this serializer is an "unwrapping" serializer; this is necessary to know since it may also require caller to suppress writing of the leading property name.
| |
| serialize | back to summary |
|---|---|
| public void serialize(T ref, JsonGenerator g, SerializerProvider provider) throws IOException Implements abstract com. Doc from com. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(T ref, JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException Overrides com. Doc from com. Method that can be called to ask implementation to serialize values of type this serializer handles, using specified type serializer for embedding necessary type information.
Default implementation will throw For simple datatypes written as a single scalar value (JSON String, Number, Boolean), implementation would look like: // note: method to call depends on whether this type is serialized as JSON scalar, object or Array! typeSer.writeTypePrefixForScalar(value, gen); serialize(value, gen, provider); typeSer.writeTypeSuffixForScalar(value, gen);and implementations for type serialized as JSON Arrays or Objects would differ slightly, as START-ARRAY/END-ARRAY and
START-OBJECT/END-OBJECT pairs
need to be properly handled with respect to serializing of contents.
| |
| unwrappingSerializer | back to summary |
|---|---|
| public JsonSerializer Overrides com. Doc from com. Method that will return serializer instance that produces "unwrapped" serialization, if applicable for type being serialized (which is the case for some serializers that produce JSON Objects as output). If no unwrapped serializer can be constructed, will simply return serializer as-is. Default implementation just returns serializer as-is, indicating that no unwrapped variant exists
| |
| withContentInclusion | back to summary |
|---|---|
| public abstract ReferenceTypeSerializer Deprecated as a consequence of Mutant factory method called to create a differently constructed instance, specifically with different exclusion rules for contained value. Note caller has verified that there are changes, so implementations need NOT check if a new instance is needed.
| |
| withResolved | back to summary |
|---|---|
| protected abstract ReferenceTypeSerializer Deprecated as a consequence of Mutant factory method called when changes are needed; should construct newly configured instance with new values as indicated. Note caller has verified that there are changes, so implementations need NOT check if a new instance is needed.
| |