Top Description Inners Fields Methods
tools.jackson.databind

public Interface BeanProperty

extends FullyNamed
Known Direct Implementers
tools.jackson.databind.BeanProperty.Std, tools.jackson.databind.BeanProperty.Bogus, tools.jackson.databind.introspect.ConcreteBeanPropertyBase
Imports
java.lang.annotation.Annotation, java.util.Collections, .List, com.fasterxml.jackson.annotation.JsonFormat, .JsonFormat.Value, .JsonInclude, tools.jackson.databind.cfg.MapperConfig, tools.jackson.databind.introspect.AnnotatedMember, tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor, tools.jackson.databind.type.TypeFactory, tools.jackson.databind.util.FullyNamed

Bean properties are logical entities that represent data that Java objects (POJOs (Plain Old Java Objects), sometimes also called "beans") contain; and that are accessed using accessors (methods like getters and setters, fields, constructor parameters). Instances allow access to annotations directly associated to property (via field or method), as well as contextual annotations (annotations for class that contains properties).

Instances are not typically passed when constructing serializers and deserializers, but rather only passed when context is known and ValueSerializer#createContextual and ValueDeserializer#createContextual are called. References may (need to) be retained by serializers and deserializers, especially when further resolving dependent handlers like value serializers/deserializers or structured types.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
BeanProperty.Bogus

Alternative "Null" implementation that can be used in cases where a non-null BeanProperty is needed

public static class
BeanProperty.Std

Simple stand-alone implementation, useful as a placeholder or base class for more complex implementations.

Field Summary

Modifier and TypeField and Description
public static final JsonFormat.Value
public static final JsonInclude.Value

Method Summary

Modifier and TypeMethod and Description
public void
depositSchemaProperty(JsonObjectFormatVisitor
Visitor to used as the callback handler
objectVisitor
,
SerializationContext provider)

Method that can be called to visit the type structure that this property is part of.

public List<PropertyName>

Returns:

List (possibly empty) of alternate names; never null
findAliases
(MapperConfig<?> config)

Method for accessing set of possible alternate names that are accepted during deserialization.

public JsonFormat.Value

Returns:

Format override settings if any; `null` if no overrides
findFormatOverrides
(MapperConfig<?> config)

Helper method used to only access property-specified format overrides, if any, not considering type or global default format settings.

public JsonFormat.Value
findPropertyFormat(MapperConfig<?> config, Class<?> baseType)

Helper method used to look up format settings applicable to this property, considering both possible per-type configuration settings

public JsonInclude.Value
findPropertyInclusion(MapperConfig<?> config, Class<?> baseType)

Convenience method that is roughly equivalent to

   return config.getAnnotationIntrospector().findPropertyInclusion(getMember());
public <A extends Annotation> A
getAnnotation(Class<A> acls)

Method for finding annotation associated with this property; meaning annotation associated with one of entities used to access property.

public <A extends Annotation> A
getContextAnnotation(Class<A> acls)

Method for finding annotation associated with context of this property; usually class in which member is declared (or its subtype if processing subtype).

public AnnotatedMember
getMember()

Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.

public PropertyMetadata

Returns:

Metadata about property; never null.
getMetadata
()

Accessor for additional optional information about property.

public JavaType
getType()

Method to get declared type of the property.

public PropertyName
getWrapperName()

If property is indicated to be wrapped, name of wrapper element to use.

public boolean
isRequired()

Whether value for property is marked as required using annotations or associated schema.

public boolean
isVirtual()

Accessor for checking whether there is an actual physical property behind this property abstraction or not.

Inherited from tools.jackson.databind.util.FullyNamed:
getFullNamehasName

Field Detail

EMPTY_FORMATback to summary
public static final JsonFormat.Value EMPTY_FORMAT
EMPTY_INCLUDEback to summary
public static final JsonInclude.Value EMPTY_INCLUDE

Method Detail

depositSchemaPropertyback to summary
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializationContext provider)

