@Override public CreatorProperty withValueDeserializer(JsonDeserializer<Object> deser) { return new CreatorProperty(this, deser); }
@Override public void deserializeAndSet(JsonParser jp, DeserializationContext ctxt, Object instance) throws IOException, JsonProcessingException { set(instance, deserialize(jp, ctxt)); }
/** * Method to find value to inject, and inject it to this property. * * @since 1.9 */ public void inject(DeserializationContext context, Object beanInstance) throws IOException { set(beanInstance, findInjectableValue(context, beanInstance)); }
public void addPropertyCreator(AnnotatedWithParams creator, CreatorProperty[] properties) { _propertyBasedCreator = verifyNonDup(creator, _propertyBasedCreator, "property-based"); // [JACKSON-470] 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(); /* [Issue-13]: 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("Duplicate creator property \""+name+"\" (index "+old+" vs "+i+")"); } } } _propertyBasedArgs = properties; }
typeDeser = findTypeDeserializer(config, type, property); CreatorProperty prop = new CreatorProperty(name, type, typeDeser, beanDesc.getClassAnnotations(), param, index, injectableValueId); if (deser != null) { prop = prop.withValueDeserializer(deser);
/** * Method that can be called to locate value to be injected for this * property, if it is configured for this. * * @since 1.9 */ public Object findInjectableValue(DeserializationContext context, Object beanInstance) { if (_injectableValueId == null) { throw new IllegalStateException("Property '"+getName() +"' (type "+getClass().getName()+") has no injectable value id configured"); } return context.findInjectableValue(_injectableValueId, this, beanInstance); }
typeDeser = findTypeDeserializer(config, type, property); CreatorProperty prop = new CreatorProperty(name, type, typeDeser, beanDesc.getClassAnnotations(), param, index, injectableValueId); if (deser != null) { prop = prop.withValueDeserializer(deser);
public void addPropertyCreator(AnnotatedWithParams creator, CreatorProperty[] properties) { _propertyBasedCreator = verifyNonDup(creator, _propertyBasedCreator, "property-based"); // [JACKSON-470] 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(); /* [Issue-13]: 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("Duplicate creator property \""+name+"\" (index "+old+" vs "+i+")"); } } } _propertyBasedArgs = properties; }
/** * Method that can be called to locate value to be injected for this * property, if it is configured for this. * * @since 1.9 */ public Object findInjectableValue(DeserializationContext context, Object beanInstance) { if (_injectableValueId == null) { throw new IllegalStateException("Property '"+getName() +"' (type "+getClass().getName()+") has no injectable value id configured"); } return context.findInjectableValue(_injectableValueId, this, beanInstance); }
/** * Method to find value to inject, and inject it to this property. * * @since 1.9 */ public void inject(DeserializationContext context, Object beanInstance) throws IOException { set(beanInstance, findInjectableValue(context, beanInstance)); }
@Override public void deserializeAndSet(JsonParser jp, DeserializationContext ctxt, Object instance) throws IOException, JsonProcessingException { set(instance, deserialize(jp, ctxt)); }
typeDeser = findTypeDeserializer(config, type, property); CreatorProperty prop = new CreatorProperty(name, type, typeDeser, beanDesc.getClassAnnotations(), param, index, injectableValueId); if (deser != null) { prop = prop.withValueDeserializer(deser);
public void addPropertyCreator(AnnotatedWithParams creator, CreatorProperty[] properties) { _propertyBasedCreator = verifyNonDup(creator, _propertyBasedCreator, "property-based"); // [JACKSON-470] 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(); /* [Issue-13]: 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("Duplicate creator property \""+name+"\" (index "+old+" vs "+i+")"); } } } _propertyBasedArgs = properties; }
/** * Method that can be called to locate value to be injected for this * property, if it is configured for this. * * @since 1.9 */ public Object findInjectableValue(DeserializationContext context, Object beanInstance) { if (_injectableValueId == null) { throw new IllegalStateException("Property '"+getName() +"' (type "+getClass().getName()+") has no injectable value id configured"); } return context.findInjectableValue(_injectableValueId, this, beanInstance); }
@Override public CreatorProperty withValueDeserializer(JsonDeserializer<Object> deser) { return new CreatorProperty(this, deser); }
/** * Method to find value to inject, and inject it to this property. * * @since 1.9 */ public void inject(DeserializationContext context, Object beanInstance) throws IOException { set(beanInstance, findInjectableValue(context, beanInstance)); }
@Override public void deserializeAndSet(JsonParser jp, DeserializationContext ctxt, Object instance) throws IOException, JsonProcessingException { set(instance, deserialize(jp, ctxt)); }
typeDeser = findTypeDeserializer(config, type, property); CreatorProperty prop = new CreatorProperty(name, type, typeDeser, beanDesc.getClassAnnotations(), param, index, injectableValueId); if (deser != null) { prop = prop.withValueDeserializer(deser);
public void addPropertyCreator(AnnotatedWithParams creator, CreatorProperty[] properties) { _propertyBasedCreator = verifyNonDup(creator, _propertyBasedCreator, "property-based"); // [JACKSON-470] 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(); Integer old = names.put(name, Integer.valueOf(i)); if (old != null) { throw new IllegalArgumentException("Duplicate creator property \""+name+"\" (index "+old+" vs "+i+")"); } } } _propertyBasedArgs = properties; }
@Override public CreatorProperty withValueDeserializer(JsonDeserializer<Object> deser) { return new CreatorProperty(this, deser); }