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 PropertyName[][] | _aliasDefs
Configuration of alias mappings, if any (`null` if none),
aligned with properties in |
| private final boolean | |
| private final Locale | |
| private transient PropertyNameMatcher | |
| private SettableBeanProperty[] | _propsInOrder
Array of properties in the exact order they were handed in. This is used by as-array serialization, deserialization. |
| private transient SettableBeanProperty[] | _propsWithAliases
Lazily instantiated array of properties mapped from lookup index, in which
first entries are same as in |
| Access | Constructor and Description |
|---|---|
| protected | BeanPropertyMap(Collection<SettableBeanProperty>
Sequence of primary properties to index props, PropertyName[][] Alias mappings, if any (null if none) aliasDefs, Locale locale, boolean Whether property name matching should case-insensitive or not caseInsensitive, boolean Whether to assign indices to property entities or not assignIndexes)
|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static BeanPropertyMap | construct(MapperConfig<?> config, Collection<SettableBeanProperty> props, PropertyName[][] aliases, boolean caseInsensitive)
|
| public SettableBeanProperty | |
| public SettableBeanProperty | findDefinition(String key)
Note does NOT do case-insensitive matching -- only to be used during construction and never during deserialization process -- nor alias expansion. |
| public PropertyNameMatcher | |
| public SettableBeanProperty[] | |
| public SettableBeanProperty[] | getPrimaryProperties()
Method that will re-create initial insertion-ordering of properties contained in this map. |
| public boolean | |
| public BeanPropertyMap | |
| public boolean | |
| public Iterator | iterator()
Implements java. Accessor for traversing over all contained properties. |
| public void | |
| public BeanPropertyMap | renameAll(DeserializationContext ctxt, NameTransformer transformer)
Mutant factory method for constructing a map where all entries use given prefix |
| public void | replace(SettableBeanProperty oldProp, 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. |
| _aliasDefs | back to summary |
|---|---|
| private final PropertyName[][] _aliasDefs Configuration of alias mappings, if any (`null` if none),
aligned with properties in | |
| _caseInsensitive | back to summary |
|---|---|
| private final boolean _caseInsensitive | |
| _locale | back to summary |
|---|---|
| private final Locale _locale | |
| _nameMatcher | back to summary |
|---|---|
| private transient PropertyNameMatcher _nameMatcher | |
| _propsInOrder | back to summary |
|---|---|
| private SettableBeanProperty[] _propsInOrder Array of properties in the exact order they were handed in. This is
used by as-array serialization, deserialization.
Contains both primary properties (first | |
| _propsWithAliases | back to summary |
|---|---|
| private transient SettableBeanProperty[] _propsWithAliases Lazily instantiated array of properties mapped from lookup index, in which
first entries are same as in | |
| BeanPropertyMap | back to summary |
|---|---|
protected BeanPropertyMap(Collection<SettableBeanProperty> props, PropertyName[][] aliasDefs, Locale locale, boolean caseInsensitive, boolean assignIndexes)
| |
| BeanPropertyMap | back to summary |
|---|---|
| protected BeanPropertyMap(BeanPropertyMap base, boolean caseInsensitive) | |
| construct | back to summary |
|---|---|
| public static BeanPropertyMap construct(MapperConfig<?> config, Collection<SettableBeanProperty> props, PropertyName[][] aliases, boolean caseInsensitive) | |
| findDefinition | back to summary |
|---|---|
| public SettableBeanProperty findDefinition(int index) | |
| findDefinition | back to summary |
|---|---|
| public SettableBeanProperty findDefinition(String key) Note does NOT do case-insensitive matching -- only to be used during construction and never during deserialization process -- nor alias expansion. | |
| getNameMatcher | back to summary |
|---|---|
| public PropertyNameMatcher getNameMatcher() | |
| getNameMatcherProperties | back to summary |
|---|---|
| public SettableBeanProperty[] getNameMatcherProperties() | |
| getPrimaryProperties | back to summary |
|---|---|
| public SettableBeanProperty[] getPrimaryProperties() 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. | |
| hasAliases | back to summary |
|---|---|
| public boolean hasAliases() | |
| initMatcher | back to summary |
|---|---|
| public BeanPropertyMap initMatcher(TokenStreamFactory tsf) | |
| 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(DeserializationContext ctxt, NameTransformer transformer) Mutant factory method for constructing a map where all entries use given prefix | |
| replace | back to summary |
|---|---|
| public void replace(SettableBeanProperty oldProp, 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.
Satisfying this method's contract implies a non-
| |
| 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. | |