/** * Method that delegates to * {@link #createFromObjectWith(DeserializationContext, Object[])} by * default, but can be overridden if the application should have customized * behavior with respect to missing properties. *<p> * The default implementation of this method uses * {@link PropertyValueBuffer#getParameters(SettableBeanProperty[])} to read * and validate all properties in bulk, possibly substituting defaults for * missing properties or throwing exceptions for missing properties. An * overridden implementation of this method could, for example, use * {@link PropertyValueBuffer#hasParameter(SettableBeanProperty)} and * {@link PropertyValueBuffer#getParameter(SettableBeanProperty)} to safely * read the present properties only, and to have some other behavior for the * missing properties. * * @since 2.8 */ public Object createFromObjectWith(DeserializationContext ctxt, SettableBeanProperty[] props, PropertyValueBuffer buffer) throws IOException { return createFromObjectWith(ctxt, buffer.getParameters(props)); }
@Override public Object createFromObjectWith(DeserializationContext ctxt, Object[] args) throws IOException { if (_withArgsCreator == null) { // sanity-check; caller should check return super.createFromObjectWith(ctxt, args); } try { return _withArgsCreator.call(args); } catch (Exception e) { // 19-Apr-2017, tatu: Let's not catch Errors, just Exceptions return ctxt.handleInstantiationProblem(_valueClass, args, rewrapCtorProblem(ctxt, e)); } }
public Object build(DeserializationContext ctxt, PropertyValueBuffer buffer) throws IOException { Object bean = _valueInstantiator.createFromObjectWith(ctxt, _allProperties, buffer); // returning null isn't quite legal, but let's let caller deal with that if (bean != null) { // Object Id to handle? bean = buffer.handleIdValue(ctxt, bean); // Anything buffered? for (PropertyValue pv = buffer.buffered(); pv != null; pv = pv.next) { pv.assign(bean); } } return bean; }
/** * Method that delegates to * {@link #createFromObjectWith(DeserializationContext, Object[])} by * default, but can be overridden if the application should have customized * behavior with respect to missing properties. *<p> * The default implementation of this method uses * {@link PropertyValueBuffer#getParameters(SettableBeanProperty[])} to read * and validate all properties in bulk, possibly substituting defaults for * missing properties or throwing exceptions for missing properties. An * overridden implementation of this method could, for example, use * {@link PropertyValueBuffer#hasParameter(SettableBeanProperty)} and * {@link PropertyValueBuffer#getParameter(SettableBeanProperty)} to safely * read the present properties only, and to have some other behavior for the * missing properties. * * @since 2.8 */ public Object createFromObjectWith(DeserializationContext ctxt, SettableBeanProperty[] props, PropertyValueBuffer buffer) throws IOException { return createFromObjectWith(ctxt, buffer.getParameters(props)); }
/** * Method that delegates to * {@link #createFromObjectWith(DeserializationContext, Object[])} by * default, but can be overridden if the application should have customized * behavior with respect to missing properties. *<p> * The default implementation of this method uses * {@link PropertyValueBuffer#getParameters(SettableBeanProperty[])} to read * and validate all properties in bulk, possibly substituting defaults for * missing properties or throwing exceptions for missing properties. An * overridden implementation of this method could, for example, use * {@link PropertyValueBuffer#hasParameter(SettableBeanProperty)} and * {@link PropertyValueBuffer#getParameter(SettableBeanProperty)} to safely * read the present properties only, and to have some other behavior for the * missing properties. * * @since 2.8 */ public Object createFromObjectWith(DeserializationContext ctxt, SettableBeanProperty[] props, PropertyValueBuffer buffer) throws IOException { return createFromObjectWith(ctxt, buffer.getParameters(props)); }
public Object build(DeserializationContext ctxt, PropertyValueBuffer buffer) throws IOException { Object bean = _valueInstantiator.createFromObjectWith(ctxt, buffer.getParameters(_defaultValues)); // Anything buffered? for (PropertyValue pv = buffer.buffered(); pv != null; pv = pv.next) { pv.assign(bean); } return bean; } }
@Override public Object createFromObjectWith(DeserializationContext ctxt, Object[] args) throws IOException { if (_withArgsCreator == null) { // sanity-check; caller should check return super.createFromObjectWith(ctxt, args); } try { return _withArgsCreator.call(args); } catch (Exception e) { // 19-Apr-2017, tatu: Let's not catch Errors, just Exceptions return ctxt.handleInstantiationProblem(_valueClass, args, rewrapCtorProblem(ctxt, e)); } }
public Object build(DeserializationContext ctxt, PropertyValueBuffer buffer) throws IOException { Object bean = _valueInstantiator.createFromObjectWith(ctxt, _allProperties, buffer); // returning null isn't quite legal, but let's let caller deal with that if (bean != null) { // Object Id to handle? bean = buffer.handleIdValue(ctxt, bean); // Anything buffered? for (PropertyValue pv = buffer.buffered(); pv != null; pv = pv.next) { pv.assign(bean); } } return bean; }
public Object build(DeserializationContext ctxt, PropertyValueBuffer buffer) throws IOException { Object bean = _valueInstantiator.createFromObjectWith(ctxt, _allProperties, buffer); // returning null isn't quite legal, but let's let caller deal with that if (bean != null) { // Object Id to handle? bean = buffer.handleIdValue(ctxt, bean); // Anything buffered? for (PropertyValue pv = buffer.buffered(); pv != null; pv = pv.next) { pv.assign(bean); } } return bean; }
public Object build(DeserializationContext ctxt, PropertyValueBuffer buffer) throws IOException { Object bean = _valueInstantiator.createFromObjectWith(ctxt, buffer.getParameters(_defaultValues)); // Object Id to handle? bean = buffer.handleIdValue(ctxt, bean); // Anything buffered? for (PropertyValue pv = buffer.buffered(); pv != null; pv = pv.next) { pv.assign(bean); } return bean; } }
public Object build(DeserializationContext ctxt, PropertyValueBuffer buffer) throws IOException { Object bean = _valueInstantiator.createFromObjectWith(ctxt, buffer.getParameters(_defaultValues)); // Object Id to handle? bean = buffer.handleIdValue(ctxt, bean); // Anything buffered? for (PropertyValue pv = buffer.buffered(); pv != null; pv = pv.next) { pv.assign(bean); } return bean; } }
public Object build(DeserializationContext ctxt, PropertyValueBuffer buffer) throws IOException { Object bean = _valueInstantiator.createFromObjectWith(ctxt, buffer.getParameters(_defaultValues)); // Object Id to handle? bean = buffer.handleIdValue(ctxt, bean); // Anything buffered? for (PropertyValue pv = buffer.buffered(); pv != null; pv = pv.next) { pv.assign(bean); } return bean; } }
@Override public Object createFromObjectWith(DeserializationContext ctxt, Object[] args) throws IOException { if (_withArgsCreator == null) { // sanity-check; caller should check return super.createFromObjectWith(ctxt, args); } try { return _withArgsCreator.call(args); } catch (Throwable t) { return ctxt.handleInstantiationProblem(_withArgsCreator.getDeclaringClass(), args, rewrapCtorProblem(ctxt, t)); } }