com.fasterxml.jackson.databind.exc

Class UnrecognizedPropertyException

  • All Implemented Interfaces:
    Serializable


    public class UnrecognizedPropertyException
    extends JsonMappingException
    Specialized JsonMappingException sub-class specifically used to indicate problems due to encountering a JSON property that could not be mapped to an Object property (via getter, constructor argument or field).
    See Also:
    Serialized Form
    • Field Detail

      • _referringClass

        protected final Class<?> _referringClass
        Class that does not contain mapping for the unrecognized property.
      • _unrecognizedPropertyName

        protected final String _unrecognizedPropertyName

        Note: redundant information since it is also included in the reference path.

      • _propertyIds

        protected final Collection<Object> _propertyIds
        Set of ids of properties that are known for the type, if this can be statically determined.
      • _propertiesAsString

        protected transient String _propertiesAsString
        Lazily constructed description of known properties, used for constructing actual message if and as needed.
    • Method Detail

      • from

        public static UnrecognizedPropertyException from(JsonParser jp,
                                         Object fromObjectOrClass,
                                         String propertyName,
                                         Collection<Object> propertyIds)
        Factory method used for constructing instances of this exception type.
        Parameters:
        jp - Underlying parser used for reading input being used for data-binding
        fromObjectOrClass - Reference to either instance of problematic type ( if available), or if not, type itself
        propertyName - Name of unrecognized property
        propertyIds - (optional, null if not available) Set of properties that type would recognize, if completely known: null if set can not be determined.
      • getReferringClass

        public Class<?> getReferringClass()
        Method for accessing type (class) that is missing definition to allow binding of the unrecognized property.
      • getUnrecognizedPropertyName

        public String getUnrecognizedPropertyName()
        Convenience method for accessing logical property name that could not be mapped. Note that it is the last path reference in the underlying path.

Copyright © 2012-2013 FasterXML. All Rights Reserved.