/** * @deprecated Since 2.7 call either {@link #unwrapAndWrapException} or * {@link #wrapAsJsonMappingException} */ @Deprecated // since 2.7 protected JsonMappingException wrapException(Throwable t) { // 05-Nov-2015, tatu: This used to always unwrap the whole exception, but now only // does so if and until `JsonMappingException` is found. for (Throwable curr = t; curr != null; curr = curr.getCause()) { if (curr instanceof JsonMappingException) { return (JsonMappingException) curr; } } return new JsonMappingException(null, "Instantiation of "+getValueTypeDesc()+" value failed: "+ClassUtil.exceptionMessage(t), t); }
throw new IllegalStateException("No delegate constructor for "+getValueTypeDesc());
protected JsonMappingException wrapException(Throwable t) { while (t.getCause() != null) { t = t.getCause(); } if (t instanceof JsonMappingException) { return (JsonMappingException) t; } return new JsonMappingException("Instantiation of "+getValueTypeDesc()+" value failed: "+t.getMessage(), t); } }
protected JsonMappingException wrapException(Throwable t) { while (t.getCause() != null) { t = t.getCause(); } if (t instanceof JsonMappingException) { return (JsonMappingException) t; } return new JsonMappingException("Instantiation of "+getValueTypeDesc()+" value failed: "+t.getMessage(), t); } }
protected JsonMappingException wrapException(Throwable t) { while (t.getCause() != null) { t = t.getCause(); } if (t instanceof JsonMappingException) { return (JsonMappingException) t; } return new JsonMappingException("Instantiation of "+getValueTypeDesc()+" value failed: "+t.getMessage(), t); } }
protected JsonMappingException wrapException(Throwable t) { while (t.getCause() != null) { t = t.getCause(); } if (t instanceof JsonMappingException) { return (JsonMappingException) t; } return new JsonMappingException("Instantiation of "+getValueTypeDesc()+" value failed: "+t.getMessage(), t); } }
@Override public Object createUsingDefault(DeserializationContext ctxt) throws IOException { if (_defaultCreator == null) { // sanity-check; caller should check throw new IllegalStateException("No default constructor for "+getValueTypeDesc()); } try { return _defaultCreator.call(); } catch (ExceptionInInitializerError e) { throw wrapException(e); } catch (Exception e) { throw wrapException(e); } }
@Override public Object createUsingDefault(DeserializationContext ctxt) throws IOException { if (_defaultCreator == null) { // sanity-check; caller should check throw new IllegalStateException("No default constructor for "+getValueTypeDesc()); } try { return _defaultCreator.call(); } catch (ExceptionInInitializerError e) { throw wrapException(e); } catch (Exception e) { throw wrapException(e); } }
@Override public Object createFromObjectWith(DeserializationContext ctxt, Object[] args) throws IOException { if (_withArgsCreator == null) { // sanity-check; caller should check throw new IllegalStateException("No with-args constructor for "+getValueTypeDesc()); } try { return _withArgsCreator.call(args); } catch (ExceptionInInitializerError e) { throw wrapException(e); } catch (Exception e) { throw wrapException(e); } }
@Override public Object createFromObjectWith(DeserializationContext ctxt, Object[] args) throws IOException { if (_withArgsCreator == null) { // sanity-check; caller should check throw new IllegalStateException("No with-args constructor for "+getValueTypeDesc()); } try { return _withArgsCreator.call(args); } catch (ExceptionInInitializerError e) { throw wrapException(e); } catch (Exception e) { throw wrapException(e); } }
@Override public Object createFromObjectWith(DeserializationContext ctxt, Object[] args) throws IOException, JsonProcessingException { if (_withArgsCreator == null) { // sanity-check; caller should check throw new IllegalStateException("No with-args constructor for "+getValueTypeDesc()); } try { return _withArgsCreator.call(args); } catch (ExceptionInInitializerError e) { throw wrapException(e); } catch (Exception e) { throw wrapException(e); } }
@Override public Object createUsingDefault(DeserializationContext ctxt) throws IOException, JsonProcessingException { if (_defaultCreator == null) { // sanity-check; caller should check throw new IllegalStateException("No default constructor for "+getValueTypeDesc()); } try { return _defaultCreator.call(); } catch (ExceptionInInitializerError e) { throw wrapException(e); } catch (Exception e) { throw wrapException(e); } }
@Override public Object createUsingDefault(DeserializationContext ctxt) throws IOException, JsonProcessingException { if (_defaultCreator == null) { // sanity-check; caller should check throw new IllegalStateException("No default constructor for "+getValueTypeDesc()); } try { return _defaultCreator.call(); } catch (ExceptionInInitializerError e) { throw wrapException(e); } catch (Exception e) { throw wrapException(e); } }
@Override public Object createFromDouble(DeserializationContext ctxt, double value) throws IOException { try { if (_fromDoubleCreator != null) { return _fromDoubleCreator.call1(Double.valueOf(value)); } } catch (Exception e) { throw wrapException(e); } catch (ExceptionInInitializerError e) { throw wrapException(e); } throw ctxt.mappingException("Can not instantiate value of type "+getValueTypeDesc() +" from Floating-point number ("+value+"); no one-double/Double-arg constructor/factory method"); }
@Override public Object createFromLong(DeserializationContext ctxt, long value) throws IOException { try { if (_fromLongCreator != null) { return _fromLongCreator.call1(Long.valueOf(value)); } } catch (Exception e) { throw wrapException(e); } catch (ExceptionInInitializerError e) { throw wrapException(e); } throw ctxt.mappingException("Can not instantiate value of type "+getValueTypeDesc() +" from Long integral number ("+value+"); no single-long-arg constructor/factory method"); }
@Override public Object createFromDouble(DeserializationContext ctxt, double value) throws IOException { try { if (_fromDoubleCreator != null) { return _fromDoubleCreator.call1(Double.valueOf(value)); } } catch (Exception e) { throw wrapException(e); } catch (ExceptionInInitializerError e) { throw wrapException(e); } throw ctxt.mappingException("Can not instantiate value of type "+getValueTypeDesc() +" from Floating-point number ("+value+"); no one-double/Double-arg constructor/factory method"); }
@Override public Object createFromBoolean(DeserializationContext ctxt, boolean value) throws IOException { try { if (_fromBooleanCreator != null) { return _fromBooleanCreator.call1(Boolean.valueOf(value)); } } catch (Exception e) { throw wrapException(e); } catch (ExceptionInInitializerError e) { throw wrapException(e); } throw ctxt.mappingException("Can not instantiate value of type "+getValueTypeDesc() +" from Boolean value ("+value+"); no single-boolean/Boolean-arg constructor/factory method"); }
@Override public Object createFromLong(DeserializationContext ctxt, long value) throws IOException { try { if (_fromLongCreator != null) { return _fromLongCreator.call1(Long.valueOf(value)); } } catch (Exception e) { throw wrapException(e); } catch (ExceptionInInitializerError e) { throw wrapException(e); } throw ctxt.mappingException("Can not instantiate value of type "+getValueTypeDesc() +" from Long integral number ("+value+"); no single-long-arg constructor/factory method"); }
@Override public Object createFromBoolean(DeserializationContext ctxt, boolean value) throws IOException, JsonProcessingException { try { if (_fromBooleanCreator != null) { return _fromBooleanCreator.call1(Boolean.valueOf(value)); } } catch (Exception e) { throw wrapException(e); } catch (ExceptionInInitializerError e) { throw wrapException(e); } throw new JsonMappingException("Can not instantiate value of type "+getValueTypeDesc() +" from JSON boolean value; no single-boolean/Boolean-arg constructor/factory method"); }
@Override public Object createFromLong(DeserializationContext ctxt, long value) throws IOException, JsonProcessingException { try { if (_fromLongCreator != null) { return _fromLongCreator.call1(Long.valueOf(value)); } } catch (Exception e) { throw wrapException(e); } catch (ExceptionInInitializerError e) { throw wrapException(e); } throw new JsonMappingException("Can not instantiate value of type "+getValueTypeDesc() +" from Long integral number; no single-long-arg constructor/factory method"); }