package com.fasterxml.jackson.databind.deser.impl;
import java.io.IOException;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.introspect.AnnotatedMember;
public class ValueInjector
extends BeanProperty.Std
{
private static final long serialVersionUID = 1L;
protected final Object _valueId;
public ValueInjector(PropertyName propName, JavaType type,
AnnotatedMember mutator, Object valueId)
{
super(propName, type, null, mutator, PropertyMetadata.STD_OPTIONAL);
_valueId = valueId;
}
@Deprecated
public ValueInjector(PropertyName propName, JavaType type,
com.fasterxml.jackson.databind.util.Annotations contextAnnotations,
AnnotatedMember mutator, Object valueId)
{
this(propName, type, mutator, valueId);
}
public Object findValue(DeserializationContext context, Object beanInstance)
throws JsonMappingException
{
return context.findInjectableValue(_valueId, this, beanInstance);
}
public void inject(DeserializationContext context, Object beanInstance)
throws IOException
{
_member.setValue(beanInstance, findValue(context, beanInstance));
}
}