public PropertyBasedCreator(ValueInstantiator valueInstantiator) { _valueInstantiator = valueInstantiator; _properties = new HashMap<String, SettableBeanProperty>(); // [JACKSON-372]: primitive types need extra care Object[] defValues = null; SettableBeanProperty[] creatorProps = valueInstantiator.getFromObjectArguments(); 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); if (prop.getType().isPrimitive()) { if (defValues == null) { defValues = new Object[len]; } defValues[i] = ClassUtil.defaultValue(prop.getType().getRawClass()); } Object injectableValueId = prop.getInjectableValueId(); if (injectableValueId != null) { if (propertiesWithInjectables == null) { propertiesWithInjectables = new SettableBeanProperty[len]; } propertiesWithInjectables[i] = prop; } } _defaultValues = defValues; _propertiesWithInjectables = propertiesWithInjectables; }
public PropertyBasedCreator(ValueInstantiator valueInstantiator) { _valueInstantiator = valueInstantiator; _properties = new HashMap<String, SettableBeanProperty>(); // [JACKSON-372]: primitive types need extra care Object[] defValues = null; SettableBeanProperty[] creatorProps = valueInstantiator.getFromObjectArguments(); 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); if (prop.getType().isPrimitive()) { if (defValues == null) { defValues = new Object[len]; } defValues[i] = ClassUtil.defaultValue(prop.getType().getRawClass()); } Object injectableValueId = prop.getInjectableValueId(); if (injectableValueId != null) { if (propertiesWithInjectables == null) { propertiesWithInjectables = new SettableBeanProperty[len]; } propertiesWithInjectables[i] = prop; } } _defaultValues = defValues; _propertiesWithInjectables = propertiesWithInjectables; }
defValues = new Object[len]; defValues[i] = ClassUtil.defaultValue(prop.getType().getRawClass());
public PropertyBasedCreator(ValueInstantiator valueInstantiator) { _valueInstantiator = valueInstantiator; _properties = new HashMap<String, SettableBeanProperty>(); // [JACKSON-372]: primitive types need extra care Object[] defValues = null; SettableBeanProperty[] creatorProps = valueInstantiator.getFromObjectArguments(); 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); if (prop.getType().isPrimitive()) { if (defValues == null) { defValues = new Object[len]; } defValues[i] = ClassUtil.defaultValue(prop.getType().getRawClass()); } Object injectableValueId = prop.getInjectableValueId(); if (injectableValueId != null) { if (propertiesWithInjectables == null) { propertiesWithInjectables = new SettableBeanProperty[len]; } propertiesWithInjectables[i] = prop; } } _defaultValues = defValues; _propertiesWithInjectables = propertiesWithInjectables; }
public PropertyBasedCreator(ValueInstantiator valueInstantiator) { _valueInstantiator = valueInstantiator; _properties = new HashMap<String, SettableBeanProperty>(); // [JACKSON-372]: primitive types need extra care Object[] defValues = null; SettableBeanProperty[] creatorProps = valueInstantiator.getFromObjectArguments(); SettableBeanProperty[] propertiesWithInjectables = null; for (int i = 0, len = creatorProps.length; i < len; ++i) { SettableBeanProperty prop = creatorProps[i]; _properties.put(prop.getName(), prop); if (prop.getType().isPrimitive()) { if (defValues == null) { defValues = new Object[len]; } defValues[i] = ClassUtil.defaultValue(prop.getType().getRawClass()); } Object injectableValueId = prop.getInjectableValueId(); if (injectableValueId != null) { if (propertiesWithInjectables == null) { propertiesWithInjectables = new SettableBeanProperty[len]; } propertiesWithInjectables[i] = prop; } } _defaultValues = defValues; _propertiesWithInjectables = propertiesWithInjectables; }