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); }
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; }
if (xform != null) { JsonDeserializer<Object> orig = prop.getValueDeserializer(); JsonDeserializer<Object> unwrapping = orig.unwrappingDeserializer(xform); if (unwrapping != orig && unwrapping != null) { prop = prop.withValueDeserializer(unwrapping);
public void renameAll(NameTransformer transformer) { ArrayList<SettableBeanProperty> oldProps = new ArrayList<SettableBeanProperty>(_properties); Iterator<SettableBeanProperty> it = oldProps.iterator(); _properties.clear(); while (it.hasNext()) { SettableBeanProperty prop = it.next(); String newName = transformer.transform(prop.getName()); prop = prop.withName(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); } } _properties.add(prop); } }
public void renameAll(NameTransformer transformer) { ArrayList<SettableBeanProperty> oldProps = new ArrayList<SettableBeanProperty>(_properties); Iterator<SettableBeanProperty> it = oldProps.iterator(); _properties.clear(); while (it.hasNext()) { SettableBeanProperty prop = it.next(); String newName = transformer.transform(prop.getName()); prop = prop.withName(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); } } _properties.add(prop); } }
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); }
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); }
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); }
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 for constructing a map where all entries use given * prefix */ public BeanPropertyMap renameAll(NameTransformer transformer) { if (transformer == null || (transformer == NameTransformer.NOP)) { return this; } Iterator<SettableBeanProperty> it = iterator(); ArrayList<SettableBeanProperty> newProps = new ArrayList<SettableBeanProperty>(); while (it.hasNext()) { SettableBeanProperty prop = it.next(); 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); } // should we try to re-index? Ordering probably changed but called probably doesn't want changes... return new BeanPropertyMap(newProps, _caseInsensitive); }
/** * Factory method for constructing a map where all entries use given * prefix */ public BeanPropertyMap renameAll(NameTransformer transformer) { if (transformer == null || (transformer == NameTransformer.NOP)) { return this; } Iterator<SettableBeanProperty> it = iterator(); ArrayList<SettableBeanProperty> newProps = new ArrayList<SettableBeanProperty>(); while (it.hasNext()) { SettableBeanProperty prop = it.next(); 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); } // should we try to re-index? Ordering probably changed but called probably doesn't want changes... return new BeanPropertyMap(newProps, _caseInsensitive); }
/** * Factory method for constructing a map where all entries use given * prefix */ public BeanPropertyMap renameAll(NameTransformer transformer) { if (transformer == null || (transformer == NameTransformer.NOP)) { return this; } Iterator<SettableBeanProperty> it = iterator(); ArrayList<SettableBeanProperty> newProps = new ArrayList<SettableBeanProperty>(); while (it.hasNext()) { SettableBeanProperty prop = it.next(); String newName = transformer.transform(prop.getName()); prop = prop.withName(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); } // should we try to re-index? Ordering probably changed but called probably doesn't want changes... return new BeanPropertyMap(newProps); }
/** * Factory method for constructing a map where all entries use given * prefix */ public BeanPropertyMap renameAll(NameTransformer transformer) { if (transformer == null || (transformer == NameTransformer.NOP)) { return this; } Iterator<SettableBeanProperty> it = iterator(); ArrayList<SettableBeanProperty> newProps = new ArrayList<SettableBeanProperty>(); while (it.hasNext()) { SettableBeanProperty prop = it.next(); String newName = transformer.transform(prop.getName()); prop = prop.withName(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); } // should we try to re-index? Ordering probably changed but called probably doesn't want changes... return new BeanPropertyMap(newProps); }
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; }
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; }
/** * Helper method called to see if given property might be so-called unwrapped * property: these require special handling. */ protected SettableBeanProperty _resolveUnwrappedProperty(DeserializationContext ctxt, SettableBeanProperty prop) { AnnotatedMember am = prop.getMember(); if (am != null) { NameTransformer unwrapper = ctxt.getAnnotationIntrospector().findUnwrappingNameTransformer(am); if (unwrapper != null) { JsonDeserializer<Object> orig = prop.getValueDeserializer(); JsonDeserializer<Object> unwrapping = orig.unwrappingDeserializer(unwrapper); if (unwrapping != orig && unwrapping != null) { // might be cleaner to create new instance; but difficult to do reliably, so: return prop.withValueDeserializer(unwrapping); } } } return null; }
/** * Helper method called to see if given property might be so-called unwrapped * property: these require special handling. */ protected SettableBeanProperty _resolveUnwrappedProperty(DeserializationContext ctxt, SettableBeanProperty prop) { AnnotatedMember am = prop.getMember(); if (am != null) { NameTransformer unwrapper = ctxt.getAnnotationIntrospector().findUnwrappingNameTransformer(am); if (unwrapper != null) { JsonDeserializer<Object> orig = prop.getValueDeserializer(); JsonDeserializer<Object> unwrapping = orig.unwrappingDeserializer(unwrapper); if (unwrapping != orig && unwrapping != null) { // might be cleaner to create new instance; but difficult to do reliably, so: return prop.withValueDeserializer(unwrapping); } } } return null; }
/** * Helper method called to see if given property might be so-called unwrapped * property: these require special handling. */ protected SettableBeanProperty _resolveUnwrappedProperty(DeserializationContext ctxt, SettableBeanProperty prop) { AnnotatedMember am = prop.getMember(); if (am != null) { NameTransformer unwrapper = ctxt.getAnnotationIntrospector().findUnwrappingNameTransformer(am); if (unwrapper != null) { JsonDeserializer<Object> orig = prop.getValueDeserializer(); JsonDeserializer<Object> unwrapping = orig.unwrappingDeserializer(unwrapper); if (unwrapping != orig && unwrapping != null) { // might be cleaner to create new instance; but difficult to do reliably, so: return prop.withValueDeserializer(unwrapping); } } } return null; }
/** * Helper method called to see if given property might be so-called unwrapped * property: these require special handling. */ protected SettableBeanProperty _resolveUnwrappedProperty(DeserializationContext ctxt, SettableBeanProperty prop) { AnnotatedMember am = prop.getMember(); if (am != null) { NameTransformer unwrapper = ctxt.getAnnotationIntrospector().findUnwrappingNameTransformer(am); if (unwrapper != null) { JsonDeserializer<Object> orig = prop.getValueDeserializer(); JsonDeserializer<Object> unwrapping = orig.unwrappingDeserializer(unwrapper); if (unwrapping != orig && unwrapping != null) { // might be cleaner to create new instance; but difficult to do reliably, so: return prop.withValueDeserializer(unwrapping); } } } return null; }
/** * Helper method called to see if given property might be so-called unwrapped * property: these require special handling. */ protected SettableBeanProperty _resolveUnwrappedProperty(DeserializationContext ctxt, SettableBeanProperty prop) { AnnotatedMember am = prop.getMember(); if (am != null) { NameTransformer unwrapper = ctxt.getAnnotationIntrospector().findUnwrappingNameTransformer(am); if (unwrapper != null) { JsonDeserializer<Object> orig = prop.getValueDeserializer(); JsonDeserializer<Object> unwrapping = orig.unwrappingDeserializer(unwrapper); if (unwrapping != orig && unwrapping != null) { // might be cleaner to create new instance; but difficult to do reliably, so: return prop.withValueDeserializer(unwrapping); } } } return null; }