public class BeanPropertyMap extends java.lang.Object implements java.lang.Iterable<SettableBeanProperty>, java.io.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(boolean caseInsensitive,
java.util.Collection<SettableBeanProperty> props)
Deprecated.
|
BeanPropertyMap(boolean caseInsensitive,
java.util.Collection<SettableBeanProperty> props,
java.util.Map<java.lang.String,java.util.List<PropertyName>> aliasDefs) |
Modifier and Type | Method and Description |
---|---|
BeanPropertyMap |
assignIndexes() |
static BeanPropertyMap |
construct(java.util.Collection<SettableBeanProperty> props,
boolean caseInsensitive)
Deprecated.
|
static BeanPropertyMap |
construct(java.util.Collection<SettableBeanProperty> props,
boolean caseInsensitive,
java.util.Map<java.lang.String,java.util.List<PropertyName>> aliasMapping) |
SettableBeanProperty |
find(int index) |
SettableBeanProperty |
find(java.lang.String key) |
boolean |
findDeserializeAndSet(JsonParser p,
DeserializationContext ctxt,
java.lang.Object bean,
java.lang.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.
|
boolean |
hasAliases() |
boolean |
isCaseInsensitive() |
java.util.Iterator<SettableBeanProperty> |
iterator()
Accessor for traversing over all contained properties.
|
void |
remove(SettableBeanProperty propToRm)
Specialized method for removing specified existing entry.
|
BeanPropertyMap |
renameAll(NameTransformer transformer)
Mutant factory method for constructing a map where all entries use given
prefix
|
void |
replace(SettableBeanProperty newProp)
Deprecated.
|
void |
replace(SettableBeanProperty origProp,
SettableBeanProperty newProp)
Specialized method that can be used to replace an existing entry
(note: entry MUST exist; otherwise exception is thrown) with
specified replacement.
|
int |
size() |
java.lang.String |
toString() |
BeanPropertyMap |
withCaseInsensitivity(boolean state)
Mutant factory method that constructs a new instance if desired case-insensitivity
state differs from the state of this instance; if states are the same, returns
this . |
BeanPropertyMap |
withoutProperties(java.util.Collection<java.lang.String> toExclude)
Mutant factory method that will use this instance as the base, and
construct an instance that is otherwise same except for excluding
properties with specified names.
|
BeanPropertyMap |
withProperty(SettableBeanProperty newProp)
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.
|
public BeanPropertyMap(boolean caseInsensitive, java.util.Collection<SettableBeanProperty> props, java.util.Map<java.lang.String,java.util.List<PropertyName>> aliasDefs)
@Deprecated public BeanPropertyMap(boolean caseInsensitive, java.util.Collection<SettableBeanProperty> props)
public BeanPropertyMap withCaseInsensitivity(boolean state)
this
.public static BeanPropertyMap construct(java.util.Collection<SettableBeanProperty> props, boolean caseInsensitive, java.util.Map<java.lang.String,java.util.List<PropertyName>> aliasMapping)
@Deprecated public static BeanPropertyMap construct(java.util.Collection<SettableBeanProperty> props, boolean caseInsensitive)
public BeanPropertyMap withProperty(SettableBeanProperty newProp)
public BeanPropertyMap assignIndexes()
public BeanPropertyMap renameAll(NameTransformer transformer)
public BeanPropertyMap withoutProperties(java.util.Collection<java.lang.String> toExclude)
@Deprecated public void replace(SettableBeanProperty newProp)
public void replace(SettableBeanProperty origProp, SettableBeanProperty newProp)
public void remove(SettableBeanProperty propToRm)
public int size()
public boolean isCaseInsensitive()
public boolean hasAliases()
public java.util.Iterator<SettableBeanProperty> iterator()
iterator
in interface java.lang.Iterable<SettableBeanProperty>
public SettableBeanProperty[] getPropertiesInInsertionOrder()
public SettableBeanProperty find(int index)
public SettableBeanProperty find(java.lang.String key)
public boolean findDeserializeAndSet(JsonParser p, DeserializationContext ctxt, java.lang.Object bean, java.lang.String key) throws java.io.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.java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"