SettableBeanProperty instances.
Note that this class is used instead of generic java.
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.
| Modifier and Type | Field and Description |
|---|---|
| private final Map | _aliasDefs
Configuration of alias mappings, indexed by unmodified property name to unmodified aliases, if any; entries only included for properties that do have aliases. |
| private final Map | _aliasMapping
Mapping from secondary names (aliases) to primary names. |
| protected final boolean | |
| private Object[] | _hashArea
Hash area that contains key/property pairs in adjacent elements. |
| private int | |
| private final Locale | |
| private final SettableBeanProperty[] | _propsInOrder
Array of properties in the exact order they were handed in. This is used by as-array serialization, deserialization. |
| private int | _size
Number of entries stored in the hash area. |
| private int | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | BeanPropertyMap(boolean caseInsensitive, Collection<SettableBeanProperty> props, Map<String, List<PropertyName>> aliasDefs, Locale locale)
|
| public | BeanPropertyMap(boolean caseInsensitive, Collection<SettableBeanProperty> props, Map<String, List<PropertyName>> aliasDefs)
Deprecated
since 2.11
|
| private | |
| private | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private Map | |
| private final SettableBeanProperty | |
| private SettableBeanProperty | |
| private final int | _findFromOrdered(SettableBeanProperty prop)
Helper method used to find exact location of a property with name given exactly, not subject to case changes, within hash area. |
| private SettableBeanProperty | |
| private final int | |
| private List | |
| protected SettableBeanProperty | |
| public BeanPropertyMap | |
| public static BeanPropertyMap | construct(MapperConfig<?> config, Collection<SettableBeanProperty> props, Map<String, List<PropertyName>> aliasMapping, boolean caseInsensitive)
|
| public static BeanPropertyMap | construct(MapperConfig<?> config, Collection<SettableBeanProperty> props, Map<String, List<PropertyName>> aliasMapping)
Deprecated
since 2.12
|
| public static BeanPropertyMap | construct(Collection<SettableBeanProperty> props, boolean caseInsensitive, Map<String, List<PropertyName>> aliasMapping)
Deprecated
since 2.11
|
| public SettableBeanProperty | |
| public SettableBeanProperty | |
| public 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 |
| private static final int | |
| public SettableBeanProperty[] | getPropertiesInInsertionOrder()
Method that will re-create initial insertion-ordering of properties contained in this map. |
| protected final String | |
| public boolean | |
| protected void | |
| public boolean | |
| public Iterator | iterator()
Implements java. |
| public void | |
| public BeanPropertyMap | renameAll(NameTransformer transformer)
Mutant factory method for constructing a map where all entries use given prefix |
| public 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. |
| public int | |
| public String | |
| public 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
|
| public BeanPropertyMap | withoutProperties(Collection<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. |
| public BeanPropertyMap | withoutProperties(Collection<String> toExclude, Collection<String> toInclude)
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, or including only the one marked as included |
| public 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. |
| protected void |
| _aliasDefs | back to summary |
|---|---|
| private final Map<String, List<PropertyName>> _aliasDefs Configuration of alias mappings, indexed by unmodified property name to unmodified aliases, if any; entries only included for properties that do have aliases. This is is used for constructing actual reverse lookup mapping, if needed, taking into account possible case-insensitivity, as well as possibility of name prefixes.
| |
| _aliasMapping | back to summary |
|---|---|
| private final Map<String, String> _aliasMapping Mapping from secondary names (aliases) to primary names.
| |
| _caseInsensitive | back to summary |
|---|---|
protected final boolean _caseInsensitive
| |
| _hashArea | back to summary |
|---|---|
| private Object[] _hashArea Hash area that contains key/property pairs in adjacent elements. | |
| _hashMask | back to summary |
|---|---|
| private int _hashMask | |
| _locale | back to summary |
|---|---|
| private final Locale _locale We require
| |
| _propsInOrder | back to summary |
|---|---|
| private final SettableBeanProperty[] _propsInOrder Array of properties in the exact order they were handed in. This is used by as-array serialization, deserialization. | |
| _size | back to summary |
|---|---|
| private int _size Number of entries stored in the hash area. | |
| _spillCount | back to summary |
|---|---|
| private int _spillCount | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| BeanPropertyMap | back to summary |
|---|---|
public BeanPropertyMap(boolean caseInsensitive, Collection<SettableBeanProperty> props, Map<String, List<PropertyName>> aliasDefs, Locale locale)
| |
| BeanPropertyMap | back to summary |
|---|---|
| public BeanPropertyMap(boolean caseInsensitive, Collection<SettableBeanProperty> props, Map<String, List<PropertyName>> aliasDefs)
Deprecated since 2.11
| |
| BeanPropertyMap | back to summary |
|---|---|
| private BeanPropertyMap(BeanPropertyMap src, SettableBeanProperty newProp, int hashIndex, int orderedIndex) | |
| BeanPropertyMap | back to summary |
|---|---|
| private BeanPropertyMap(BeanPropertyMap src, SettableBeanProperty newProp, String key, int slot) | |
| BeanPropertyMap | back to summary |
|---|---|
protected BeanPropertyMap(BeanPropertyMap base, boolean caseInsensitive)
| |
| _buildAliasMapping | back to summary |
|---|---|
| private Map | |
| _find2 | back to summary |
|---|---|
| private final SettableBeanProperty _find2(String key, int slot, Object match) | |
| _find2ViaAlias | back to summary |
|---|---|
| private SettableBeanProperty _find2ViaAlias(String key, int slot, Object match) | |
| _findFromOrdered | back to summary |
|---|---|
| private final int _findFromOrdered(SettableBeanProperty prop) Helper method used to find exact location of a property with name given exactly, not subject to case changes, within hash area. Expectation is that such property SHOULD exist, although no exception is thrown.
| |
| _findWithAlias | back to summary |
|---|---|
| private SettableBeanProperty _findWithAlias(String keyFromAlias) | |
| _hashCode | back to summary |
|---|---|
| private final int _hashCode(String key) | |
| _properties | back to summary |
|---|---|
| private List | |
| _rename | back to summary |
|---|---|
| protected SettableBeanProperty _rename(SettableBeanProperty prop, NameTransformer xf) | |
| assignIndexes | back to summary |
|---|---|
| public BeanPropertyMap assignIndexes() | |
| construct | back to summary |
|---|---|
public static BeanPropertyMap construct(MapperConfig<?> config, Collection<SettableBeanProperty> props, Map<String, List<PropertyName>> aliasMapping, boolean caseInsensitive)
| |
| construct | back to summary |
|---|---|
| public static BeanPropertyMap construct(MapperConfig<?> config, Collection<SettableBeanProperty> props, Map<String, List<PropertyName>> aliasMapping)
Deprecated since 2.12
| |
| construct | back to summary |
|---|---|
| public static BeanPropertyMap construct(Collection<SettableBeanProperty> props, boolean caseInsensitive, Map<String, List<PropertyName>> aliasMapping)
Deprecated since 2.11
| |
| find | back to summary |
|---|---|
public SettableBeanProperty find(int index)
| |
| find | back to summary |
|---|---|
| public SettableBeanProperty find(String key) | |
| findDeserializeAndSet | back to summary |
|---|---|
| public boolean findDeserializeAndSet(JsonParser p, DeserializationContext ctxt, Object bean, String key) throws IOException Convenience method that tries to find property with given name, and
if it is found, call
| |
| findSize | back to summary |
|---|---|
| private static final int findSize(int size) | |
| getPropertiesInInsertionOrder | back to summary |
|---|---|
| public SettableBeanProperty[] getPropertiesInInsertionOrder() Method that will re-create initial insertion-ordering of properties contained in this map. Note that if properties have been removed, array may contain nulls; otherwise it should be consecutive.
| |
| getPropertyName | back to summary |
|---|---|
| protected final String getPropertyName(SettableBeanProperty prop) | |
| hasAliases | back to summary |
|---|---|
public boolean hasAliases()
| |
| init | back to summary |
|---|---|
| protected void init(Collection<SettableBeanProperty> props) | |
| isCaseInsensitive | back to summary |
|---|---|
public boolean isCaseInsensitive()
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Accessor for traversing over all contained properties.
| |
| remove | back to summary |
|---|---|
| public void remove(SettableBeanProperty propToRm) Specialized method for removing specified existing entry. Note entry MUST exist, otherwise an exception is thrown. | |
| renameAll | back to summary |
|---|---|
| public BeanPropertyMap renameAll(NameTransformer transformer) Mutant factory method for constructing a map where all entries use given prefix | |
| replace | back to summary |
|---|---|
| public 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.
| |
| size | back to summary |
|---|---|
| public int size() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| withCaseInsensitivity | back to summary |
|---|---|
| public 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
| |
| withoutProperties | back to summary |
|---|---|
| public BeanPropertyMap withoutProperties(Collection<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.
| |
| withoutProperties | back to summary |
|---|---|
| public BeanPropertyMap withoutProperties(Collection<String> toExclude, Collection<String> toInclude) 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, or including only the one marked as included
| |
| withProperty | back to summary |
|---|---|
| public 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. Note that method does not modify this instance but constructs and returns a new one. | |
| wrapAndThrow | back to summary |
|---|---|
| protected void wrapAndThrow(Throwable t, Object bean, String fieldName, DeserializationContext ctxt) throws IOException | |