Method that can be called to visit the type structure that this property is part of. Note that not all implementations support traversal with this method; those that do not should throw UnsupportedOperationException.

Parameters
objectVisitor:JsonObjectFormatVisitor

Visitor to used as the callback handler

findAliasesback to summary
public List<PropertyName> findAliases(MapperConfig<?> config)

Method for accessing set of possible alternate names that are accepted during deserialization.

Returns:List<PropertyName>

List (possibly empty) of alternate names; never null

findFormatOverridesback to summary
public JsonFormat.Value findFormatOverrides(MapperConfig<?> config)

Helper method used to only access property-specified format overrides, if any, not considering type or global default format settings.

Returns:JsonFormat.Value

Format override settings if any; `null` if no overrides

Since
3.0
findPropertyFormatback to summary
public JsonFormat.Value findPropertyFormat(MapperConfig<?> config, Class<?> baseType)

Helper method used to look up format settings applicable to this property, considering both possible per-type configuration settings

findPropertyInclusionback to summary
public JsonInclude.Value findPropertyInclusion(MapperConfig<?> config, Class<?> baseType)

Convenience method that is roughly equivalent to

   return config.getAnnotationIntrospector().findPropertyInclusion(getMember());
but also considers global default settings for inclusion
getAnnotationback to summary
public <A extends Annotation> A getAnnotation(Class<A> acls)

Method for finding annotation associated with this property; meaning annotation associated with one of entities used to access property.

Note that this method should only be called for custom annotations; access to standard Jackson annotations (or ones supported by alternate AnnotationIntrospectors) should be accessed through AnnotationIntrospector.

getContextAnnotationback to summary
public <A extends Annotation> A getContextAnnotation(Class<A> acls)

Method for finding annotation associated with context of this property; usually class in which member is declared (or its subtype if processing subtype).

Note that this method should only be called for custom annotations; access to standard Jackson annotations (or ones supported by alternate AnnotationIntrospectors) should be accessed through AnnotationIntrospector.

getMemberback to summary
public AnnotatedMember getMember()

Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.

getMetadataback to summary
public PropertyMetadata getMetadata()

Accessor for additional optional information about property.

Returns:PropertyMetadata

Metadata about property; never null.

getTypeback to summary
public JavaType getType()

Method to get declared type of the property.

getWrapperNameback to summary
public PropertyName getWrapperName()

If property is indicated to be wrapped, name of wrapper element to use.

isRequiredback to summary
public boolean isRequired()

Whether value for property is marked as required using annotations or associated schema. Equivalent to: getMetadata().isRequired()

isVirtualback to summary
public boolean isVirtual()

Accessor for checking whether there is an actual physical property behind this property abstraction or not.

tools.jackson.databind back to summary

public Class BeanProperty.Bogus

extends Object
implements BeanProperty
Class Inheritance
All Implemented Interfaces
tools.jackson.databind.BeanProperty, tools.jackson.databind.util.FullyNamed, tools.jackson.core.util.Named

Alternative "Null" implementation that can be used in cases where a non-null BeanProperty is needed

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializationContext provider)

Implements tools.jackson.databind.BeanProperty.depositSchemaProperty.

Method that can be called to visit the type structure that this property is part of.

public List<PropertyName>
findAliases(MapperConfig<?> config)

Implements tools.jackson.databind.BeanProperty.findAliases.

Method for accessing set of possible alternate names that are accepted during deserialization.

public JsonFormat.Value
findFormatOverrides(MapperConfig<?> config)

Implements tools.jackson.databind.BeanProperty.findFormatOverrides.

Helper method used to only access property-specified format overrides, if any, not considering type or global default format settings.

public JsonFormat.Value
findPropertyFormat(MapperConfig<?> config, Class<?> baseType)

Implements tools.jackson.databind.BeanProperty.findPropertyFormat.

Helper method used to look up format settings applicable to this property, considering both possible per-type configuration settings

