public final class BeanPropertyMap extends Object implements Iterable<SettableBeanProperty>, Serializable
SettableBeanProperty
instances.
Note that this class is used instead of generic HashMap
for bit of performance gain (and some memory savings): although default
implementation is very good for generic use cases, it can be streamlined
a bit for specific use case we have. Even relatively small improvements
matter since this is directly on the critical path during deserialization,
as it is done for each and every POJO property deserialized.
Constructor and Description |
---|
BeanPropertyMap(Collection<SettableBeanProperty> properties,
boolean caseInsensitivePropertyComparison) |
Modifier and Type | Method and Description |
---|---|
BeanPropertyMap |
assignIndexes() |
SettableBeanProperty |
find(int propertyIndex) |
SettableBeanProperty |
find(String key) |
boolean |
findDeserializeAndSet(JsonParser p,
DeserializationContext ctxt,
Object bean,
String key)
Convenience method that tries to find property with given name, and
if it is found, call
SettableBeanProperty.deserializeAndSet(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, java.lang.Object)
on it, and return true; or, if not found, return false. |
SettableBeanProperty[] |
getPropertiesInInsertionOrder()
Method that will re-create initial insertion-ordering of
properties contained in this map.
|
Iterator<SettableBeanProperty> |
iterator()
Accessor for traversing over all contained properties.
|
void |
remove(SettableBeanProperty property)
Specialized method for removing specified existing entry.
|
BeanPropertyMap |
renameAll(NameTransformer transformer)
Factory method for constructing a map where all entries use given
prefix
|
void |
replace(SettableBeanProperty property)
Specialized method that can be used to replace an existing entry
(note: entry MUST exist; otherwise exception is thrown) with
specified replacement.
|
int |
size() |
String |
toString() |
BeanPropertyMap |
withProperty(SettableBeanProperty newProperty)
Fluent copy method that creates a new instance that is a copy
of this instance except for one additional property that is
passed as the argument.
|
protected void |
wrapAndThrow(Throwable t,
Object bean,
String fieldName,
DeserializationContext ctxt) |
public BeanPropertyMap(Collection<SettableBeanProperty> properties, boolean caseInsensitivePropertyComparison)
public BeanPropertyMap withProperty(SettableBeanProperty newProperty)
public BeanPropertyMap renameAll(NameTransformer transformer)
public BeanPropertyMap assignIndexes()
public Iterator<SettableBeanProperty> iterator()
iterator
in interface Iterable<SettableBeanProperty>
public SettableBeanProperty[] getPropertiesInInsertionOrder()
public int size()
public SettableBeanProperty find(String key)
public boolean findDeserializeAndSet(JsonParser p, DeserializationContext ctxt, Object bean, String key) throws IOException
SettableBeanProperty.deserializeAndSet(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, java.lang.Object)
on it, and return true; or, if not found, return false.
Note, too, that if deserialization is attempted, possible exceptions
are wrapped if and as necessary, so caller need not handle those.IOException
public SettableBeanProperty find(int propertyIndex)
public void replace(SettableBeanProperty property)
public void remove(SettableBeanProperty property)
protected void wrapAndThrow(Throwable t, Object bean, String fieldName, DeserializationContext ctxt) throws IOException
IOException
Copyright © 2014-2015 FasterXML. All Rights Reserved.