Note that current design tries to keep instances immutable (semi-functional style); mostly because these instances are exposed to application code and this is to reduce likelihood of data corruption and synchronization issues.
| Modifier and Type | Field and Description |
|---|---|
| protected transient Method | _accessorMethod
Accessor method used to get property value, for method-accessible properties. |
| protected final JavaType | _cfgSerializationType
Type to use for locating serializer; normally same as return type of the accessor method, but may be overridden by annotations. |
| protected final transient Annotations | _contextAnnotations
Annotations from context (most often, class that declares property, or in case of sub-class serializer, from that sub-class) Note transient just to support JDK serializability; Annotations do not serialize. |
| protected final JavaType | _declaredType
Type property is declared to have, either in class definition or associated annotations. |
| protected transient PropertySerializerMap | _dynamicSerializers
In case serializer is not known statically (i.e. |
| protected transient Field | _field
Field that contains the property value for field-accessible properties. |
| protected final Class | _includeInViews
Alternate set of property writers used when view-based filtering is available for the Bean. |
| protected transient HashMap | |
| protected final AnnotatedMember | _member
Member (field, method) that represents property and allows access to associated annotations. |
| protected final SerializedString | _name
Logical name of the property; will be used as the field name under which value for the property is written. |
| protected JavaType | _nonTrivialBaseType
Base type of the property, if the declared type is "non-trivial"; meaning it is either a structured type (collection, map, array), or parameterized. |
| protected JsonSerializer | _nullSerializer
Serializer used for writing out null values, if any: if null, null values are to be suppressed. |
| protected JsonSerializer | _serializer
Serializer to use for writing out the value: null if it cannot be known statically; non-null if it can. |
| protected final Object | _suppressableValue
Value that is considered default value of the property; used for default-value-suppression if enabled. |
| protected final boolean | _suppressNulls
Whether null values are to be suppressed (nothing written out if value is null) or not. |
| protected TypeSerializer | _typeSerializer
If property being serialized needs type information to be included this is the type serializer to use. |
| protected final PropertyName | _wrapperName
Wrapper name to use for this element, if any |
| public static final Object | MARKER_FOR_EMPTY
Marker object used to indicate "do not serialize if empty" |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | BeanPropertyWriter(BeanPropertyDefinition propDef, AnnotatedMember member, Annotations contextAnnotations, JavaType declaredType, JsonSerializer<?> ser, TypeSerializer typeSer, JavaType serType, boolean suppressNulls, Object suppressableValue, Class<?>[] includeInViews)
|
| public | BeanPropertyWriter(BeanPropertyDefinition propDef, AnnotatedMember member, Annotations contextAnnotations, JavaType declaredType, JsonSerializer<?> ser, TypeSerializer typeSer, JavaType serType, boolean suppressNulls, Object suppressableValue)
Deprecated
|
| protected | BeanPropertyWriter()
Constructor that may be of use to virtual properties, when there is need for the zero-arg ("default") constructor, and actual initialization is done after constructor call. |
| protected | |
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected JsonSerializer | |
| protected boolean | Returns: True if method fully handled self-referential value; false if not (caller is to handle it) orJsonMappingException if there
is no way handle itMethod called to handle a direct self-reference through this property. |
| protected BeanPropertyWriter | |
| public void | assignNullSerializer(JsonSerializer<Object> nullSer)
Method called to assign null value serializer for property |
| public void | |
| public void | assignTypeSerializer(TypeSerializer typeSer)
Method called to set, reset or clear the configured type serializer for property. |
| public void | depositSchemaProperty(JsonObjectFormatVisitor
Visitor to used as the callback handler v, SerializerProvider provider)Implements abstract com. Implements com. Traversal method used for things like JSON Schema generation, or POJO introspection. |
| public void | depositSchemaProperty(ObjectNode
Node which the given property would exist within propertiesNode, SerializerProvider Provider that can be used for accessing dynamic aspects of
serialization processing provider)Implements abstract com.
Deprecated
Attempt to add the output of the given |
| public void | fixAccess(SerializationConfig config)
Method called to ensure that the mutator has proper access rights to be called, as per configuration. |
| public final Object | |
| public <A extends Annotation> A | getAnnotation(Class<A> acls)
Implements abstract com. Implements com. Method for accessing annotations directly declared for property that this writer is associated with. |
| public <A extends Annotation> A | getContextAnnotation(Class<A> acls)
Implements abstract com. Implements com. Method for accessing annotations declared in context of the property that this writer is associated with; usually this means annotations on enclosing class for property. |
| public PropertyName | getFullName()
Implements abstract com. Implements com. Method for getting full name definition, including possible format-specific additional properties (such as namespace when using XML backend). |
| public Type | Returns: The property type, or null if not found.
Deprecated
Since 2.7, to be removed from 2.9, use
getType() instead.
Get the generic property type of this property writer. |
| public Object | Returns: Value of the setting, if any; null if none.Method for accessing value of specified internal setting. |
| public AnnotatedMember | getMember()
Implements com. Method for accessing primary physical entity that represents the property; annotated field, method or constructor property. |
| public String | getName()
Implements abstract com. Implements com. Method to get logical name of the property |
| public Class | |
| public Class | |
| public JavaType | |
| public SerializableString | |
| public JsonSerializer | |
| public JavaType | getType()
Implements com. Method to get declared type of the property. |
| public TypeSerializer | |
| public Class | |
| public PropertyName | getWrapperName()
Implements com. If property is indicated to be wrapped, name of wrapper element to use. |
| public boolean | |
| public boolean | |
| public boolean | isUnwrapping()
Accessor that will return true if this bean property has to support "unwrapping"; ability to replace POJO structural wrapping with optional name prefix and/or suffix (or in some cases, just removal of wrapper name). |
| pack-priv Object | |
| public Object | Returns: Existing value of the setting, if any (null if none)Method for removing entry for specified internal setting. |
| public BeanPropertyWriter | |
| public void | serializeAsElement(Object bean, JsonGenerator gen, SerializerProvider prov)
Implements abstract com. Alternative to |
| public void | serializeAsField(Object bean, JsonGenerator gen, SerializerProvider prov)
Implements abstract com. Method called to access property that this bean stands for, from within given bean, and to serialize it as a JSON Object field using appropriate serializer. |
| public void | serializeAsOmittedField(Object bean, JsonGenerator gen, SerializerProvider prov)
Implements abstract com. Method called to indicate that serialization of a field was omitted due to filtering, in cases where backend data format does not allow basic omission. |
| public void | serializeAsPlaceholder(Object bean, JsonGenerator gen, SerializerProvider prov)
Implements abstract com. Method called to serialize a placeholder used in tabular output when real value is not to be included (is filtered out), but when we need an entry so that field indexes will not be off. |
| public Object | Returns: Old value of the setting, if any (null if none)Method for setting specific internal setting to given value |
| public void | setNonTrivialBaseType(JavaType t)
Method called to define type to consider as "non-trivial" basetype, needed for dynamic serialization resolution for complex (usually container) types |
| public String | |
| public BeanPropertyWriter | unwrappingWriter(NameTransformer unwrapper)
Method called create an instance that handles details of unwrapping contained value. |
| public boolean | |
| public boolean | wouldConflictWithName(PropertyName name)
Method called to check to see if this property has a name that would conflict with a given name. |
| _accessorMethod | back to summary |
|---|---|
| protected transient Method _accessorMethod Accessor method used to get property value, for method-accessible
properties. Null if and only if `transient` (and non-final) only to support JDK serializability. | |
| _cfgSerializationType | back to summary |
|---|---|
| protected final JavaType _cfgSerializationType Type to use for locating serializer; normally same as return type of the accessor method, but may be overridden by annotations. | |
| _contextAnnotations | back to summary |
|---|---|
| protected final transient Annotations _contextAnnotations Annotations from context (most often, class that declares property, or in case of sub-class serializer, from that sub-class) Note transient just to support JDK serializability; Annotations do not serialize. At all. | |
| _declaredType | back to summary |
|---|---|
| protected final JavaType _declaredType Type property is declared to have, either in class definition or associated annotations. | |
| _dynamicSerializers | back to summary |
|---|---|
| protected transient PropertySerializerMap _dynamicSerializers In case serializer is not known statically (i.e. | |
| _field | back to summary |
|---|---|
| protected transient Field _field Field that contains the property value for field-accessible properties.
Null if and only if `transient` (and non-final) only to support JDK serializability. | |
| _includeInViews | back to summary |
|---|---|
| protected final Class<?>[] _includeInViews Alternate set of property writers used when view-based filtering is available for the Bean. | |
| _internalSettings | back to summary |
|---|---|
| protected transient HashMap<Object, Object> _internalSettings | |
| _member | back to summary |
|---|---|
| protected final AnnotatedMember _member Member (field, method) that represents property and allows access to associated annotations. | |
| _name | back to summary |
|---|---|
| protected final SerializedString _name Logical name of the property; will be used as the field name under which value for the property is written. Note do NOT change name of this field; it is accessed by Afterburner module (until 2.4; not directly from 2.5) ALSO NOTE: ... and while it really ought to be `SerializableString`, changing that is also binary-incompatible change. So nope. | |
| _nonTrivialBaseType | back to summary |
|---|---|
| protected JavaType _nonTrivialBaseType Base type of the property, if the declared type is "non-trivial"; meaning it is either a structured type (collection, map, array), or parameterized. Used to retain type information about contained type, which is mostly necessary if type meta-data is to be included. | |
| _nullSerializer | back to summary |
|---|---|
| protected JsonSerializer<Object> _nullSerializer Serializer used for writing out null values, if any: if null, null values are to be suppressed. | |
| _serializer | back to summary |
|---|---|
| protected JsonSerializer<Object> _serializer Serializer to use for writing out the value: null if it cannot be known statically; non-null if it can. | |
| _suppressableValue | back to summary |
|---|---|
| protected final Object _suppressableValue Value that is considered default value of the property; used for default-value-suppression if enabled. | |
| _suppressNulls | back to summary |
|---|---|
| protected final boolean _suppressNulls Whether null values are to be suppressed (nothing written out if value is
null) or not. Note that this is a configuration value during
construction, and actual handling relies on setting (or not) of
| |
| _typeSerializer | back to summary |
|---|---|
| protected TypeSerializer _typeSerializer If property being serialized needs type information to be included this is the type serializer to use. Declared type (possibly augmented with annotations) of property is used for determining exact mechanism to use (compared to actual runtime type used for serializing actual state). | |
| _wrapperName | back to summary |
|---|---|
| protected final PropertyName _wrapperName Wrapper name to use for this element, if any
| |
| MARKER_FOR_EMPTY | back to summary |
|---|---|
| public static final Object MARKER_FOR_EMPTY Marker object used to indicate "do not serialize if empty" | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| BeanPropertyWriter | back to summary |
|---|---|
public BeanPropertyWriter(BeanPropertyDefinition propDef, AnnotatedMember member, Annotations contextAnnotations, JavaType declaredType, JsonSerializer<?> ser, TypeSerializer typeSer, JavaType serType, boolean suppressNulls, Object suppressableValue, Class<?>[] includeInViews)
| |
| BeanPropertyWriter | back to summary |
|---|---|
| public BeanPropertyWriter(BeanPropertyDefinition propDef, AnnotatedMember member, Annotations contextAnnotations, JavaType declaredType, JsonSerializer<?> ser, TypeSerializer typeSer, JavaType serType, boolean suppressNulls, Object suppressableValue)
Deprecated
| |
| BeanPropertyWriter | back to summary |
|---|---|
| protected BeanPropertyWriter() Constructor that may be of use to virtual properties, when there is need for the zero-arg ("default") constructor, and actual initialization is done after constructor call.
| |
| BeanPropertyWriter | back to summary |
|---|---|
| protected BeanPropertyWriter(BeanPropertyWriter base) "Copy constructor" to be used by filtering sub-classes | |
| BeanPropertyWriter | back to summary |
|---|---|
protected BeanPropertyWriter(BeanPropertyWriter base, PropertyName name)
| |
| BeanPropertyWriter | back to summary |
|---|---|
| protected BeanPropertyWriter(BeanPropertyWriter base, SerializedString name) | |
| _depositSchemaProperty | back to summary |
|---|---|
| protected void _depositSchemaProperty(ObjectNode propertiesNode, JsonNode schemaNode) | |
| _findAndAddDynamic | back to summary |
|---|---|
| protected JsonSerializer | |
| _handleSelfReference | back to summary |
|---|---|
| protected boolean _handleSelfReference(Object bean, JsonGenerator gen, SerializerProvider prov, JsonSerializer<?> ser) throws IOException Method called to handle a direct self-reference through this property.
Method can choose to indicate an error by throwing
Default implementation will throw
| |
| _new | back to summary |
|---|---|
| protected BeanPropertyWriter _new(PropertyName newName) Overridable factory method used by sub-classes
| |
| assignNullSerializer | back to summary |
|---|---|
| public void assignNullSerializer(JsonSerializer<Object> nullSer) Method called to assign null value serializer for property | |
| assignSerializer | back to summary |
|---|---|
| public void assignSerializer(JsonSerializer<Object> ser) Method called to assign value serializer for property | |
| assignTypeSerializer | back to summary |
|---|---|
| public void assignTypeSerializer(TypeSerializer typeSer) Method called to set, reset or clear the configured type serializer for property.
| |
| depositSchemaProperty | back to summary |
|---|---|
| public void depositSchemaProperty(JsonObjectFormatVisitor v, SerializerProvider provider) throws JsonMappingException Implements abstract com. Implements com. Doc from com. Traversal method used for things like JSON Schema generation, or POJO introspection.
| |
| depositSchemaProperty | back to summary |
|---|---|
| public void depositSchemaProperty(ObjectNode propertiesNode, SerializerProvider provider) throws JsonMappingException Implements abstract com. Deprecated
Attempt to add the output of the given
| |
| fixAccess | back to summary |
|---|---|
| public void fixAccess(SerializationConfig config) Method called to ensure that the mutator has proper access rights to be called, as per configuration. Overridden by implementations that have mutators that require access, fields and setters.
| |
| get | back to summary |
|---|---|
| public final Object get(Object bean) throws Exception Method that can be used to access value of the property this Object describes, from given bean instance. Note method is final as it should not need to be overridden -- rather,
calling method(s) ( | |
| getAnnotation | back to summary |
|---|---|
| public <A extends Annotation> A getAnnotation(Class<A> acls) Implements abstract com. Implements com. Doc from com. Method for accessing annotations directly declared for property that this writer is associated with.
| |
| getContextAnnotation | back to summary |
|---|---|
| public <A extends Annotation> A getContextAnnotation(Class<A> acls) Implements abstract com. Implements com. Doc from com. Method for accessing annotations declared in context of the property that this writer is associated with; usually this means annotations on enclosing class for property.
| |
| getFullName | back to summary |
|---|---|
| public PropertyName getFullName() Implements abstract com. Implements com. Doc from com. Method for getting full name definition, including possible format-specific additional properties (such as namespace when using XML backend).
| |
| getGenericPropertyType | back to summary |
|---|---|
| public Type getGenericPropertyType()
Deprecated Since 2.7, to be removed from 2.9, use Get the generic property type of this property writer.
| |
| getInternalSetting | back to summary |
|---|---|
| public Object getInternalSetting(Object key) Method for accessing value of specified internal setting.
| |
| getMember | back to summary |
|---|---|
| public AnnotatedMember getMember() Implements com. Doc from com. Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.
| |
| getName | back to summary |
|---|---|
| public String getName() Implements abstract com. Implements com. Doc from com. Method to get logical name of the property
| |
| getPropertyType | back to summary |
|---|---|
| public Class Deprecated Since 2.7, to be removed from 2.9, use
| |
| getRawSerializationType | back to summary |
|---|---|
| public Class Deprecated
| |
| getSerializationType | back to summary |
|---|---|
| public JavaType getSerializationType() | |
| getSerializedName | back to summary |
|---|---|
| public SerializableString getSerializedName() | |
| getSerializer | back to summary |
|---|---|
| public JsonSerializer | |
| getType | back to summary |
|---|---|
| public JavaType getType() Implements com. Doc from com. Method to get declared type of the property.
| |
| getTypeSerializer | back to summary |
|---|---|
public TypeSerializer getTypeSerializer()
| |
| getViews | back to summary |
|---|---|
| public Class | |
| getWrapperName | back to summary |
|---|---|
| public PropertyName getWrapperName() Implements com. Doc from com. If property is indicated to be wrapped, name of wrapper element to use.
| |
| hasNullSerializer | back to summary |
|---|---|
| public boolean hasNullSerializer() | |
| hasSerializer | back to summary |
|---|---|
| public boolean hasSerializer() | |
| isUnwrapping | back to summary |
|---|---|
| public boolean isUnwrapping() Accessor that will return true if this bean property has to support "unwrapping"; ability to replace POJO structural wrapping with optional name prefix and/or suffix (or in some cases, just removal of wrapper name). Default implementation simply returns false.
| |
| readResolve | back to summary |
|---|---|
| pack-priv Object readResolve() | |
| removeInternalSetting | back to summary |
|---|---|
| public Object removeInternalSetting(Object key) Method for removing entry for specified internal setting.
| |
| rename | back to summary |
|---|---|
| public BeanPropertyWriter rename(NameTransformer transformer) | |
| serializeAsElement | back to summary |
|---|---|
| public void serializeAsElement(Object bean, JsonGenerator gen, SerializerProvider prov) throws Exception Implements abstract com. Alternative to
| |
| serializeAsField | back to summary |
|---|---|
| public void serializeAsField(Object bean, JsonGenerator gen, SerializerProvider prov) throws Exception Implements abstract com. Method called to access property that this bean stands for, from within given bean, and to serialize it as a JSON Object field using appropriate serializer.
| |
| serializeAsOmittedField | back to summary |
|---|---|
| public void serializeAsOmittedField(Object bean, JsonGenerator gen, SerializerProvider prov) throws Exception Implements abstract com. Method called to indicate that serialization of a field was omitted due to filtering, in cases where backend data format does not allow basic omission.
| |
| serializeAsPlaceholder | back to summary |
|---|---|
| public void serializeAsPlaceholder(Object bean, JsonGenerator gen, SerializerProvider prov) throws Exception Implements abstract com. Method called to serialize a placeholder used in tabular output when real value is not to be included (is filtered out), but when we need an entry so that field indexes will not be off. Typically this should output null or empty String, depending on datatype.
| |
| setInternalSetting | back to summary |
|---|---|
| public Object setInternalSetting(Object key, Object value) Method for setting specific internal setting to given value
| |
| setNonTrivialBaseType | back to summary |
|---|---|
| public void setNonTrivialBaseType(JavaType t) Method called to define type to consider as "non-trivial" basetype, needed for dynamic serialization resolution for complex (usually container) types | |
| 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- | |
| unwrappingWriter | back to summary |
|---|---|
| public BeanPropertyWriter unwrappingWriter(NameTransformer unwrapper) Method called create an instance that handles details of unwrapping contained value. | |
| willSuppressNulls | back to summary |
|---|---|
| public boolean willSuppressNulls() | |
| wouldConflictWithName | back to summary |
|---|---|
| public boolean wouldConflictWithName(PropertyName name) Method called to check to see if this property has a name that would conflict with a given name.
| |