public JsonInclude.Value
findPropertyInclusion(MapperConfig<?> config, Class<?> baseType)

Implements tools.jackson.databind.BeanProperty.findPropertyInclusion.

Convenience method that is roughly equivalent to

   return config.getAnnotationIntrospector().findPropertyInclusion(getMember());
public <A extends Annotation> A
getAnnotation(Class<A> acls)

Implements tools.jackson.databind.BeanProperty.getAnnotation.

Method for finding annotation associated with this property; meaning annotation associated with one of entities used to access property.

public <A extends Annotation> A
getContextAnnotation(Class<A> acls)

Implements tools.jackson.databind.BeanProperty.getContextAnnotation.

Method for finding annotation associated with context of this property; usually class in which member is declared (or its subtype if processing subtype).

public PropertyName
public AnnotatedMember
getMember()

Implements tools.jackson.databind.BeanProperty.getMember.

Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.

public PropertyMetadata
getMetadata()

Implements tools.jackson.databind.BeanProperty.getMetadata.

Accessor for additional optional information about property.

public String
public JavaType
getType()

Implements tools.jackson.databind.BeanProperty.getType.

Method to get declared type of the property.

public PropertyName
getWrapperName()

Implements tools.jackson.databind.BeanProperty.getWrapperName.

If property is indicated to be wrapped, name of wrapper element to use.

public boolean
isRequired()

Implements tools.jackson.databind.BeanProperty.isRequired.

Whether value for property is marked as required using annotations or associated schema.

public boolean
isVirtual()

Implements tools.jackson.databind.BeanProperty.isVirtual.

Accessor for checking whether there is an actual physical property behind this property abstraction or not.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Bogusback to summary
public Bogus()

Method Detail

depositSchemaPropertyback to summary
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializationContext provider)

Implements tools.jackson.databind.BeanProperty.depositSchemaProperty.

Doc from tools.jackson.databind.BeanProperty.depositSchemaProperty.

Method that can be called to visit the type structure that this property is part of. Note that not all implementations support traversal with this method; those that do not should throw UnsupportedOperationException.

Annotations
@Override
findAliasesback to summary
public List<PropertyName> findAliases(MapperConfig<?> config)

Implements tools.jackson.databind.BeanProperty.findAliases.

Doc from tools.jackson.databind.BeanProperty.findAliases.

Method for accessing set of possible alternate names that are accepted during deserialization.

Annotations
@Override
findFormatOverridesback to summary
public JsonFormat.Value findFormatOverrides(MapperConfig<?> config)

Implements tools.jackson.databind.BeanProperty.findFormatOverrides.

Doc from tools.jackson.databind.BeanProperty.findFormatOverrides.

Helper method used to only access property-specified format overrides, if any, not considering type or global default format settings.

Annotations
@Override
findPropertyFormatback to summary
public JsonFormat.Value findPropertyFormat(MapperConfig<?> config, Class<?> baseType)

Implements tools.jackson.databind.BeanProperty.findPropertyFormat.

Doc from tools.jackson.databind.BeanProperty.findPropertyFormat.

Helper method used to look up format settings applicable to this property, considering both possible per-type configuration settings

Annotations
@Override
findPropertyInclusionback to summary
public JsonInclude.Value findPropertyInclusion(MapperConfig<?> config, Class<?> baseType)

Implements tools.jackson.databind.BeanProperty.findPropertyInclusion.

Doc from tools.jackson.databind.BeanProperty.findPropertyInclusion.

Convenience method that is roughly equivalent to

   return config.getAnnotationIntrospector().findPropertyInclusion(getMember());
but also considers global default settings for inclusion
Annotations
@Override
getAnnotationback to summary
public <A extends Annotation> A getAnnotation(Class<A> acls)

Implements tools.jackson.databind.BeanProperty.getAnnotation.

Doc from tools.jackson.databind.BeanProperty.getAnnotation.

