Top Description Inners Fields Constructors Methods
com.fasterxml.jackson.databind

public Class PropertyMetadata

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
com.fasterxml.jackson.annotation.Nulls, com.fasterxml.jackson.databind.introspect.AnnotatedMember

Simple container class used for storing "additional" metadata about properties. Carved out to reduce number of distinct properties that actual property implementations and place holders need to store; since instances are immutable, they can be freely shared.
Since
2.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
PropertyMetadata.MergeInfo

Helper class used for containing information about expected merge information for this property, if merging is expected.

Field Summary

Modifier and TypeField and Description
protected Nulls
_contentNulls

Settings regarding handling of incoming `null`s, both for value itself and, for structured types, content values (array/Collection elements, Map values).

protected final String
_defaultValue

Optional default value, as String, for property; not used for any functionality by core databind, offered as metadata for extensions.

protected final String
_description

Optional human-readable description associated with the property.

protected final Integer
_index

Optional index of the property within containing Object.

protected final transient PropertyMetadata.MergeInfo
_mergeInfo

Settings regarding merging, if property is determined to possibly be mergeable (possibly since global settings may be omitted for non-mergeable types).

protected final Boolean
_required

Three states: required, not required and unknown; unknown represented as null.

protected Nulls
_valueNulls

Settings regarding handling of incoming `null`s, both for value itself and, for structured types, content values (array/Collection elements, Map values).

private static final long
public static final PropertyMetadata
public static final PropertyMetadata
public static final PropertyMetadata

Constructor Summary

AccessConstructor and Description
protected
PropertyMetadata(Boolean req, String desc, Integer index, String def, PropertyMetadata.MergeInfo mergeInfo, Nulls valueNulls, Nulls contentNulls)

Method Summary

Modifier and TypeMethod and Description
public static PropertyMetadata
construct(Boolean req, String desc, Integer index, String defaultValue)

public static PropertyMetadata
construct(boolean req, String desc, Integer index, String defaultValue)

Deprecated
public Nulls
public String
public String
public Integer
public PropertyMetadata.MergeInfo
public Boolean
public Nulls
public boolean
hasDefaultValue()

Accessor for determining whether property has declared "default value", which may be used by extension modules.

public boolean
public boolean
protected Object
readResolve()

Minor optimization: let's canonicalize back to placeholders in cases where there is no real data to consider

public PropertyMetadata
public PropertyMetadata
public PropertyMetadata
public PropertyMetadata
public PropertyMetadata
withNulls(Nulls valueNulls, Nulls contentNulls)

public PropertyMetadata
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_contentNullsback to summary
protected Nulls _contentNulls

Settings regarding handling of incoming `null`s, both for value itself and, for structured types, content values (array/Collection elements, Map values).

Since
2.9
_defaultValueback to summary
protected final String _defaultValue

Optional default value, as String, for property; not used for any functionality by core databind, offered as metadata for extensions.

_descriptionback to summary
protected final String _description

Optional human-readable description associated with the property.

_indexback to summary
protected final Integer _index

Optional index of the property within containing Object.

Since
2.4
_mergeInfoback to summary
protected final transient PropertyMetadata.MergeInfo _mergeInfo

Settings regarding merging, if property is determined to possibly be mergeable (possibly since global settings may be omitted for non-mergeable types).

Note

transient since it is assumed that this information is only relevant during initial setup and not needed after full initialization. May be changed if this proves necessary.

Since
2.9
_requiredback to summary
protected final Boolean _required

Three states: required, not required and unknown; unknown represented as null.

_valueNullsback to summary
protected Nulls _valueNulls

Settings regarding handling of incoming `null`s, both for value itself and, for structured types, content values (array/Collection elements, Map values).

Since
2.9
serialVersionUIDback to summary
private static final long serialVersionUID
STD_OPTIONALback to summary
public static final PropertyMetadata STD_OPTIONAL
STD_REQUIREDback to summary
public static final PropertyMetadata STD_REQUIRED
STD_REQUIRED_OR_OPTIONALback to summary
public static final PropertyMetadata STD_REQUIRED_OR_OPTIONAL

Constructor Detail

PropertyMetadataback to summary
protected PropertyMetadata(Boolean req, String desc, Integer index, String def, PropertyMetadata.MergeInfo mergeInfo, Nulls valueNulls, Nulls contentNulls)
Since
2.9

Method Detail

constructback to summary
public static PropertyMetadata construct(Boolean req, String desc, Integer index, String defaultValue)
Since
2.8.8
constructback to summary
public static PropertyMetadata construct(boolean req, String desc, Integer index, String defaultValue)

Deprecated

Annotations
@Deprecated
getContentNullsback to summary
public Nulls getContentNulls()
Since
2.9
getDefaultValueback to summary
public String getDefaultValue()
Since
2.5
getDescriptionback to summary
public String getDescription()
getIndexback to summary
public Integer getIndex()
Since
2.4
getMergeInfoback to summary
public PropertyMetadata.MergeInfo getMergeInfo()
Since
2.9
getRequiredback to summary
public Boolean getRequired()
getValueNullsback to summary
public Nulls getValueNulls()
Since
2.9
hasDefaultValueback to summary
public boolean hasDefaultValue()

Accessor for determining whether property has declared "default value", which may be used by extension modules.

Since
2.6
hasIndexback to summary
public boolean hasIndex()
Since
2.4
isRequiredback to summary
public boolean isRequired()
readResolveback to summary
protected Object readResolve()

Minor optimization: let's canonicalize back to placeholders in cases where there is no real data to consider

withDefaultValueback to summary
public PropertyMetadata withDefaultValue(String def)
withDescriptionback to summary
public PropertyMetadata withDescription(String desc)
withIndexback to summary
public PropertyMetadata withIndex(Integer index)
withMergeInfoback to summary
public PropertyMetadata withMergeInfo(PropertyMetadata.MergeInfo mergeInfo)
Since
2.9
withNullsback to summary
public PropertyMetadata withNulls(Nulls valueNulls, Nulls contentNulls)
Since
2.9
withRequiredback to summary
public PropertyMetadata withRequired(Boolean b)
com.fasterxml.jackson.databind back to summary

public final Class PropertyMetadata.MergeInfo

extends Object
Class Inheritance

Helper class used for containing information about expected merge information for this property, if merging is expected.
Since
2.9

Field Summary

Modifier and TypeField and Description
public final boolean
fromDefaults

Flag that is set if the information came from global defaults, and not from explicit per-property annotations or per-type config overrides.

public final AnnotatedMember

Constructor Summary

AccessConstructor and Description
protected
MergeInfo(AnnotatedMember getter, boolean fromDefaults)

Method Summary

Modifier and TypeMethod and Description
public static PropertyMetadata.MergeInfo
public static PropertyMetadata.MergeInfo
public static PropertyMetadata.MergeInfo
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fromDefaultsback to summary
public final boolean fromDefaults

Flag that is set if the information came from global defaults, and not from explicit per-property annotations or per-type config overrides.

getterback to summary
public final AnnotatedMember getter

Constructor Detail

MergeInfoback to summary
protected MergeInfo(AnnotatedMember getter, boolean fromDefaults)

Method Detail

createForDefaultsback to summary
public static PropertyMetadata.MergeInfo createForDefaults(AnnotatedMember getter)
createForPropertyOverrideback to summary
public static PropertyMetadata.MergeInfo createForPropertyOverride(AnnotatedMember getter)
createForTypeOverrideback to summary
public static PropertyMetadata.MergeInfo createForTypeOverride(AnnotatedMember getter)