Package org.codehaus.jackson.map.deser
Class BeanDeserializer
- java.lang.Object
-
- org.codehaus.jackson.map.JsonDeserializer<T>
-
- org.codehaus.jackson.map.deser.std.StdDeserializer<java.lang.Object>
-
- org.codehaus.jackson.map.deser.BeanDeserializer
-
- All Implemented Interfaces:
ResolvableDeserializer
- Direct Known Subclasses:
ThrowableDeserializer
public class BeanDeserializer extends StdDeserializer<java.lang.Object> implements ResolvableDeserializer
Deserializer class that can deserialize instances of arbitrary bean objects, usually from JSON Object structs, but possibly also from simple types like String values.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.codehaus.jackson.map.deser.std.StdDeserializer
StdDeserializer.BigDecimalDeserializer, StdDeserializer.BigIntegerDeserializer, StdDeserializer.BooleanDeserializer, StdDeserializer.ByteDeserializer, StdDeserializer.CharacterDeserializer, StdDeserializer.DoubleDeserializer, StdDeserializer.FloatDeserializer, StdDeserializer.IntegerDeserializer, StdDeserializer.LongDeserializer, StdDeserializer.NumberDeserializer, StdDeserializer.PrimitiveOrWrapperDeserializer<T>, StdDeserializer.ShortDeserializer, StdDeserializer.SqlDateDeserializer, StdDeserializer.StackTraceElementDeserializer
-
Nested classes/interfaces inherited from class org.codehaus.jackson.map.JsonDeserializer
JsonDeserializer.None
-
-
Field Summary
Fields Modifier and Type Field Description protected SettableAnyProperty_anySetterFallback setter used for handling any properties that are not mapped to regular setters.protected java.util.Map<java.lang.String,SettableBeanProperty>_backRefsWe may also have one or more back reference fields (usually zero or one).protected BeanPropertyMap_beanPropertiesMapping of property names to properties, built when all properties to use have been successfully resolved.protected JavaType_beanTypeDeclared type of the bean this deserializer handles.protected JsonDeserializer<java.lang.Object>_delegateDeserializerDeserializer that is used iff delegate-based creator is to be used for deserializing from JSON Object.protected ExternalTypeHandler_externalTypeIdHandlerHandler that we need iff any of properties uses external type id.protected AnnotatedClass_forClassClass for which deserializer is built; used for accessing annotations during resolution phase (seeresolve(org.codehaus.jackson.map.DeserializationConfig, org.codehaus.jackson.map.DeserializerProvider)).protected java.util.HashSet<java.lang.String>_ignorablePropsIn addition to properties that are set, we will also keep track of recognized but ignorable properties: these will be skipped without errors or warnings.protected boolean_ignoreAllUnknownFlag that can be set to ignore and skip unknown properties.protected ValueInjector[]_injectablesList ofValueInjectors, if any injectable values are expected by the bean; otherwise null.protected boolean_nonStandardCreationFlag that is set to mark "non-standard" cases; where either we use one of non-default creators, or there are unwrapped values to consider.protected BeanProperty_propertyProperty that contains value to be deserialized using deserializer; mostly needed to find contextual annotations for subtypes.protected PropertyBasedCreator_propertyBasedCreatorIf the bean needs to be instantiated using constructor or factory method that takes one or more named properties as argument(s), this creator is used for instantiation.protected java.util.HashMap<ClassKey,JsonDeserializer<java.lang.Object>>_subDeserializersLazily constructed map used to contain deserializers needed for polymorphic subtypes.protected UnwrappedPropertyHandler_unwrappedPropertyHandlerIf one of properties has "unwrapped" value, we need separate helper objectprotected ValueInstantiator_valueInstantiatorObject that handles details of constructing initial bean value (to which bind data to), unless instance is passed (via updateValue())-
Fields inherited from class org.codehaus.jackson.map.deser.std.StdDeserializer
_valueClass
-
-
Constructor Summary
Constructors Modifier Constructor Description BeanDeserializer(BeanDescription beanDesc, BeanProperty property, ValueInstantiator valueInstantiator, BeanPropertyMap properties, java.util.Map<java.lang.String,SettableBeanProperty> backRefs, java.util.HashSet<java.lang.String> ignorableProps, boolean ignoreAllUnknown, SettableAnyProperty anySetter, java.util.List<ValueInjector> injectables)protectedBeanDeserializer(BeanDeserializer src)Copy-constructor that can be used by sub-classes to allow copy-on-write styling copying of settings of an existing instance.protectedBeanDeserializer(BeanDeserializer src, boolean ignoreAllUnknown)BeanDeserializer(AnnotatedClass forClass, JavaType type, BeanProperty property, CreatorCollector creators, BeanPropertyMap properties, java.util.Map<java.lang.String,SettableBeanProperty> backRefs, java.util.HashSet<java.lang.String> ignorableProps, boolean ignoreAllUnknown, SettableAnyProperty anySetter)Deprecated.(since 1.9) Use the constructor that takesValueInstantiatorinsteadprotectedBeanDeserializer(AnnotatedClass forClass, JavaType type, BeanProperty property, ValueInstantiator valueInstantiator, BeanPropertyMap properties, java.util.Map<java.lang.String,SettableBeanProperty> backRefs, java.util.HashSet<java.lang.String> ignorableProps, boolean ignoreAllUnknown, SettableAnyProperty anySetter, java.util.List<ValueInjector> injectables)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.lang.Object_deserializeUsingPropertyBased(JsonParser jp, DeserializationContext ctxt)Method called to deserialize bean using "property-based creator": this means that a non-default constructor or factory method is called, and then possibly other setters.protected JsonDeserializer<java.lang.Object>_findSubclassDeserializer(DeserializationContext ctxt, java.lang.Object bean, TokenBuffer unknownTokens)Helper method called to (try to) locate deserializer for given sub-type of type that this deserializer handles.protected SettableBeanProperty_resolveInnerClassValuedProperty(DeserializationConfig config, SettableBeanProperty prop)Helper method that will handle gruesome details of dealing with properties that have non-static inner class as value...protected SettableBeanProperty_resolveManagedReferenceProperty(DeserializationConfig config, SettableBeanProperty prop)Helper method called to see if given property is part of 'managed' property pair (managed + back reference), and if so, handle resolution details.protected SettableBeanProperty_resolveUnwrappedProperty(DeserializationConfig config, SettableBeanProperty prop)Helper method called to see if given property might be so-called unwrapped property: these require special handling.java.lang.Objectdeserialize(JsonParser jp, DeserializationContext ctxt)Main deserialization method for bean-based objects (POJOs).java.lang.Objectdeserialize(JsonParser jp, DeserializationContext ctxt, java.lang.Object bean)Secondary deserialization method, called in cases where POJO instance is created as part of deserialization, potentially after collecting some or all of the properties to set.java.lang.ObjectdeserializeFromArray(JsonParser jp, DeserializationContext ctxt)java.lang.ObjectdeserializeFromBoolean(JsonParser jp, DeserializationContext ctxt)Method called to deserialize POJO value from a JSON boolean value (true, false)java.lang.ObjectdeserializeFromDouble(JsonParser jp, DeserializationContext ctxt)Method called to deserialize POJO value from a JSON floating-point number.java.lang.ObjectdeserializeFromNumber(JsonParser jp, DeserializationContext ctxt)java.lang.ObjectdeserializeFromObject(JsonParser jp, DeserializationContext ctxt)protected java.lang.ObjectdeserializeFromObjectUsingNonDefault(JsonParser jp, DeserializationContext ctxt)java.lang.ObjectdeserializeFromString(JsonParser jp, DeserializationContext ctxt)protected java.lang.ObjectdeserializeUsingPropertyBasedWithExternalTypeId(JsonParser jp, DeserializationContext ctxt)protected java.lang.ObjectdeserializeUsingPropertyBasedWithUnwrapped(JsonParser jp, DeserializationContext ctxt)protected java.lang.ObjectdeserializeWithExternalTypeId(JsonParser jp, DeserializationContext ctxt)protected java.lang.ObjectdeserializeWithExternalTypeId(JsonParser jp, DeserializationContext ctxt, java.lang.Object bean)java.lang.ObjectdeserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer)Base implementation that does not assume specific type inclusion mechanism.protected java.lang.ObjectdeserializeWithUnwrapped(JsonParser jp, DeserializationContext ctxt)Method called when there are declared "unwrapped" properties which need special handlingprotected java.lang.ObjectdeserializeWithUnwrapped(JsonParser jp, DeserializationContext ctxt, java.lang.Object bean)SettableBeanPropertyfindBackReference(java.lang.String logicalName)Method needed byBeanDeserializerFactoryto properly link managed- and back-reference pairs.java.lang.Class<?>getBeanClass()intgetPropertyCount()Accessor for checking number of deserialized properties.ValueInstantiatorgetValueInstantiator()JavaTypegetValueType()Exact structured type deserializer handles, if known.protected java.lang.ObjecthandlePolymorphic(JsonParser jp, DeserializationContext ctxt, java.lang.Object bean, TokenBuffer unknownTokens)Method called in cases where we may have polymorphic deserialization case: that is, type of Creator-constructed bean is not the type of deserializer itself.protected java.lang.ObjecthandleUnknownProperties(DeserializationContext ctxt, java.lang.Object bean, TokenBuffer unknownTokens)Method called to handle set of one or more unknown properties, stored in their entirety in givenTokenBuffer(as field entries, name and value).protected voidhandleUnknownProperty(JsonParser jp, DeserializationContext ctxt, java.lang.Object beanOrClass, java.lang.String propName)Method called when a JSON property is encountered that has not matching setter, any-setter or field, and thus can not be assigned.booleanhasProperty(java.lang.String propertyName)protected voidinjectValues(DeserializationContext ctxt, java.lang.Object bean)java.util.Iterator<SettableBeanProperty>properties()voidresolve(DeserializationConfig config, DeserializerProvider provider)Method called to finalize setup of this deserializer, after deserializer itself has been registered.JsonDeserializer<java.lang.Object>unwrappingDeserializer()Method that will return deserializer instance that is able to handle "unwrapped" value instances If no unwrapped instance can be constructed, will simply return this object as-is.voidwrapAndThrow(java.lang.Throwable t, java.lang.Object bean, int index)Deprecated.Since 1.7 use variant that takesDeserializationContextvoidwrapAndThrow(java.lang.Throwable t, java.lang.Object bean, int index, DeserializationContext ctxt)voidwrapAndThrow(java.lang.Throwable t, java.lang.Object bean, java.lang.String fieldName)Deprecated.Since 1.7 use variant that takesDeserializationContextvoidwrapAndThrow(java.lang.Throwable t, java.lang.Object bean, java.lang.String fieldName, DeserializationContext ctxt)Method that will modify caught exception (passed in as argument) as necessary to include reference information, and to ensure it is a subtype ofIOException, or an unchecked exception.protected voidwrapInstantiationProblem(java.lang.Throwable t, DeserializationContext ctxt)-
Methods inherited from class org.codehaus.jackson.map.deser.std.StdDeserializer
_parseBoolean, _parseBooleanFromNumber, _parseBooleanPrimitive, _parseByte, _parseDate, _parseDouble, _parseDoublePrimitive, _parseFloat, _parseFloatPrimitive, _parseInteger, _parseIntPrimitive, _parseLong, _parseLongPrimitive, _parseShort, _parseShortPrimitive, findDeserializer, getValueClass, isDefaultSerializer, parseDouble, reportUnknownProperty
-
Methods inherited from class org.codehaus.jackson.map.JsonDeserializer
getEmptyValue, getNullValue
-
-
-
-
Field Detail
-
_forClass
protected final AnnotatedClass _forClass
Class for which deserializer is built; used for accessing annotations during resolution phase (seeresolve(org.codehaus.jackson.map.DeserializationConfig, org.codehaus.jackson.map.DeserializerProvider)).
-
_beanType
protected final JavaType _beanType
Declared type of the bean this deserializer handles.
-
_property
protected final BeanProperty _property
Property that contains value to be deserialized using deserializer; mostly needed to find contextual annotations for subtypes.- Since:
- 1.7
-
_valueInstantiator
protected final ValueInstantiator _valueInstantiator
Object that handles details of constructing initial bean value (to which bind data to), unless instance is passed (via updateValue())
-
_delegateDeserializer
protected JsonDeserializer<java.lang.Object> _delegateDeserializer
Deserializer that is used iff delegate-based creator is to be used for deserializing from JSON Object.
-
_propertyBasedCreator
protected final PropertyBasedCreator _propertyBasedCreator
If the bean needs to be instantiated using constructor or factory method that takes one or more named properties as argument(s), this creator is used for instantiation.
-
_nonStandardCreation
protected boolean _nonStandardCreation
Flag that is set to mark "non-standard" cases; where either we use one of non-default creators, or there are unwrapped values to consider.
-
_beanProperties
protected final BeanPropertyMap _beanProperties
Mapping of property names to properties, built when all properties to use have been successfully resolved.- Since:
- 1.7
-
_injectables
protected final ValueInjector[] _injectables
List ofValueInjectors, if any injectable values are expected by the bean; otherwise null. This includes injectors used for injecting values via setters and fields, but not ones passed through constructor parameters.- Since:
- 1.9
-
_anySetter
protected SettableAnyProperty _anySetter
Fallback setter used for handling any properties that are not mapped to regular setters. If setter is not null, it will be called once for each such property.
-
_ignorableProps
protected final java.util.HashSet<java.lang.String> _ignorableProps
In addition to properties that are set, we will also keep track of recognized but ignorable properties: these will be skipped without errors or warnings.
-
_ignoreAllUnknown
protected final boolean _ignoreAllUnknown
Flag that can be set to ignore and skip unknown properties. If set, will not throw an exception for unknown properties.
-
_backRefs
protected final java.util.Map<java.lang.String,SettableBeanProperty> _backRefs
We may also have one or more back reference fields (usually zero or one).
-
_subDeserializers
protected java.util.HashMap<ClassKey,JsonDeserializer<java.lang.Object>> _subDeserializers
Lazily constructed map used to contain deserializers needed for polymorphic subtypes.
-
_unwrappedPropertyHandler
protected UnwrappedPropertyHandler _unwrappedPropertyHandler
If one of properties has "unwrapped" value, we need separate helper object- Since:
- 1.9
-
_externalTypeIdHandler
protected ExternalTypeHandler _externalTypeIdHandler
Handler that we need iff any of properties uses external type id.
-
-
Constructor Detail
-
BeanDeserializer
@Deprecated public BeanDeserializer(AnnotatedClass forClass, JavaType type, BeanProperty property, CreatorCollector creators, BeanPropertyMap properties, java.util.Map<java.lang.String,SettableBeanProperty> backRefs, java.util.HashSet<java.lang.String> ignorableProps, boolean ignoreAllUnknown, SettableAnyProperty anySetter)
Deprecated.(since 1.9) Use the constructor that takesValueInstantiatorinstead
-
BeanDeserializer
public BeanDeserializer(BeanDescription beanDesc, BeanProperty property, ValueInstantiator valueInstantiator, BeanPropertyMap properties, java.util.Map<java.lang.String,SettableBeanProperty> backRefs, java.util.HashSet<java.lang.String> ignorableProps, boolean ignoreAllUnknown, SettableAnyProperty anySetter, java.util.List<ValueInjector> injectables)
- Since:
- 1.9
-
BeanDeserializer
protected BeanDeserializer(AnnotatedClass forClass, JavaType type, BeanProperty property, ValueInstantiator valueInstantiator, BeanPropertyMap properties, java.util.Map<java.lang.String,SettableBeanProperty> backRefs, java.util.HashSet<java.lang.String> ignorableProps, boolean ignoreAllUnknown, SettableAnyProperty anySetter, java.util.List<ValueInjector> injectables)
- Since:
- 1.9
-
BeanDeserializer
protected BeanDeserializer(BeanDeserializer src)
Copy-constructor that can be used by sub-classes to allow copy-on-write styling copying of settings of an existing instance.- Since:
- 1.7
-
BeanDeserializer
protected BeanDeserializer(BeanDeserializer src, boolean ignoreAllUnknown)
- Since:
- 1.9
-
-
Method Detail
-
unwrappingDeserializer
public JsonDeserializer<java.lang.Object> unwrappingDeserializer()
Description copied from class:JsonDeserializerMethod that will return deserializer instance that is able to handle "unwrapped" value instances If no unwrapped instance can be constructed, will simply return this object as-is.Default implementation just returns 'this' indicating that no unwrapped variant exists
- Overrides:
unwrappingDeserializerin classJsonDeserializer<java.lang.Object>
-
hasProperty
public boolean hasProperty(java.lang.String propertyName)
-
getPropertyCount
public int getPropertyCount()
Accessor for checking number of deserialized properties.- Since:
- 1.7
-
getBeanClass
public final java.lang.Class<?> getBeanClass()
-
getValueType
public JavaType getValueType()
Description copied from class:StdDeserializerExact structured type deserializer handles, if known.Default implementation just returns null.
- Overrides:
getValueTypein classStdDeserializer<java.lang.Object>
-
properties
public java.util.Iterator<SettableBeanProperty> properties()
- Since:
- 1.6
-
findBackReference
public SettableBeanProperty findBackReference(java.lang.String logicalName)
Method needed byBeanDeserializerFactoryto properly link managed- and back-reference pairs.
-
getValueInstantiator
public ValueInstantiator getValueInstantiator()
- Since:
- 1.9
-
resolve
public void resolve(DeserializationConfig config, DeserializerProvider provider) throws JsonMappingException
Method called to finalize setup of this deserializer, after deserializer itself has been registered. This is needed to handle recursive and transitive dependencies.- Specified by:
resolvein interfaceResolvableDeserializerprovider- Provider that has constructed deserializer this method is called on.- Throws:
JsonMappingException
-
_resolveManagedReferenceProperty
protected SettableBeanProperty _resolveManagedReferenceProperty(DeserializationConfig config, SettableBeanProperty prop)
Helper method called to see if given property is part of 'managed' property pair (managed + back reference), and if so, handle resolution details.- Since:
- 1.9
-
_resolveUnwrappedProperty
protected SettableBeanProperty _resolveUnwrappedProperty(DeserializationConfig config, SettableBeanProperty prop)
Helper method called to see if given property might be so-called unwrapped property: these require special handling.- Since:
- 1.9
-
_resolveInnerClassValuedProperty
protected SettableBeanProperty _resolveInnerClassValuedProperty(DeserializationConfig config, SettableBeanProperty prop)
Helper method that will handle gruesome details of dealing with properties that have non-static inner class as value...- Since:
- 1.9
-
deserialize
public final java.lang.Object deserialize(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
Main deserialization method for bean-based objects (POJOs).- Specified by:
deserializein classJsonDeserializer<java.lang.Object>- Parameters:
jp- Parsed used for reading JSON contentctxt- Context that can be used to access information about this deserialization activity.- Returns:
- Deserializer value
- Throws:
java.io.IOExceptionJsonProcessingException
-
deserialize
public java.lang.Object deserialize(JsonParser jp, DeserializationContext ctxt, java.lang.Object bean) throws java.io.IOException, JsonProcessingException
Secondary deserialization method, called in cases where POJO instance is created as part of deserialization, potentially after collecting some or all of the properties to set.- Overrides:
deserializein classJsonDeserializer<java.lang.Object>- Throws:
java.io.IOExceptionJsonProcessingException
-
deserializeWithType
public java.lang.Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws java.io.IOException, JsonProcessingException
Description copied from class:StdDeserializerBase implementation that does not assume specific type inclusion mechanism. Sub-classes are expected to override this method if they are to handle type information.- Overrides:
deserializeWithTypein classStdDeserializer<java.lang.Object>typeDeserializer- Deserializer to use for handling type information- Throws:
java.io.IOExceptionJsonProcessingException
-
deserializeFromObject
public java.lang.Object deserializeFromObject(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
- Throws:
java.io.IOExceptionJsonProcessingException
-
deserializeFromObjectUsingNonDefault
protected java.lang.Object deserializeFromObjectUsingNonDefault(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
- Throws:
java.io.IOExceptionJsonProcessingException- Since:
- 1.9
-
deserializeFromString
public java.lang.Object deserializeFromString(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
- Throws:
java.io.IOExceptionJsonProcessingException
-
deserializeFromNumber
public java.lang.Object deserializeFromNumber(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
- Throws:
java.io.IOExceptionJsonProcessingException
-
deserializeFromDouble
public java.lang.Object deserializeFromDouble(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
Method called to deserialize POJO value from a JSON floating-point number.- Throws:
java.io.IOExceptionJsonProcessingException- Since:
- 1.9
-
deserializeFromBoolean
public java.lang.Object deserializeFromBoolean(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
Method called to deserialize POJO value from a JSON boolean value (true, false)- Throws:
java.io.IOExceptionJsonProcessingException- Since:
- 1.9
-
deserializeFromArray
public java.lang.Object deserializeFromArray(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
- Throws:
java.io.IOExceptionJsonProcessingException- Since:
- 1.9
-
_deserializeUsingPropertyBased
protected final java.lang.Object _deserializeUsingPropertyBased(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
Method called to deserialize bean using "property-based creator": this means that a non-default constructor or factory method is called, and then possibly other setters. The trick is that values for creator method need to be buffered, first; and due to non-guaranteed ordering possibly some other properties as well.- Throws:
java.io.IOExceptionJsonProcessingException- Since:
- 1.2
-
handlePolymorphic
protected java.lang.Object handlePolymorphic(JsonParser jp, DeserializationContext ctxt, java.lang.Object bean, TokenBuffer unknownTokens) throws java.io.IOException, JsonProcessingException
Method called in cases where we may have polymorphic deserialization case: that is, type of Creator-constructed bean is not the type of deserializer itself. It should be a sub-class or implementation class; either way, we may have more specific deserializer to use for handling it.- Parameters:
jp- (optional) If not null, parser that has more properties to handle (in addition to buffered properties); if null, all properties are passed in buffer- Throws:
java.io.IOExceptionJsonProcessingException
-
deserializeWithUnwrapped
protected java.lang.Object deserializeWithUnwrapped(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
Method called when there are declared "unwrapped" properties which need special handling- Throws:
java.io.IOExceptionJsonProcessingException
-
deserializeWithUnwrapped
protected java.lang.Object deserializeWithUnwrapped(JsonParser jp, DeserializationContext ctxt, java.lang.Object bean) throws java.io.IOException, JsonProcessingException
- Throws:
java.io.IOExceptionJsonProcessingException
-
deserializeUsingPropertyBasedWithUnwrapped
protected java.lang.Object deserializeUsingPropertyBasedWithUnwrapped(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
- Throws:
java.io.IOExceptionJsonProcessingException
-
deserializeWithExternalTypeId
protected java.lang.Object deserializeWithExternalTypeId(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
- Throws:
java.io.IOExceptionJsonProcessingException
-
deserializeWithExternalTypeId
protected java.lang.Object deserializeWithExternalTypeId(JsonParser jp, DeserializationContext ctxt, java.lang.Object bean) throws java.io.IOException, JsonProcessingException
- Throws:
java.io.IOExceptionJsonProcessingException
-
deserializeUsingPropertyBasedWithExternalTypeId
protected java.lang.Object deserializeUsingPropertyBasedWithExternalTypeId(JsonParser jp, DeserializationContext ctxt) throws java.io.IOException, JsonProcessingException
- Throws:
java.io.IOExceptionJsonProcessingException
-
injectValues
protected void injectValues(DeserializationContext ctxt, java.lang.Object bean) throws java.io.IOException, JsonProcessingException
- Throws:
java.io.IOExceptionJsonProcessingException
-
handleUnknownProperty
protected void handleUnknownProperty(JsonParser jp, DeserializationContext ctxt, java.lang.Object beanOrClass, java.lang.String propName) throws java.io.IOException, JsonProcessingException
Method called when a JSON property is encountered that has not matching setter, any-setter or field, and thus can not be assigned.- Overrides:
handleUnknownPropertyin classStdDeserializer<java.lang.Object>- Parameters:
jp- Parser that points to value of the unknown propertyctxt- Context for deserialization; allows access to the parser, error reporting functionalitybeanOrClass- Instance that is being populated by this deserializer, or if not known, Class that would be instantiated. If null, will assume type is whatStdDeserializer.getValueClass()returns.propName- Name of the property that can not be mapped- Throws:
java.io.IOExceptionJsonProcessingException
-
handleUnknownProperties
protected java.lang.Object handleUnknownProperties(DeserializationContext ctxt, java.lang.Object bean, TokenBuffer unknownTokens) throws java.io.IOException, JsonProcessingException
Method called to handle set of one or more unknown properties, stored in their entirety in givenTokenBuffer(as field entries, name and value).- Throws:
java.io.IOExceptionJsonProcessingException
-
_findSubclassDeserializer
protected JsonDeserializer<java.lang.Object> _findSubclassDeserializer(DeserializationContext ctxt, java.lang.Object bean, TokenBuffer unknownTokens) throws java.io.IOException, JsonProcessingException
Helper method called to (try to) locate deserializer for given sub-type of type that this deserializer handles.- Throws:
java.io.IOExceptionJsonProcessingException
-
wrapAndThrow
public void wrapAndThrow(java.lang.Throwable t, java.lang.Object bean, java.lang.String fieldName, DeserializationContext ctxt) throws java.io.IOExceptionMethod that will modify caught exception (passed in as argument) as necessary to include reference information, and to ensure it is a subtype ofIOException, or an unchecked exception.Rules for wrapping and unwrapping are bit complicated; essentially:
- Errors are to be passed as is (if uncovered via unwrapping)
- "Plain" IOExceptions (ones that are not of type
JsonMappingExceptionare to be passed as is
- Throws:
java.io.IOException
-
wrapAndThrow
public void wrapAndThrow(java.lang.Throwable t, java.lang.Object bean, int index, DeserializationContext ctxt) throws java.io.IOException- Throws:
java.io.IOException
-
wrapInstantiationProblem
protected void wrapInstantiationProblem(java.lang.Throwable t, DeserializationContext ctxt) throws java.io.IOException- Throws:
java.io.IOException
-
wrapAndThrow
@Deprecated public void wrapAndThrow(java.lang.Throwable t, java.lang.Object bean, java.lang.String fieldName) throws java.io.IOExceptionDeprecated.Since 1.7 use variant that takesDeserializationContext- Throws:
java.io.IOException
-
wrapAndThrow
@Deprecated public void wrapAndThrow(java.lang.Throwable t, java.lang.Object bean, int index) throws java.io.IOExceptionDeprecated.Since 1.7 use variant that takesDeserializationContext- Throws:
java.io.IOException
-
-