Method for finding annotation associated with this property; meaning annotation associated with one of entities used to access property.

Note that this method should only be called for custom annotations; access to standard Jackson annotations (or ones supported by alternate AnnotationIntrospectors) should be accessed through AnnotationIntrospector.

Annotations
@Override
getContextAnnotationback to summary
public <A extends Annotation> A getContextAnnotation(Class<A> acls)

Implements tools.jackson.databind.BeanProperty.getContextAnnotation.

Doc from tools.jackson.databind.BeanProperty.getContextAnnotation.

Method for finding annotation associated with context of this property; usually class in which member is declared (or its subtype if processing subtype).

Note that this method should only be called for custom annotations; access to standard Jackson annotations (or ones supported by alternate AnnotationIntrospectors) should be accessed through AnnotationIntrospector.

Annotations
@Override
getFullNameback to summary
public PropertyName getFullName()

Implements tools.jackson.databind.util.FullyNamed.getFullName.

Annotations
@Override
getMemberback to summary
public AnnotatedMember getMember()

Implements tools.jackson.databind.BeanProperty.getMember.

Doc from tools.jackson.databind.BeanProperty.getMember.

Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.

Annotations
@Override
getMetadataback to summary
public PropertyMetadata getMetadata()

Implements tools.jackson.databind.BeanProperty.getMetadata.

Doc from tools.jackson.databind.BeanProperty.getMetadata.

Accessor for additional optional information about property.

Annotations
@Override
getNameback to summary
public String getName()

Implements tools.jackson.core.util.Named.getName.

Annotations
@Override
getTypeback to summary
public JavaType getType()

Implements tools.jackson.databind.BeanProperty.getType.

Doc from tools.jackson.databind.BeanProperty.getType.

Method to get declared type of the property.

Annotations
@Override
getWrapperNameback to summary
public PropertyName getWrapperName()

Implements tools.jackson.databind.BeanProperty.getWrapperName.

Doc from tools.jackson.databind.BeanProperty.getWrapperName.

If property is indicated to be wrapped, name of wrapper element to use.

Annotations
@Override
isRequiredback to summary
public boolean isRequired()

Implements tools.jackson.databind.BeanProperty.isRequired.

Doc from tools.jackson.databind.BeanProperty.isRequired.

Whether value for property is marked as required using annotations or associated schema. Equivalent to: getMetadata().isRequired()

Annotations
@Override
isVirtualback to summary
public boolean isVirtual()

Implements tools.jackson.databind.BeanProperty.isVirtual.

Doc from tools.jackson.databind.BeanProperty.isVirtual.

Accessor for checking whether there is an actual physical property behind this property abstraction or not.

Annotations
@Override
tools.jackson.databind back to summary

public Class BeanProperty.Std

extends Object
implements BeanProperty, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, tools.jackson.databind.BeanProperty, tools.jackson.databind.util.FullyNamed, tools.jackson.core.util.Named
Known Direct Subclasses
tools.jackson.databind.deser.impl.ValueInjector

Simple stand-alone implementation, useful as a placeholder or base class for more complex implementations.

Field Summary

Modifier and TypeField and Description
protected final AnnotatedMember
_member

Physical entity (field, method or constructor argument) that is used to access value of property (or in case of constructor property, just placeholder)

protected final PropertyMetadata
protected final PropertyName
protected final JavaType
protected final PropertyName
private static final long

Constructor Summary

AccessConstructor and Description
public
Std(PropertyName name, JavaType type, PropertyName wrapperName, AnnotatedMember member, PropertyMetadata metadata)

public
Std(BeanProperty.Std base, JavaType newType)

Method Summary

Modifier and TypeMethod and Description
public void
depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializationContext provider)

Implements tools.jackson.databind.BeanProperty.depositSchemaProperty.

Implementation of this method throws UnsupportedOperationException, since instances of this implementation should not be used as part of actual structure visited.

