/** * 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)); }
/** * Method called when starting to build a bean instance. */ public PropertyValueBuffer startBuilding(JsonParser jp, DeserializationContext ctxt) { PropertyValueBuffer buffer = new PropertyValueBuffer(jp, ctxt, _propertyCount); if (_propertiesWithInjectables != null) { buffer.inject(_propertiesWithInjectables); } return buffer; }
/** * Accessor for checking number of deserialized properties. * * @since 1.7 */ public int getPropertyCount() { return _beanProperties.size(); }
public Object build(PropertyValueBuffer buffer) throws IOException { Object bean = _valueInstantiator.createFromObjectWith(buffer.getParameters(_defaultValues)); // Anything buffered? for (PropertyValue pv = buffer.buffered(); pv != null; pv = pv.next) { pv.assign(bean); } return bean; } }
@Override public void deserializeAndSet(JsonParser jp, DeserializationContext ctxt, Object instance) throws IOException, JsonProcessingException { set(instance, deserialize(jp, ctxt)); }
public void addStringCreator(AnnotatedWithParams creator) { _stringCreator = verifyNonDup(creator, _stringCreator, "String"); } public void addIntCreator(AnnotatedWithParams creator) {
/** * Accessor for traversing over all contained properties. */ public Iterator<SettableBeanProperty> allProperties() { return new IteratorImpl(_buckets); }
public boolean hasProperty(String propertyName) { return _beanProperties.find(propertyName) != null; }
/** * * @since 1.6 */ public Iterator<SettableBeanProperty> properties() { if (_beanProperties == null) { // since 1.7 throw new IllegalStateException("Can only call before BeanDeserializer has been resolved"); } return _beanProperties.allProperties(); }
protected void injectValues(DeserializationContext ctxt, Object bean) throws IOException, JsonProcessingException { for (ValueInjector injector : _injectables) { injector.inject(ctxt, bean); } }
public void bufferMapProperty(Object key, Object value) { _buffered = new PropertyValue.Map(_buffered, value, key); } }
@Override public CreatorProperty withValueDeserializer(JsonDeserializer<Object> deser) { return new CreatorProperty(this, deser); }
public void bufferAnyProperty(SettableAnyProperty prop, String propName, Object value) { _buffered = new PropertyValue.Any(_buffered, value, prop, propName); }
public ExternalTypeHandler start() { return new ExternalTypeHandler(this); }
public void bufferProperty(SettableBeanProperty prop, Object value) { _buffered = new PropertyValue.Regular(_buffered, value, prop); }
public void addLongCreator(AnnotatedWithParams creator) { _longCreator = verifyNonDup(creator, _longCreator, "long"); } public void addDoubleCreator(AnnotatedWithParams creator) {
public void addDoubleCreator(AnnotatedWithParams creator) { _doubleCreator = verifyNonDup(creator, _doubleCreator, "double"); } public void addBooleanCreator(AnnotatedWithParams creator) {
public void addIntCreator(AnnotatedWithParams creator) { _intCreator = verifyNonDup(creator, _intCreator, "int"); } public void addLongCreator(AnnotatedWithParams creator) {
public void addDelegatingCreator(AnnotatedWithParams creator) { _delegateCreator = verifyNonDup(creator, _delegateCreator, "delegate"); }
public void addBooleanCreator(AnnotatedWithParams creator) { _booleanCreator = verifyNonDup(creator, _booleanCreator, "boolean"); }