com.fasterxml.jackson.databind.deser

Class SettableBeanProperty

    • Field Detail

      • MISSING_VALUE_DESERIALIZER

        protected static final JsonDeserializer<Object> MISSING_VALUE_DESERIALIZER
        To avoid nasty NPEs, let's use a placeholder for _valueDeserializer, if real deserializer is not (yet) available.
        Since:
        2.2
      • _propName

        protected final String _propName
        Logical name of the property (often but not always derived from the setter method name)
      • _type

        protected final JavaType _type
        Base type for property; may be a supertype of actual value.
      • _wrapperName

        protected final PropertyName _wrapperName
        Since:
        2.2
      • _contextAnnotations

        protected final transient Annotations _contextAnnotations
        Class that contains this property (either class that declares the property or one of its subclasses), class that is deserialized using deserializer that contains this property.
      • _valueDeserializer

        protected JsonDeserializer<Object> _valueDeserializer
        Deserializer used for handling property value.
      • _valueTypeDeserializer

        protected final TypeDeserializer _valueTypeDeserializer
        If value will contain type information (to support polymorphic handling), this is the type deserializer used to handle type resolution.
      • _nullProvider

        protected final NullProvider _nullProvider
        Object used to figure out value to be used when 'null' literal is encountered in JSON. For most types simply Java null, but for primitive types must be a non-null value (like Integer.valueOf(0) for int).
      • _isRequired

        protected final boolean _isRequired
        Whether value of this property has been marked as required. Retained since it will be needed when traversing type hierarchy for producing schemas (and other similar tasks); currently not used for serialization.
        Since:
        2.2
      • _managedReferenceName

        protected String _managedReferenceName
        If property represents a managed (forward) reference (see [JACKSON-235]), we will need name of reference for later linking.

        TODO: should try to make immutable.

      • _viewMatcher

        protected ViewMatcher _viewMatcher
        Helper object used for checking whether this property is to be included in the active view, if property is view-specific; null otherwise.

        TODO: should try to make immutable.

      • _propertyIndex

        protected int _propertyIndex
        Index of property (within all property of a bean); assigned when all properties have been collected. Order of entries is arbitrary, but once indexes are assigned they are not changed.

        TODO: should try to make immutable if at all possible

    • Method Detail

      • withValueDeserializer

        public abstract SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser)
        Fluent factory method for constructing and returning a new instance with specified value deserializer. Note that this method should NOT change configuration of this instance.
        Parameters:
        deser - Deserializer to assign to the new property instance
        Returns:
        Newly constructed instance, if value deserializer differs from the one used for this instance; or 'this' if not.
      • withName

        public abstract SettableBeanProperty withName(String newName)
        Fluent factory method for constructing and returning a new instance with specified property name. Note that this method should NOT change configuration of this instance.
        Parameters:
        newName - Name to use for the new instance.
        Returns:
        Newly constructed instance, if property name differs from the one used for this instance; or 'this' if not.
      • setManagedReferenceName

        public void setManagedReferenceName(String n)
      • setViews

        public void setViews(Class<?>[] views)
      • assignIndex

        public void assignIndex(int index)
        Method used to assign index for property.
      • isRequired

        public boolean isRequired()
        Description copied from interface: BeanProperty
        Whether value for property is marked as required using annotations or associated schema.
        Specified by:
        isRequired in interface BeanProperty
      • getAnnotation

        public abstract <A extends Annotation> A getAnnotation(Class<A> acls)
        Description copied from interface: BeanProperty
        Method for finding annotation associated with this property; meaning annotation associated with one of entities used to access property.
        Specified by:
        getAnnotation in interface BeanProperty
      • getMember

        public abstract AnnotatedMember getMember()
        Description copied from interface: BeanProperty
        Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.
        Specified by:
        getMember in interface BeanProperty
      • getContextAnnotation

        public <A extends Annotation> A getContextAnnotation(Class<A> acls)
        Description copied from interface: BeanProperty
        Method for finding annotation associated with context of this property; usually class in which member is declared (or its subtype if processing subtype).
        Specified by:
        getContextAnnotation in interface BeanProperty
      • getDeclaringClass

        protected final Class<?> getDeclaringClass()
      • getManagedReferenceName

        public String getManagedReferenceName()
      • hasValueDeserializer

        public boolean hasValueDeserializer()
      • hasValueTypeDeserializer

        public boolean hasValueTypeDeserializer()
      • visibleInView

        public boolean visibleInView(Class<?> activeView)
      • hasViews

        public boolean hasViews()
      • getPropertyIndex

        public int getPropertyIndex()
        Method for accessing unique index of this property; indexes are assigned once all properties of a BeanDeserializer have been collected.
        Returns:
        Index of this property
      • getCreatorIndex

        public int getCreatorIndex()
        Method for accessing index of the creator property: for other types of properties will simply return -1.
        Since:
        2.1
      • getInjectableValueId

        public Object getInjectableValueId()
        Accessor for id of injectable value, if this bean property supports value injection.
      • set

        public abstract void set(Object instance,
               Object value)
                          throws IOException
        Method called to assign given value to this property, on specified Object.

        Note: this is an optional operation, not supported by all implementations, creator-backed properties for example do not support this method.

        Throws:
        IOException
      • setAndReturn

        public abstract Object setAndReturn(Object instance,
                          Object value)
                                     throws IOException
        Method called to assign given value to this property, on specified Object, and return whatever delegating accessor returned (if anything)

        Note: this is an optional operation, not supported by all implementations, creator-backed properties for example do not support this method.

        Throws:
        IOException
        Since:
        2.0
      • _throwAsIOE

        protected void _throwAsIOE(Exception e,
                       Object value)
                            throws IOException
        Method that takes in exception of any type, and casts or wraps it to an IOException or its subclass.
        Throws:
        IOException

Copyright © 2012-2014 FasterXML. All Rights Reserved.