public List<PropertyName>
findAliases(MapperConfig<?> config)

Implements tools.jackson.databind.BeanProperty.findAliases.

Method for accessing set of possible alternate names that are accepted during deserialization.

public JsonFormat.Value
findFormatOverrides(MapperConfig<?> config)

Implements tools.jackson.databind.BeanProperty.findFormatOverrides.

Helper method used to only access property-specified format overrides, if any, not considering type or global default format settings.

public JsonFormat.Value
findPropertyFormat(MapperConfig<?> config, Class<?> baseType)

Implements tools.jackson.databind.BeanProperty.findPropertyFormat.

Helper method used to look up format settings applicable to this property, considering both possible per-type configuration settings

public JsonInclude.Value
findPropertyInclusion(MapperConfig<?> config, Class<?> baseType)

Implements tools.jackson.databind.BeanProperty.findPropertyInclusion.

Convenience method that is roughly equivalent to

   return config.getAnnotationIntrospector().findPropertyInclusion(getMember());
public <A extends Annotation> A
getAnnotation(Class<A> acls)

Implements tools.jackson.databind.BeanProperty.getAnnotation.

Method for finding annotation associated with this property; meaning annotation associated with one of entities used to access property.

public <A extends Annotation> A
getContextAnnotation(Class<A> acls)

Implements tools.jackson.databind.BeanProperty.getContextAnnotation.

Method for finding annotation associated with context of this property; usually class in which member is declared (or its subtype if processing subtype).

public PropertyName
public AnnotatedMember
getMember()

Implements tools.jackson.databind.BeanProperty.getMember.

Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.

public PropertyMetadata
getMetadata()

Implements tools.jackson.databind.BeanProperty.getMetadata.

Accessor for additional optional information about property.

public String
public JavaType
getType()

Implements tools.jackson.databind.BeanProperty.getType.

Method to get declared type of the property.

public PropertyName
getWrapperName()

Implements tools.jackson.databind.BeanProperty.getWrapperName.

If property is indicated to be wrapped, name of wrapper element to use.

public boolean
isRequired()

Implements tools.jackson.databind.BeanProperty.isRequired.

Whether value for property is marked as required using annotations or associated schema.

public boolean
isVirtual()

Implements tools.jackson.databind.BeanProperty.isVirtual.

Accessor for checking whether there is an actual physical property behind this property abstraction or not.

public BeanProperty.Std
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_memberback to summary
protected final AnnotatedMember _member

Physical entity (field, method or constructor argument) that is used to access value of property (or in case of constructor property, just placeholder)

_metadataback to summary
protected final PropertyMetadata _metadata
_nameback to summary
protected final PropertyName _name
_typeback to summary
protected final JavaType _type
_wrapperNameback to summary
protected final PropertyName _wrapperName
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

Stdback to summary
public Std(PropertyName name, JavaType type, PropertyName wrapperName, AnnotatedMember member, PropertyMetadata metadata)
Stdback to summary
public Std(BeanProperty.Std base, JavaType newType)

Method Detail

depositSchemaPropertyback to summary
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializationContext provider)

Implements tools.jackson.databind.BeanProperty.depositSchemaProperty.

Implementation of this method throws UnsupportedOperationException, since instances of this implementation should not be used as part of actual structure visited. Rather, other implementations should handle it.

Annotations
@Override
findAliasesback to summary
public List<PropertyName> findAliases(MapperConfig<?> config)

Implements tools.jackson.databind.BeanProperty.findAliases.

Doc from tools.jackson.databind.BeanProperty.findAliases.

Method for accessing set of possible alternate names that are accepted during deserialization.

Annotations
@Override
findFormatOverridesback to summary
public JsonFormat.Value findFormatOverrides(MapperConfig<?> config)

Implements tools.jackson.databind.BeanProperty.findFormatOverrides.

Doc from tools.jackson.databind.BeanProperty.findFormatOverrides.

