public SettableAnyProperty withValueDeserializer(JsonDeserializer<Object> deser) { return new SettableAnyProperty(_property, _setter, _type, deser); }
public final void set(Object instance, String propName, Object value) throws IOException { try { _setter.invoke(instance, propName, value); } catch (Exception e) { _throwAsIOE(e, propName, value); } }
/** * Method called to deserialize appropriate value, given parser (and * context), and set it using appropriate method (a setter method). */ public final void deserializeAndSet(JsonParser jp, DeserializationContext ctxt, Object instance, String propName) throws IOException, JsonProcessingException { set(instance, propName, deserialize(jp, ctxt)); }
if (_anySetter != null && !_anySetter.hasValueDeserializer()) { _anySetter = _anySetter.withValueDeserializer(findDeserializer(config, provider, _anySetter.getType(), _anySetter.getProperty()));
private final void _handleUnknown(JsonParser jp, DeserializationContext ctxt, Object bean, String propName) throws IOException, JsonProcessingException { /* As per [JACKSON-313], things marked as ignorable should not be * passed to any setter */ if (_ignorableProps != null && _ignorableProps.contains(propName)) { jp.skipChildren(); } else if (_anySetter != null) { try { _anySetter.deserializeAndSet(jp, ctxt, bean, propName); } catch (Exception e) { wrapAndThrow(e, bean, propName, ctxt); } } else { // Unknown: let's call handler method handleUnknownProperty(jp, ctxt, bean, propName); } }
if (_anySetter != null && !_anySetter.hasValueDeserializer()) { _anySetter.setValueDeserializer(findDeserializer(config, provider, _anySetter.getType(), _anySetter.getProperty()));
buffer.bufferAnyProperty(_anySetter, propName, _anySetter.deserialize(jp, ctxt)); continue;
@Override public String toString() { return "[any property on class "+getClassName()+"]"; } }
if (_anySetter != null && !_anySetter.hasValueDeserializer()) { _anySetter.setValueDeserializer(findDeserializer(config, provider, _anySetter.getType(), "[any]", seen));
@Override public void assign(Object bean) throws IOException, JsonProcessingException { _property.set(bean, _propertyName, value); } }
Method m = am.getAnnotated(); if (deser != null) { SettableAnyProperty prop = new SettableAnyProperty(type, m); prop.setValueDeserializer(deser); return prop; return new SettableAnyProperty(type, m);
if (_anySetter != null && !_anySetter.hasValueDeserializer()) { _anySetter = _anySetter.withValueDeserializer(findDeserializer(config, provider, _anySetter.getType(), _anySetter.getProperty()));
jp.skipChildren(); } else if (_anySetter != null) { _anySetter.deserializeAndSet(jp, ctxt, bean, propName); continue; } else {
buffer.bufferAnyProperty(_anySetter, propName, _anySetter.deserialize(jp, ctxt));
String actType = (value == null) ? "[NULL]" : value.getClass().getName(); StringBuilder msg = new StringBuilder("Problem deserializing \"any\" property '").append(propName); msg.append("' of class "+getClassName()+" (expected type: ").append(_type); msg.append("; actual type: ").append(actType).append(")"); String origMsg = e.getMessage();
@Override public void assign(Object bean) throws IOException, JsonProcessingException { _property.set(bean, _propertyName, value); } }
SettableAnyProperty prop = new SettableAnyProperty(property, setter, type); prop.setValueDeserializer(deser); return prop; return new SettableAnyProperty(property, setter, type);
if (_anySetter != null && !_anySetter.hasValueDeserializer()) { _anySetter = _anySetter.withValueDeserializer(findDeserializer(config, provider, _anySetter.getType(), _anySetter.getProperty()));
_anySetter.deserializeAndSet(jp, ctxt, bean, propName);
/** * Method called to deserialize appropriate value, given parser (and * context), and set it using appropriate method (a setter method). */ public final void deserializeAndSet(JsonParser jp, DeserializationContext ctxt, Object instance, String propName) throws IOException, JsonProcessingException { set(instance, propName, deserialize(jp, ctxt)); }