| Modifier and Type | Field and Description |
|---|---|
| protected final JavaType | |
| protected final BeanPropertyWriter[] | _filteredProps
Optional filters used to suppress output of properties that are only to be included in certain views |
| protected final ObjectIdWriter | _objectIdWriter
If this POJO can be alternatively serialized using just an object id to denote a reference to previously serialized object, this Object will handle details. |
| protected final Object | _propertyFilterId
Id of the bean property filter to use, if any; null if none. |
| protected final BeanPropertyWriter[] | _props
Writers used for outputting actual property values |
| protected final JsonFormat. | _serializationShape
Requested shape from bean class annotations. |
| protected final AnnotatedMember | _typeId
If using custom type ids (usually via getter, or field), this is the reference to that member. |
| protected static final PropertyName | |
| protected static final BeanPropertyWriter[] |
| Access | Constructor and Description |
|---|---|
| protected | BeanSerializerBase(JavaType
Nominal type of values handled by this serializer type, BeanSerializerBuilder Builder for accessing other collected information builder, BeanPropertyWriter[] properties, BeanPropertyWriter[] filteredProperties)Constructor used by |
| protected | BeanSerializerBase(BeanSerializerBase src)
Copy-constructor that is useful for sub-classes that just want to copy all super-class properties without modifications. |
| protected | BeanSerializerBase(BeanSerializerBase src, BeanPropertyWriter[] properties, BeanPropertyWriter[] filteredProperties)
|
| protected | |
| protected | |
| protected | |
| protected | BeanSerializerBase(BeanSerializerBase src, NameTransformer unwrapper)
Copy-constructor that will also rename properties with given prefix (if it's non-empty) |
| Modifier and Type | Method and Description |
|---|---|
| protected void | _serializeObjectId(Object bean, JsonGenerator g, SerializationContext ctxt, TypeSerializer typeSer, WritableObjectId objectId)
|
| protected void | |
| protected void | _serializePropertiesFiltered(Object bean, JsonGenerator g, SerializationContext provider, Object filterId)
Alternative serialization method that gets called when there is a
|
| protected void | _serializePropertiesMaybeView(Object bean, JsonGenerator g, SerializationContext provider, BeanPropertyWriter[] props)
Method called when no JSON Filter is to be applied, but View filtering is in effect and so some of properties may be nulls to check. |
| protected void | _serializePropertiesNoView(Object bean, JsonGenerator gen, SerializationContext provider, BeanPropertyWriter[] props)
Method called when neither JSON Filter is to be applied, nor view-filtering. |
| protected final void | _serializeWithObjectId(Object bean, JsonGenerator g, SerializationContext provider, boolean startEndObject)
|
| protected final void | _serializeWithObjectId(Object bean, JsonGenerator g, SerializationContext provider, TypeSerializer typeSer)
|
| protected final WritableTypeId | |
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
Overrides tools. Implements tools. Default implementation specifies no format. |
| protected abstract BeanSerializerBase | |
| public boolean | canCreateArraySerializer()
Helper method for sub-classes to check if it should be possible to construct an "as-array" serializer. |
| public ValueSerializer | createContextual(SerializationContext ctxt, BeanProperty property)
Overrides tools. Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property (or, for root values, in which case `null` is passed). |
| protected ValueSerializer | findConvertingSerializer(SerializationContext provider, BeanPropertyWriter prop)
Helper method that can be used to see if specified property is annotated to indicate use of a converter for property value (in case of container types, it is container type itself, not key or content type). |
| public Object | |
| public boolean | hasViewProperties()
Accessor for checking if view-processing is enabled for this bean, that is, if it has separate set of properties with view-checking added. |
| public Iterator | properties()
Overrides tools. Accessor for iterating over logical properties that the type handled by this serializer has, from serialization perspective. |
| public int | |
| private static final BeanPropertyWriter[] | |
| public void | resolve(SerializationContext provider)
Overrides tools. We need to resolve dependant serializers here to be able to properly handle cyclic type references. |
| public abstract void | serialize(Object bean, JsonGenerator gen, SerializationContext provider)
Implements abstract tools. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| public void | serializeWithType(Object bean, JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer)
Overrides tools. 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. |
| public String | |
| public abstract ValueSerializer | unwrappingSerializer(NameTransformer unwrapper)
Overrides tools. Lets force sub-classes to implement this, to avoid accidental missing of handling... |
| public boolean | usesObjectId()
Overrides tools. Method that can be called to see whether this serializer instance will use Object Id to handle cyclic references. |
| protected abstract BeanSerializerBase | withByNameInclusion(Set<String> toIgnore, Set<String> toInclude)
Mutant factory used for creating a new instance with additional set of properties to ignore or include (from properties this instance otherwise has) |
| public abstract BeanSerializerBase | withFilterId(Object filterId)
Overrides tools. Mutant factory used for creating a new instance with different
filter id (used with |
| public abstract BeanSerializerBase | withObjectIdWriter(ObjectIdWriter objectIdWriter)
Mutant factory used for creating a new instance with different
|
| protected abstract BeanSerializerBase | withProperties(BeanPropertyWriter[] properties, BeanPropertyWriter[] filteredProperties)
Mutant factory used for creating a new instance with modified set of properties |
| _beanType | back to summary |
|---|---|
| protected final JavaType _beanType | |
| _filteredProps | back to summary |
|---|---|
| protected final BeanPropertyWriter[] _filteredProps Optional filters used to suppress output of properties that are only to be included in certain views | |
| _objectIdWriter | back to summary |
|---|---|
| protected final ObjectIdWriter _objectIdWriter If this POJO can be alternatively serialized using just an object id to denote a reference to previously serialized object, this Object will handle details. | |
| _propertyFilterId | back to summary |
|---|---|
| protected final Object _propertyFilterId Id of the bean property filter to use, if any; null if none. | |
| _props | back to summary |
|---|---|
| protected final BeanPropertyWriter[] _props Writers used for outputting actual property values | |
| _serializationShape | back to summary |
|---|---|
| protected final JsonFormat. Requested shape from bean class annotations. | |
| _typeId | back to summary |
|---|---|
| protected final AnnotatedMember _typeId If using custom type ids (usually via getter, or field), this is the reference to that member. | |
| NAME_FOR_OBJECT_REF | back to summary |
|---|---|
| protected static final PropertyName NAME_FOR_OBJECT_REF | |
| NO_PROPS | back to summary |
|---|---|
| protected static final BeanPropertyWriter[] NO_PROPS | |
| BeanSerializerBase | back to summary |
|---|---|
| protected BeanSerializerBase(JavaType type, BeanSerializerBuilder builder, BeanPropertyWriter[] properties, BeanPropertyWriter[] filteredProperties) Constructor used by
| |
| BeanSerializerBase | back to summary |
|---|---|
| protected BeanSerializerBase(BeanSerializerBase src) Copy-constructor that is useful for sub-classes that just want to copy all super-class properties without modifications. | |
| BeanSerializerBase | back to summary |
|---|---|
| protected BeanSerializerBase(BeanSerializerBase src, BeanPropertyWriter[] properties, BeanPropertyWriter[] filteredProperties) | |
| BeanSerializerBase | back to summary |
|---|---|
| protected BeanSerializerBase(BeanSerializerBase src, ObjectIdWriter objectIdWriter) | |
| BeanSerializerBase | back to summary |
|---|---|
| protected BeanSerializerBase(BeanSerializerBase src, ObjectIdWriter objectIdWriter, Object filterId) | |
| BeanSerializerBase | back to summary |
|---|---|
| protected BeanSerializerBase(BeanSerializerBase src, Set<String> toIgnore, Set<String> toInclude) | |
| BeanSerializerBase | back to summary |
|---|---|
| protected BeanSerializerBase(BeanSerializerBase src, NameTransformer unwrapper) Copy-constructor that will also rename properties with given prefix (if it's non-empty) | |
| _serializeObjectId | back to summary |
|---|---|
| protected void _serializeObjectId(Object bean, JsonGenerator g, SerializationContext ctxt, TypeSerializer typeSer, WritableObjectId objectId) throws JacksonException | |
| _serializeProperties | back to summary |
|---|---|
| protected void _serializeProperties(Object bean, JsonGenerator g, SerializationContext provider) throws JacksonException | |
| _serializePropertiesFiltered | back to summary |
|---|---|
| protected void _serializePropertiesFiltered(Object bean, JsonGenerator g, SerializationContext provider, Object filterId) throws JacksonException Alternative serialization method that gets called when there is a
| |
| _serializePropertiesMaybeView | back to summary |
|---|---|
| protected void _serializePropertiesMaybeView(Object bean, JsonGenerator g, SerializationContext provider, BeanPropertyWriter[] props) throws JacksonException Method called when no JSON Filter is to be applied, but View filtering is in effect and so some of properties may be nulls to check.
| |
| _serializePropertiesNoView | back to summary |
|---|---|
| protected void _serializePropertiesNoView(Object bean, JsonGenerator gen, SerializationContext provider, BeanPropertyWriter[] props) throws JacksonException Method called when neither JSON Filter is to be applied, nor view-filtering. This means that all property writers are non null and can be called directly.
| |
| _serializeWithObjectId | back to summary |
|---|---|
| protected final void _serializeWithObjectId(Object bean, JsonGenerator g, SerializationContext provider, boolean startEndObject) throws JacksonException | |
| _serializeWithObjectId | back to summary |
|---|---|
| protected final void _serializeWithObjectId(Object bean, JsonGenerator g, SerializationContext provider, TypeSerializer typeSer) throws JacksonException | |
| _typeIdDef | back to summary |
|---|---|
| protected final WritableTypeId _typeIdDef(TypeSerializer typeSer, Object bean, JsonToken valueShape) | |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) Overrides tools. Implements tools. Doc from tools. Default implementation specifies no format. This behavior is usually overriden by custom serializers.
| |
| asArraySerializer | back to summary |
|---|---|
| protected abstract BeanSerializerBase asArraySerializer() Mutant factory for creating a variant that output POJO as a JSON Array. Implementations may ignore this request if output as array is not possible (either at all, or reliably). | |
| canCreateArraySerializer | back to summary |
|---|---|
| public boolean canCreateArraySerializer() Helper method for sub-classes to check if it should be possible to construct an "as-array" serializer. Returns if all of following hold true:
| |
| createContextual | back to summary |
|---|---|
| public ValueSerializer Overrides tools. Doc from tools. Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property (or, for root values, in which case `null` is passed). 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. Note that method is only called once per POJO property, and for the first usage as root value serializer; it is not called for every serialization, as doing that would have significant performance impact; most serializers cache contextual instances for future use.
| |
| findConvertingSerializer | back to summary |
|---|---|
| protected ValueSerializer Helper method that can be used to see if specified property is annotated to indicate use of a converter for property value (in case of container types, it is container type itself, not key or content type). | |
| getFilterId | back to summary |
|---|---|
public Object getFilterId()
| |
| hasViewProperties | back to summary |
|---|---|
| public boolean hasViewProperties() Accessor for checking if view-processing is enabled for this bean, that is, if it has separate set of properties with view-checking added.
| |
| properties | back to summary |
|---|---|
| public Iterator Overrides tools. Doc from tools. Accessor for iterating over logical properties that the type
handled by this serializer has, from serialization perspective.
Actual type of properties, if any, will be
| |
| propertyCount | back to summary |
|---|---|
public int propertyCount()
| |
| rename | back to summary |
|---|---|
| private static final BeanPropertyWriter[] rename(BeanPropertyWriter[] props, NameTransformer transformer) | |
| resolve | back to summary |
|---|---|
| public void resolve(SerializationContext provider) Overrides tools. We need to resolve dependant serializers here to be able to properly handle cyclic type references.
| |
| serialize | back to summary |
|---|---|
| public abstract void serialize(Object bean, JsonGenerator gen, SerializationContext provider) throws JacksonException Implements abstract tools. Doc from tools. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |
| serializeWithType | back to summary |
|---|---|
| public void serializeWithType(Object bean, JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer) throws JacksonException Overrides tools. Doc from tools. 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.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| unwrappingSerializer | back to summary |
|---|---|
| public abstract ValueSerializer Overrides tools. Lets force sub-classes to implement this, to avoid accidental missing of handling...
| |
| usesObjectId | back to summary |
|---|---|
| public boolean usesObjectId() Overrides tools. Doc from tools. Method that can be called to see whether this serializer instance will use Object Id to handle cyclic references.
| |
| withByNameInclusion | back to summary |
|---|---|
| protected abstract BeanSerializerBase withByNameInclusion(Set<String> toIgnore, Set<String> toInclude) Mutant factory used for creating a new instance with additional set of properties to ignore or include (from properties this instance otherwise has) | |
| withFilterId | back to summary |
|---|---|
| public abstract BeanSerializerBase withFilterId(Object filterId) Overrides tools. Mutant factory used for creating a new instance with different
filter id (used with
| |
| withObjectIdWriter | back to summary |
|---|---|
| public abstract BeanSerializerBase withObjectIdWriter(ObjectIdWriter objectIdWriter) Mutant factory used for creating a new instance with different
| |
| withProperties | back to summary |
|---|---|
| protected abstract BeanSerializerBase withProperties(BeanPropertyWriter[] properties, BeanPropertyWriter[] filteredProperties) Mutant factory used for creating a new instance with modified set of properties | |