Helper method used to only access property-specified format overrides, if any, not considering type or global default format settings.

Annotations
@Override
findPropertyFormatback to summary
public JsonFormat.Value findPropertyFormat(MapperConfig<?> config, Class<?> baseType)

Implements tools.jackson.databind.BeanProperty.findPropertyFormat.

Doc from tools.jackson.databind.BeanProperty.findPropertyFormat.

Helper method used to look up format settings applicable to this property, considering both possible per-type configuration settings

Annotations
@Override
findPropertyInclusionback to summary
public JsonInclude.Value findPropertyInclusion(MapperConfig<?> config, Class<?> baseType)

Implements tools.jackson.databind.BeanProperty.findPropertyInclusion.

Doc from tools.jackson.databind.BeanProperty.findPropertyInclusion.

Convenience method that is roughly equivalent to

   return config.getAnnotationIntrospector().findPropertyInclusion(getMember());
but also considers global default settings for inclusion
Annotations
@Override
getAnnotationback to summary
public <A extends Annotation> A getAnnotation(Class<A> acls)

Implements tools.jackson.databind.BeanProperty.getAnnotation.

Doc from tools.jackson.databind.BeanProperty.getAnnotation.

Method for finding annotation associated with this property; meaning annotation associated with one of entities used to access property.

Note that this method should only be called for custom annotations; access to standard Jackson annotations (or ones supported by alternate AnnotationIntrospectors) should be accessed through AnnotationIntrospector.

Annotations
@Override
getContextAnnotationback to summary
public <A extends Annotation> A getContextAnnotation(Class<A> acls)

Implements tools.jackson.databind.BeanProperty.getContextAnnotation.

Doc from tools.jackson.databind.BeanProperty.getContextAnnotation.

Method for finding annotation associated with context of this property; usually class in which member is declared (or its subtype if processing subtype).

Note that this method should only be called for custom annotations; access to standard Jackson annotations (or ones supported by alternate AnnotationIntrospectors) should be accessed through AnnotationIntrospector.

Annotations
@Override
getFullNameback to summary
public PropertyName getFullName()

Implements tools.jackson.databind.util.FullyNamed.getFullName.

Annotations
@Override
getMemberback to summary
public AnnotatedMember getMember()

Implements tools.jackson.databind.BeanProperty.getMember.

Doc from tools.jackson.databind.BeanProperty.getMember.

Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.

Annotations
@Override
getMetadataback to summary
public PropertyMetadata getMetadata()

Implements tools.jackson.databind.BeanProperty.getMetadata.

Doc from tools.jackson.databind.BeanProperty.getMetadata.

Accessor for additional optional information about property.

Annotations
@Override
getNameback to summary
public String getName()

Implements tools.jackson.core.util.Named.getName.

Annotations
@Override
getTypeback to summary
public JavaType getType()

Implements tools.jackson.databind.BeanProperty.getType.

Doc from tools.jackson.databind.BeanProperty.getType.

Method to get declared type of the property.

Annotations
@Override
getWrapperNameback to summary
public PropertyName getWrapperName()

Implements tools.jackson.databind.BeanProperty.getWrapperName.

Doc from tools.jackson.databind.BeanProperty.getWrapperName.

If property is indicated to be wrapped, name of wrapper element to use.

Annotations
@Override
isRequiredback to summary
public boolean isRequired()

Implements tools.jackson.databind.BeanProperty.isRequired.

Doc from tools.jackson.databind.BeanProperty.isRequired.

Whether value for property is marked as required using annotations or associated schema. Equivalent to: getMetadata().isRequired()

Annotations
@Override
isVirtualback to summary
public boolean isVirtual()

Implements tools.jackson.databind.BeanProperty.isVirtual.

Doc from tools.jackson.databind.BeanProperty.isVirtual.

Accessor for checking whether there is an actual physical property behind this property abstraction or not.

Annotations
@Override
withTypeback to summary
public BeanProperty.Std withType(JavaType type)