com.fasterxml.jackson.databind.ser

Class BeanPropertyWriter

  • All Implemented Interfaces:
    BeanProperty, Named
    Direct Known Subclasses:
    UnwrappingBeanPropertyWriter


    public class BeanPropertyWriter
    extends PropertyWriter
    implements BeanProperty
    Base bean property handler class, which implements common parts of reflection-based functionality for accessing a property value and serializing it.

    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.

    • Field Detail

      • MARKER_FOR_EMPTY

        public static final Object MARKER_FOR_EMPTY
        Marker object used to indicate "do not serialize if empty"
      • _member

        protected final AnnotatedMember _member
        Member (field, method) that represents property and allows access to associated annotations.
      • _contextAnnotations

        protected final Annotations _contextAnnotations
        Annotations from context (most often, class that declares property, or in case of sub-class serializer, from that sub-class)
      • _declaredType

        protected final JavaType _declaredType
        Type property is declared to have, either in class definition or associated annotations.
      • _accessorMethod

        protected final Method _accessorMethod
        Accessor method used to get property value, for method-accessible properties. Null if and only if _field is null.
      • _field

        protected final Field _field
        Field that contains the property value for field-accessible properties. Null if and only if _accessorMethod is null.
      • _name

        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. ALSO NOTE: ... and while it really ought to be `SerializableString`, changing that is also binary-incompatible change. So nope.

      • _wrapperName

        protected final PropertyName _wrapperName
        Wrapper name to use for this element, if any
        Since:
        2.2
      • _cfgSerializationType

        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.
      • _serializer

        protected JsonSerializer<Object> _serializer
        Serializer to use for writing out the value: null if it can not be known statically; non-null if it can.
      • _nullSerializer

        protected JsonSerializer<Object> _nullSerializer
        Serializer used for writing out null values, if any: if null, null values are to be suppressed.
      • _dynamicSerializers

        protected transient PropertySerializerMap _dynamicSerializers
        In case serializer is not known statically (i.e. _serializer is null), we will use a lookup structure for storing dynamically resolved mapping from type(s) to serializer(s).
      • _suppressNulls

        protected final boolean _suppressNulls
        Whether null values are to be suppressed (nothing written out if value is null) or not.
      • _suppressableValue

        protected final Object _suppressableValue
        Value that is considered default value of the property; used for default-value-suppression if enabled.
      • _includeInViews

        protected final Class<?>[] _includeInViews
        Alternate set of property writers used when view-based filtering is available for the Bean.
      • _typeSerializer

        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).
      • _nonTrivialBaseType

        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.
      • _metadata

        protected final PropertyMetadata _metadata
        Additional information about property
        Since:
        2.3

Copyright © 2014-2015 FasterXML. All Rights Reserved.