@Override public SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser) { return _with(delegate.withValueDeserializer(deser)); }
public UnwrappedPropertyHandler renameAll(NameTransformer transformer) { ArrayList<SettableBeanProperty> newProps = new ArrayList<SettableBeanProperty>(_properties.size()); for (SettableBeanProperty prop : _properties) { String newName = transformer.transform(prop.getName()); prop = prop.withSimpleName(newName); JsonDeserializer<?> deser = prop.getValueDeserializer(); if (deser != null) { @SuppressWarnings("unchecked") JsonDeserializer<Object> newDeser = (JsonDeserializer<Object>) deser.unwrappingDeserializer(transformer); if (newDeser != deser) { prop = prop.withValueDeserializer(newDeser); } } newProps.add(prop); } return new UnwrappedPropertyHandler(newProps); }
/** * Factory method used for building actual instances to be used with types * OTHER than POJOs. * resolves deserializers and checks for "null values". * * @since 2.9 */ public static PropertyBasedCreator construct(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] srcCreatorProps, boolean caseInsensitive) throws JsonMappingException { final int len = srcCreatorProps.length; SettableBeanProperty[] creatorProps = new SettableBeanProperty[len]; for (int i = 0; i < len; ++i) { SettableBeanProperty prop = srcCreatorProps[i]; if (!prop.hasValueDeserializer()) { prop = prop.withValueDeserializer(ctxt.findContextualValueDeserializer(prop.getType(), prop)); } creatorProps[i] = prop; } return new PropertyBasedCreator(ctxt, valueInstantiator, creatorProps, caseInsensitive, false); }
protected SettableBeanProperty _rename(SettableBeanProperty prop, NameTransformer xf) { if (prop == null) { return prop; } String newName = xf.transform(prop.getName()); prop = prop.withSimpleName(newName); JsonDeserializer<?> deser = prop.getValueDeserializer(); if (deser != null) { @SuppressWarnings("unchecked") JsonDeserializer<Object> newDeser = (JsonDeserializer<Object>) deser.unwrappingDeserializer(xf); if (newDeser != deser) { prop = prop.withValueDeserializer(newDeser); } } return prop; }
/** * Factory method used for building actual instances to be used with POJOS: * resolves deserializers, checks for "null values". * * @since 2.9 */ public static PropertyBasedCreator construct(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] srcCreatorProps, BeanPropertyMap allProperties) throws JsonMappingException { final int len = srcCreatorProps.length; SettableBeanProperty[] creatorProps = new SettableBeanProperty[len]; for (int i = 0; i < len; ++i) { SettableBeanProperty prop = srcCreatorProps[i]; if (!prop.hasValueDeserializer()) { prop = prop.withValueDeserializer(ctxt.findContextualValueDeserializer(prop.getType(), prop)); } creatorProps[i] = prop; } return new PropertyBasedCreator(ctxt, valueInstantiator, creatorProps, allProperties.isCaseInsensitive(), allProperties.hasAliases()); }
/** * Method that will construct a regular bean property setter using * the given setter method. */ protected SettableBeanProperty constructSetterlessProperty(DeserializationContext ctxt, BeanDescription beanDesc, BeanPropertyDefinition propDef) throws JsonMappingException { final AnnotatedMethod getter = propDef.getGetter(); JavaType type = resolveMemberAndTypeAnnotations(ctxt, getter, getter.getType()); TypeDeserializer typeDeser = type.getTypeHandler(); SettableBeanProperty prop = new SetterlessProperty(propDef, type, typeDeser, beanDesc.getClassAnnotations(), getter); JsonDeserializer<?> deser = findDeserializerFromAnnotation(ctxt, getter); if (deser == null) { deser = type.getValueHandler(); } if (deser != null) { deser = ctxt.handlePrimaryContextualization(deser, prop, type); prop = prop.withValueDeserializer(deser); } return prop; }
deser = ctxt.findNonContextualValueDeserializer(prop.getType()); SettableBeanProperty newProp = prop.withValueDeserializer(deser); _replaceProperty(_beanProperties, creatorProps, prop, newProp); JsonDeserializer<?> deser = prop.getValueDeserializer(); deser = ctxt.handlePrimaryContextualization(deser, prop, prop.getType()); prop = prop.withValueDeserializer(deser); JsonDeserializer<Object> unwrapping = orig.unwrappingDeserializer(xform); if (unwrapping != orig && unwrapping != null) { prop = prop.withValueDeserializer(unwrapping); if (unwrapped == null) { unwrapped = new UnwrappedPropertyHandler();
prop = prop.withValueDeserializer(deser);
prop = prop.withValueDeserializer(deser);
SettableBeanProperty settableBeanProperty = beanPropertyIterator.next(); if (PropertyName.equals(settableBeanProperty.getName())) { SettableBeanProperty newSettableBeanProperty = settableBeanProperty.withValueDeserializer(new CustomDeserializer()); builder.addOrReplaceProperty(newSettableBeanProperty, true); break;
@Override public BeanDeserializerBuilder updateBuilder(DeserializationConfig config, BeanDescription beanDesc, BeanDeserializerBuilder builder) { Iterator<SettableBeanProperty> properties = builder.getProperties(); entities.getPersistentEntity(beanDesc.getBeanClass()).ifPresent(entity -> { while (properties.hasNext()) { SettableBeanProperty property = properties.next(); PersistentProperty<?> persistentProperty = entity.getPersistentProperty(property.getName()); if (persistentProperty == null) { continue; } if (associationLinks.isLookupType(persistentProperty)) { RepositoryInvokingDeserializer repositoryInvokingDeserializer = new RepositoryInvokingDeserializer(factory, persistentProperty); JsonDeserializer<?> deserializer = wrapIfCollection(persistentProperty, repositoryInvokingDeserializer, config); builder.addOrReplaceProperty(property.withValueDeserializer(deserializer), false); continue; } if (!associationLinks.isLinkableAssociation(persistentProperty)) { continue; } UriStringDeserializer uriStringDeserializer = new UriStringDeserializer(persistentProperty, converter); JsonDeserializer<?> deserializer = wrapIfCollection(persistentProperty, uriStringDeserializer, config); builder.addOrReplaceProperty(property.withValueDeserializer(deserializer), false); } }); return builder; }
protected InnerClassProperty(InnerClassProperty src, JsonDeserializer<?> deser) { super(src, deser); _delegate = src._delegate.withValueDeserializer(deser); _creator = src._creator; }
protected InnerClassProperty(InnerClassProperty src, JsonDeserializer<?> deser) { super(src, deser); _delegate = src._delegate.withValueDeserializer(deser); _creator = src._creator; }
protected InnerClassProperty(InnerClassProperty src, JsonDeserializer<?> deser) { super(src, deser); _delegate = src._delegate.withValueDeserializer(deser); _creator = src._creator; }
protected InnerClassProperty(InnerClassProperty src, JsonDeserializer<?> deser) { super(src, deser); _delegate = src._delegate.withValueDeserializer(deser); _creator = src._creator; }
protected InnerClassProperty(InnerClassProperty src, JsonDeserializer<?> deser) { super(src, deser); _delegate = src._delegate.withValueDeserializer(deser); _creator = src._creator; }
@Override public SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser) { return new ErrorReportingSettableBeanProperty( delegate.withValueDeserializer(deser), jsonErrorConsumer); }
@Override public SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser) { return _with(delegate.withValueDeserializer(deser)); }
public void assignDeserializer(SettableBeanProperty prop, JsonDeserializer<Object> deser) { prop = prop.withValueDeserializer(deser); _properties.put(prop.getName(), prop); }
@Override public final SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser) { SettableBeanProperty newDelegate = delegate.withValueDeserializer(deser); if (newDelegate == delegate) { return this; } if (!_isDefaultDeserializer(deser)) { return newDelegate; } return withDelegate(newDelegate); }