@Override public Object getInjectableValueId() { return delegate.getInjectableValueId(); }
public void addPropertyCreator(AnnotatedWithParams creator, boolean explicit, SettableBeanProperty[] properties) { if (verifyNonDup(creator, C_PROPS, explicit)) { // Better ensure we have no duplicate names either... if (properties.length > 1) { HashMap<String, Integer> names = new HashMap<String, Integer>(); for (int i = 0, len = properties.length; i < len; ++i) { String name = properties[i].getName(); // Need to consider Injectables, which may not have // a name at all, and need to be skipped if (name.isEmpty() && (properties[i].getInjectableValueId() != null)) { continue; } Integer old = names.put(name, Integer.valueOf(i)); if (old != null) { throw new IllegalArgumentException(String.format( "Duplicate creator property \"%s\" (index %s vs %d) for type %s ", name, old, i, ClassUtil.nameOf(_beanDesc.getBeanClass()))); } } } _propertyBasedArgs = properties; } }
args[i] = delegate; } else { // nope, injectable: args[i] = ctxt.findInjectableValue(prop.getInjectableValueId(), prop, null);
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); }
@Override public Object getInjectableValueId() { return delegate.getInjectableValueId(); }
public void inject(SettableBeanProperty[] injectableProperties) { for (int i = 0, len = injectableProperties.length; i < len; ++i) { SettableBeanProperty prop = injectableProperties[i]; if (prop != null) { // null since there is no POJO yet _creatorParameters[i] = _context.findInjectableValue(prop.getInjectableValueId(), prop, null); } } }
public void inject(SettableBeanProperty[] injectableProperties) { for (int i = 0, len = injectableProperties.length; i < len; ++i) { SettableBeanProperty prop = injectableProperties[i]; if (prop != null) { // null since there is no POJO yet _creatorParameters[i] = _context.findInjectableValue(prop.getInjectableValueId(), prop, null); } } }
public void inject(SettableBeanProperty[] injectableProperties) { for (int i = 0, len = injectableProperties.length; i < len; ++i) { SettableBeanProperty prop = injectableProperties[i]; if (prop != null) { // null since there is no POJO yet _creatorParameters[i] = _context.findInjectableValue(prop.getInjectableValueId(), prop, null); } } }
public void inject(SettableBeanProperty[] injectableProperties) { for (int i = 0, len = injectableProperties.length; i < len; ++i) { SettableBeanProperty prop = injectableProperties[i]; if (prop != null) { // null since there is no POJO yet _creatorParameters[i] = _context.findInjectableValue(prop.getInjectableValueId(), prop, null); } } }
protected PropertyBasedCreator(ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps, Object[] defaultValues) { _valueInstantiator = valueInstantiator; _properties = new HashMap<String, SettableBeanProperty>(); SettableBeanProperty[] propertiesWithInjectables = null; final int len = creatorProps.length; _propertyCount = len; for (int i = 0; i < len; ++i) { SettableBeanProperty prop = creatorProps[i]; _properties.put(prop.getName(), prop); Object injectableValueId = prop.getInjectableValueId(); if (injectableValueId != null) { if (propertiesWithInjectables == null) { propertiesWithInjectables = new SettableBeanProperty[len]; } propertiesWithInjectables[i] = prop; } } _defaultValues = defaultValues; _propertiesWithInjectables = propertiesWithInjectables; }
protected PropertyBasedCreator(ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps, Object[] defaultValues) { _valueInstantiator = valueInstantiator; _properties = new HashMap<String, SettableBeanProperty>(); SettableBeanProperty[] propertiesWithInjectables = null; final int len = creatorProps.length; _propertyCount = len; for (int i = 0; i < len; ++i) { SettableBeanProperty prop = creatorProps[i]; _properties.put(prop.getName(), prop); Object injectableValueId = prop.getInjectableValueId(); if (injectableValueId != null) { if (propertiesWithInjectables == null) { propertiesWithInjectables = new SettableBeanProperty[len]; } propertiesWithInjectables[i] = prop; } } _defaultValues = defaultValues; _propertiesWithInjectables = propertiesWithInjectables; }
protected PropertyBasedCreator(ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps, Object[] defaultValues) { _valueInstantiator = valueInstantiator; _properties = new HashMap<String, SettableBeanProperty>(); SettableBeanProperty[] propertiesWithInjectables = null; final int len = creatorProps.length; _propertyCount = len; for (int i = 0; i < len; ++i) { SettableBeanProperty prop = creatorProps[i]; _properties.put(prop.getName(), prop); Object injectableValueId = prop.getInjectableValueId(); if (injectableValueId != null) { if (propertiesWithInjectables == null) { propertiesWithInjectables = new SettableBeanProperty[len]; } propertiesWithInjectables[i] = prop; } } _defaultValues = defaultValues; _propertiesWithInjectables = propertiesWithInjectables; }
protected PropertyBasedCreator(ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps, Object[] defaultValues) { _valueInstantiator = valueInstantiator; _properties = new HashMap<String, SettableBeanProperty>(); SettableBeanProperty[] propertiesWithInjectables = null; final int len = creatorProps.length; _propertyCount = len; for (int i = 0; i < len; ++i) { SettableBeanProperty prop = creatorProps[i]; _properties.put(prop.getName(), prop); Object injectableValueId = prop.getInjectableValueId(); if (injectableValueId != null) { if (propertiesWithInjectables == null) { propertiesWithInjectables = new SettableBeanProperty[len]; } propertiesWithInjectables[i] = prop; } } _defaultValues = defaultValues; _propertiesWithInjectables = propertiesWithInjectables; }
public void addPropertyCreator(AnnotatedWithParams creator, boolean explicit, SettableBeanProperty[] properties) { if (verifyNonDup(creator, C_PROPS, explicit)) { // Better ensure we have no duplicate names either... if (properties.length > 1) { HashMap<String, Integer> names = new HashMap<String, Integer>(); for (int i = 0, len = properties.length; i < len; ++i) { String name = properties[i].getName(); // Need to consider Injectables, which may not have // a name at all, and need to be skipped if (name.length() == 0 && properties[i].getInjectableValueId() != null) { continue; } Integer old = names.put(name, Integer.valueOf(i)); if (old != null) { throw new IllegalArgumentException(String.format( "Duplicate creator property \"%s\" (index %s vs %d)", name, old, i)); } } } _propertyBasedArgs = properties; } }
public void addPropertyCreator(AnnotatedWithParams creator, boolean explicit, SettableBeanProperty[] properties) { if (verifyNonDup(creator, C_PROPS, explicit)) { // Better ensure we have no duplicate names either... if (properties.length > 1) { HashMap<String, Integer> names = new HashMap<String, Integer>(); for (int i = 0, len = properties.length; i < len; ++i) { String name = properties[i].getName(); // Need to consider Injectables, which may not have // a name at all, and need to be skipped if (name.isEmpty() && (properties[i].getInjectableValueId() != null)) { continue; } Integer old = names.put(name, Integer.valueOf(i)); if (old != null) { throw new IllegalArgumentException(String.format( "Duplicate creator property \"%s\" (index %s vs %d) for type %s ", name, old, i, ClassUtil.nameOf(_beanDesc.getBeanClass()))); } } } _propertyBasedArgs = properties; } }
args[i] = delegate; } else { // nope, injectable: args[i] = ctxt.findInjectableValue(prop.getInjectableValueId(), prop, null);
args[i] = delegate; } else { // nope, injectable: args[i] = ctxt.findInjectableValue(prop.getInjectableValueId(), prop, null);
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); }
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); }