@Override public BeanDeserializerBase withObjectIdReader(ObjectIdReader oir) { return new BeanAsArrayBuilderDeserializer(_delegate.withObjectIdReader(oir), _targetType, _orderedProperties, _buildMethod); }
return finishBuild(ctxt, _deserializeFromNonArray(p, ctxt)); return finishBuild(ctxt, _deserializeNonVanilla(p, ctxt)); while (true) { if (p.nextToken() == JsonToken.END_ARRAY) { return finishBuild(ctxt, builder); builder = prop.deserializeSetAndReturn(p, ctxt, builder); } catch (Exception e) { wrapAndThrow(e, builder, prop.getName(), ctxt); ctxt.reportInputMismatch(handledType(), "Unexpected JSON values; expected at most %d properties (in JSON Array)", propCount); p.skipChildren(); return finishBuild(ctxt, builder);
return deserializeFromObjectUsingNonDefault(p, ctxt); injectValues(ctxt, builder); prop.deserializeSetAndReturn(p, ctxt, builder); } catch (Exception e) { wrapAndThrow(e, builder, prop.getName(), ctxt);
builder = prop.deserializeSetAndReturn(p, ctxt, builder); } catch (Exception e) { wrapAndThrow(e, builder, prop.getName(), ctxt); builder = creator.build(ctxt, buffer); } catch (Exception e) { wrapAndThrow(e, _beanType.getRawClass(), propName, ctxt); continue; // never gets here builder = creator.build(ctxt, buffer); } catch (Exception e) { return wrapInstantiationProblem(e, ctxt);
injectValues(ctxt, builder); while (true) { if (p.nextToken() == JsonToken.END_ARRAY) { return finishBuild(ctxt, builder); builder = prop.deserializeSetAndReturn(p, ctxt, builder); } catch (Exception e) { wrapAndThrow(e, builder, prop.getName(), ctxt); p.skipChildren(); return finishBuild(ctxt, builder);
return _deserializeWithCreator(p, ctxt); injectValues(ctxt, builder); prop.deserializeSetAndReturn(p, ctxt, builder); } catch (Exception e) { wrapAndThrow(e, builder, prop.getName(), ctxt);
protected final Object finishBuild(DeserializationContext ctxt, Object builder) throws IOException { try { return _buildMethod.getMember().invoke(builder, (Object[]) null); } catch (Exception e) { return wrapInstantiationProblem(e, ctxt); } }
@Override public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) throws IOException { return _deserializeFromNonArray(p, ctxt); }
protected Object _deserializeFromNonArray(JsonParser p, DeserializationContext ctxt) throws IOException { // Let's start with failure return ctxt.handleUnexpectedToken(handledType(), p.getCurrentToken(), p, "Cannot deserialize a POJO (of type %s) from non-Array representation (token: %s): " +"type/property designed to be serialized as JSON Array", _beanType.getRawClass().getName(), p.getCurrentToken()); // in future, may allow use of "standard" POJO serialization as well; if so, do: //return _delegate.deserialize(p, ctxt); } }
protected Object _deserializeWithCreator(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { if (_delegateDeserializer != null) { return _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(jp, ctxt)); } if (_propertyBasedCreator != null) { return _deserializeUsingPropertyBased(jp, ctxt); } // should only occur for abstract types... if (_beanType.isAbstract()) { throw JsonMappingException.from(jp, "Can not instantiate abstract type "+_beanType +" (need to add/enable type information?)"); } throw JsonMappingException.from(jp, "No suitable constructor found for type " +_beanType+": can not instantiate from JSON object (need to add/enable type information?)"); }
injectValues(ctxt, builder); while (true) { if (p.nextToken() == JsonToken.END_ARRAY) { return finishBuild(ctxt, builder); builder = prop.deserializeSetAndReturn(p, ctxt, builder); } catch (Exception e) { wrapAndThrow(e, builder, prop.getName(), ctxt); p.skipChildren(); } while (p.nextToken() != JsonToken.END_ARRAY); return finishBuild(ctxt, builder);
builder = prop.deserializeSetAndReturn(p, ctxt, builder); } catch (Exception e) { wrapAndThrow(e, builder, prop.getName(), ctxt); builder = creator.build(ctxt, buffer); } catch (Exception e) { wrapAndThrow(e, _beanType.getRawClass(), propName, ctxt); continue; // never gets here builder = creator.build(ctxt, buffer); } catch (Exception e) { return wrapInstantiationProblem(e, ctxt);
return _deserializeWithCreator(jp, ctxt); injectValues(ctxt, builder); prop.deserializeSetAndReturn(jp, ctxt, builder); } catch (Exception e) { wrapAndThrow(e, builder, prop.getName(), ctxt);
protected final Object finishBuild(DeserializationContext ctxt, Object builder) throws IOException { try { return _buildMethod.getMember().invoke(builder); } catch (Exception e) { return wrapInstantiationProblem(e, ctxt); } }
@Override public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) throws IOException { return _deserializeFromNonArray(p, ctxt); }
protected Object _deserializeFromNonArray(JsonParser p, DeserializationContext ctxt) throws IOException { // Let's start with failure return ctxt.handleUnexpectedToken(handledType(), p.getCurrentToken(), p, "Can not deserialize a POJO (of type %s) from non-Array representation (token: %s): " +"type/property designed to be serialized as JSON Array", _beanType.getRawClass().getName(), p.getCurrentToken()); // in future, may allow use of "standard" POJO serialization as well; if so, do: //return _delegate.deserialize(p, ctxt); } }
protected Object _deserializeWithCreator(JsonParser p, DeserializationContext ctxt) throws IOException { if (_delegateDeserializer != null) { return _valueInstantiator.createUsingDelegate(ctxt, _delegateDeserializer.deserialize(p, ctxt)); } if (_propertyBasedCreator != null) { return _deserializeUsingPropertyBased(p, ctxt); } // should only occur for abstract types... if (_beanType.isAbstract()) { throw JsonMappingException.from(p, "Can not instantiate abstract type "+_beanType +" (need to add/enable type information?)"); } throw JsonMappingException.from(p, "No suitable constructor found for type " +_beanType+": can not instantiate from JSON object (need to add/enable type information?)"); }
return finishBuild(ctxt, _deserializeFromNonArray(jp, ctxt)); return finishBuild(ctxt, _deserializeNonVanilla(jp, ctxt)); while (true) { if (jp.nextToken() == JsonToken.END_ARRAY) { return finishBuild(ctxt, builder); builder = prop.deserializeSetAndReturn(jp, ctxt, builder); } catch (Exception e) { wrapAndThrow(e, builder, prop.getName(), ctxt); jp.skipChildren(); return finishBuild(ctxt, builder);
injectValues(ctxt, builder); while (true) { if (jp.nextToken() == JsonToken.END_ARRAY) { return finishBuild(ctxt, builder); builder = prop.deserializeSetAndReturn(jp, ctxt, builder); } catch (Exception e) { wrapAndThrow(e, builder, prop.getName(), ctxt); jp.skipChildren(); return finishBuild(ctxt, builder);
builder = prop.deserializeSetAndReturn(jp, ctxt, builder); } catch (Exception e) { wrapAndThrow(e, builder, prop.getName(), ctxt); builder = creator.build(ctxt, buffer); } catch (Exception e) { wrapAndThrow(e, _beanType.getRawClass(), propName, ctxt); continue; // never gets here builder = creator.build(ctxt, buffer); } catch (Exception e) { wrapInstantiationProblem(e, ctxt); return null; // never gets here