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 | Class and Description |
|---|---|
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| protected final BeanPropertyWriter. | _accessor
Accessor method used to get property value. |
| 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 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 ValueSerializer | _nullSerializer
Serializer used for writing out null values, if any: if null, null values are to be suppressed. |
| protected ValueSerializer | _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" |
| Access | Constructor and Description |
|---|---|
| public | BeanPropertyWriter(BeanPropertyDefinition propDef, AnnotatedMember member, Annotations contextAnnotations, JavaType declaredType, ValueSerializer<?> ser, TypeSerializer typeSer, JavaType serType, boolean suppressNulls, Object suppressableValue, Class<?>[] includeInViews)
|
| 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 ValueSerializer | |
| protected boolean | Returns: True if method fully handled self-referential value; false if not (caller is to handle it) orDatabindException if there
is no way handle itMethod called to handle a direct self-reference through this property. |
| private boolean | |
| protected BeanPropertyWriter | |
| public void | assignNullSerializer(ValueSerializer<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 v, SerializationContext provider)
Implements abstract tools. Implements tools. Traversal method used for things like JSON Schema generation, or POJO introspection. |
| 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 tools. Implements tools. 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 tools. Implements tools. 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 tools. Implements tools.
|
| public Object | Returns: Value of the setting, if any; null if none.Method for accessing value of specified internal setting. |
| public AnnotatedMember | getMember()
Implements tools. Method for accessing primary physical entity that represents the property; annotated field, method or constructor property. |
| public String | getName()
Implements abstract tools. Implements tools.
|
| public JavaType | |
| public SerializableString | |
| public ValueSerializer | |
| public JavaType | getType()
Implements tools. Method to get declared type of the property. |
| public TypeSerializer | |
| public Class | |
| public PropertyName | getWrapperName()
Implements tools. 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). |
| 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 g, SerializationContext ctxt)
Implements abstract tools. Alternative to |
| public void | serializeAsOmittedElement(Object bean, JsonGenerator g, SerializationContext prov)
Implements abstract tools. 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 void | serializeAsOmittedProperty(Object bean, JsonGenerator g, SerializationContext ctxt)
Implements abstract tools. 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 | serializeAsProperty(Object bean, JsonGenerator g, SerializationContext ctxt)
Implements abstract tools. 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 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. |
| _accessor | back to summary |
|---|---|
| protected final BeanPropertyWriter. Accessor method used to get property value. Wrapped in a holder since MethodHandle is not serializable. | |
| _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. | |
| _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 ValueSerializer<Object> _nullSerializer Serializer used for writing out null values, if any: if null, null values are to be suppressed. | |
| _serializer | back to summary |
|---|---|
| protected ValueSerializer<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" | |
| BeanPropertyWriter | back to summary |
|---|---|
public BeanPropertyWriter(BeanPropertyDefinition propDef, AnnotatedMember member, Annotations contextAnnotations, JavaType declaredType, ValueSerializer<?> ser, TypeSerializer typeSer, JavaType serType, boolean suppressNulls, Object suppressableValue, Class<?>[] includeInViews)
| |
| 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 ValueSerializer | |
| _handleSelfReference | back to summary |
|---|---|
| protected boolean _handleSelfReference(Object bean, JsonGenerator g, SerializationContext ctxt, ValueSerializer<?> ser) throws JacksonException Method called to handle a direct self-reference through this property.
Method can choose to indicate an error by throwing
Default implementation will throw
| |
| _isThrowableFieldCause | back to summary |
|---|---|
| private boolean _isThrowableFieldCause(SerializationContext ctxt, Object bean) | |
| _new | back to summary |
|---|---|
| protected BeanPropertyWriter _new(PropertyName newName) Overridable factory method used by sub-classes | |
| assignNullSerializer | back to summary |
|---|---|
| public void assignNullSerializer(ValueSerializer<Object> nullSer) Method called to assign null value serializer for property | |
| assignSerializer | back to summary |
|---|---|
| public void assignSerializer(ValueSerializer<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, SerializationContext provider) Implements abstract tools. Implements tools. Doc from tools. Traversal method used for things like JSON Schema generation, or POJO introspection.
| |
| 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. | |
| getAnnotation | back to summary |
|---|---|
| public <A extends Annotation> A getAnnotation(Class<A> acls) Implements abstract tools. Implements tools. Doc from tools. 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 tools. Implements tools. Doc from tools. 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 tools. Implements tools.
| |
| 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 tools. Doc from tools. 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 tools. Implements tools.
| |
| getSerializationType | back to summary |
|---|---|
| public JavaType getSerializationType() | |
| getSerializedName | back to summary |
|---|---|
| public SerializableString getSerializedName() | |
| getSerializer | back to summary |
|---|---|
| public ValueSerializer | |
| getType | back to summary |
|---|---|
| public JavaType getType() Implements tools. Doc from tools. 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 tools. Doc from tools. 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. | |
| 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 g, SerializationContext ctxt) throws Exception Implements abstract tools. Alternative to
| |
| serializeAsOmittedElement | back to summary |
|---|---|
| public void serializeAsOmittedElement(Object bean, JsonGenerator g, SerializationContext prov) throws Exception Implements abstract tools. 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.
| |
| serializeAsOmittedProperty | back to summary |
|---|---|
| public void serializeAsOmittedProperty(Object bean, JsonGenerator g, SerializationContext ctxt) throws Exception Implements abstract tools. 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.
| |
| serializeAsProperty | back to summary |
|---|---|
| public void serializeAsProperty(Object bean, JsonGenerator g, SerializationContext ctxt) throws Exception Implements abstract tools. 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.
| |
| 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.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected MethodHandle | unreflect()
Implements abstract tools.
|
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| GetterHolder | back to summary |
|---|---|
| public GetterHolder() | |
| unreflect | back to summary |
|---|---|
| protected MethodHandle unreflect() throws IllegalAccessException Implements abstract tools.
| |