@Override public int getCreatorIndex() { return _forward.getCreatorIndex(); }
@Override public int getCreatorIndex() { return delegate.getCreatorIndex(); }
/** * Returns {@code true} if the given property was seen in the JSON source by * this buffer. * * @since 2.8 */ public final boolean hasParameter(SettableBeanProperty prop) { if (_paramsSeenBig == null) { return ((_paramsSeen >> prop.getCreatorIndex()) & 1) == 1; } return _paramsSeenBig.get(prop.getCreatorIndex()); }
final int ix = prop.getCreatorIndex(); _creatorParameters[ix] = value; if (_paramsSeenBig == null) {
/** * A variation of {@link #getParameters(SettableBeanProperty[])} that * accepts a single property. Whereas the plural form eagerly fetches and * validates all properties, this method may be used (along with * {@link #hasParameter(SettableBeanProperty)}) to let applications only * fetch the properties defined in the JSON source itself, and to have some * other customized behavior for missing properties. * * @since 2.8 */ public Object getParameter(SettableBeanProperty prop) throws JsonMappingException { Object value; if (hasParameter(prop)) { value = _creatorParameters[prop.getCreatorIndex()]; } else { value = _creatorParameters[prop.getCreatorIndex()] = _findMissing(prop); } if (value == null && _context.isEnabled(DeserializationFeature.FAIL_ON_NULL_CREATOR_PROPERTIES)) { return _context.reportInputMismatch(prop, "Null value for creator property '%s' (index %d); `DeserializationFeature.FAIL_ON_NULL_FOR_CREATOR_PARAMETERS` enabled", prop.getName(), prop.getCreatorIndex()); } return value; }
_context.reportInputMismatch(prop.getType(), "Null value for creator property '%s' (index %d); `DeserializationFeature.FAIL_ON_NULL_FOR_CREATOR_PARAMETERS` enabled", prop.getName(), props[ix].getCreatorIndex());
protected Object _findMissing(SettableBeanProperty prop) throws JsonMappingException { // First: do we have injectable value? Object injectableValueId = prop.getInjectableValueId(); if (injectableValueId != null) { return _context.findInjectableValue(prop.getInjectableValueId(), prop, null); } // Second: required? if (prop.isRequired()) { _context.reportInputMismatch(prop, "Missing required creator property '%s' (index %d)", prop.getName(), prop.getCreatorIndex()); } if (_context.isEnabled(DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES)) { _context.reportInputMismatch(prop, "Missing creator property '%s' (index %d); `DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES` enabled", prop.getName(), prop.getCreatorIndex()); } // Third: default value JsonDeserializer<Object> deser = prop.getValueDeserializer(); return deser.getNullValue(_context); }
if (prop.getCreatorIndex() >= 0) { buffer.assignParameter(prop, values[i]); if ((typeProp != null) && (typeProp.getCreatorIndex() >= 0)) { if (prop.getCreatorIndex() < 0) { prop.set(bean, values[i]);
@Override public int getCreatorIndex() { return _forward.getCreatorIndex(); }
@Override public int getCreatorIndex() { return _forward.getCreatorIndex(); }
@Override public int getCreatorIndex() { return _delegate.getCreatorIndex(); }
@Override public int getCreatorIndex() { return delegate.getCreatorIndex(); }
/** * Returns {@code true} if the given property was seen in the JSON source by * this buffer. * * @since 2.8 */ public final boolean hasParameter(SettableBeanProperty prop) { if (_paramsSeenBig == null) { return ((_paramsSeen >> prop.getCreatorIndex()) & 1) == 1; } return _paramsSeenBig.get(prop.getCreatorIndex()); }
/** * Returns {@code true} if the given property was seen in the JSON source by * this buffer. * * @since 2.8 */ public final boolean hasParameter(SettableBeanProperty prop) { if (_paramsSeenBig == null) { return ((_paramsSeen >> prop.getCreatorIndex()) & 1) == 1; } return _paramsSeenBig.get(prop.getCreatorIndex()); }
final int ix = prop.getCreatorIndex(); _creatorParameters[ix] = value; if (_paramsSeenBig == null) {
final int ix = prop.getCreatorIndex(); _creatorParameters[ix] = value;
/** * A variation of {@link #getParameters(SettableBeanProperty[])} that * accepts a single property. Whereas the plural form eagerly fetches and * validates all properties, this method may be used (along with * {@link #hasParameter(SettableBeanProperty)}) to let applications only * fetch the properties defined in the JSON source itself, and to have some * other customized behavior for missing properties. * * @since 2.8 */ public Object getParameter(SettableBeanProperty prop) throws JsonMappingException { Object value; if (hasParameter(prop)) { value = _creatorParameters[prop.getCreatorIndex()]; } else { value = _creatorParameters[prop.getCreatorIndex()] = _findMissing(prop); } if (value == null && _context.isEnabled(DeserializationFeature.FAIL_ON_NULL_CREATOR_PROPERTIES)) { return _context.reportInputMismatch(prop, "Null value for creator property '%s' (index %d); `DeserializationFeature.FAIL_ON_NULL_FOR_CREATOR_PARAMETERS` enabled", prop.getName(), prop.getCreatorIndex()); } return value; }
/** * A variation of {@link #getParameters(SettableBeanProperty[])} that * accepts a single property. Whereas the plural form eagerly fetches and * validates all properties, this method may be used (along with * {@link #hasParameter(SettableBeanProperty)}) to let applications only * fetch the properties defined in the JSON source itself, and to have some * other customized behavior for missing properties. * * @since 2.8 */ public Object getParameter(SettableBeanProperty prop) throws JsonMappingException { Object value; if (hasParameter(prop)) { value = _creatorParameters[prop.getCreatorIndex()]; } else { value = _creatorParameters[prop.getCreatorIndex()] = _findMissing(prop); } if (value == null && _context.isEnabled(DeserializationFeature.FAIL_ON_NULL_CREATOR_PROPERTIES)) { throw _context.mappingException( "Null value for creator property '%s'; DeserializationFeature.FAIL_ON_NULL_FOR_CREATOR_PARAMETERS enabled", prop.getName(), prop.getCreatorIndex()); } return value; }
protected Object _findMissing(SettableBeanProperty prop) throws JsonMappingException { // First: do we have injectable value? Object injectableValueId = prop.getInjectableValueId(); if (injectableValueId != null) { return _context.findInjectableValue(prop.getInjectableValueId(), prop, null); } // Second: required? if (prop.isRequired()) { _context.reportInputMismatch(prop, "Missing required creator property '%s' (index %d)", prop.getName(), prop.getCreatorIndex()); } if (_context.isEnabled(DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES)) { _context.reportInputMismatch(prop, "Missing creator property '%s' (index %d); `DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES` enabled", prop.getName(), prop.getCreatorIndex()); } // Third: default value JsonDeserializer<Object> deser = prop.getValueDeserializer(); return deser.getNullValue(_context); }
protected Object _findMissing(SettableBeanProperty prop) throws JsonMappingException { // First: do we have injectable value? Object injectableValueId = prop.getInjectableValueId(); if (injectableValueId != null) { return _context.findInjectableValue(prop.getInjectableValueId(), prop, null); } // Second: required? if (prop.isRequired()) { _context.reportMappingException("Missing required creator property '%s' (index %d)", prop.getName(), prop.getCreatorIndex()); } if (_context.isEnabled(DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES)) { _context.reportMappingException("Missing creator property '%s' (index %d); DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES enabled", prop.getName(), prop.getCreatorIndex()); } // Third: default value JsonDeserializer<Object> deser = prop.getValueDeserializer(); return deser.getNullValue(_context); }