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

public Class SimpleBeanPropertyDefinition

extends BeanPropertyDefinition
Class Inheritance
Imports
java.util.Collections, .Iterator, com.fasterxml.jackson.annotation.JsonInclude, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.introspect.*, com.fasterxml.jackson.databind.type.TypeFactory

Simple immutable BeanPropertyDefinition implementation that can be wrapped around a AnnotatedMember that is a simple accessor (getter) or mutator (setter, constructor parameter) (or both, for fields).

Field Summary

Modifier and TypeField and Description
protected final AnnotationIntrospector
protected final PropertyName
protected final JsonInclude.Value
protected final AnnotatedMember
_member

Member that defines logical property.

protected final PropertyMetadata
Inherited from com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition:
EMPTY_INCLUDE

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static SimpleBeanPropertyDefinition
public static SimpleBeanPropertyDefinition
public static SimpleBeanPropertyDefinition
construct(MapperConfig<?> config, AnnotatedMember member, PropertyName name, PropertyMetadata metadata, JsonInclude.Include inclusion)

Method called to create instance for virtual properties.

public static SimpleBeanPropertyDefinition
public JsonInclude.Value
findInclusion()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.findInclusion.

Method used to check if this property has specific inclusion override associated with it or not.
public AnnotatedParameter
public Iterator<AnnotatedParameter>
getConstructorParameters()

Overrides com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getConstructorParameters.

Additional method that may be called instead of getConstructorParameter() to get access to all constructor parameters, not just the highest priority one.
public AnnotatedField
public PropertyName
public AnnotatedMethod
public String
getInternalName()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getInternalName.

Accessor that can be used to determine implicit name from underlying element(s) before possible renaming.
public PropertyMetadata
getMetadata()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getMetadata.

We will indicate that property is optional, since there is nothing to indicate whether it might be required.
public String
getName()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getName.

Implements com.fasterxml.jackson.databind.util.Named.getName.

Accessor for name used for external representation (in JSON).
public AnnotatedMember
getPrimaryMember()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getPrimaryMember.

Method used to find the property member (getter, setter, field) that has the highest precedence in current context (getter method when serializing, if available, and so forth), if any.
public JavaType
public Class<?>
public AnnotatedMethod
public PropertyName
getWrapperName()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getWrapperName.

Accessor for finding wrapper name to use for property (if any).
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
isExplicitlyIncluded()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.isExplicitlyIncluded.

Accessor that can be called to check whether property was included due to an explicit marker (usually annotation), or just by naming convention.
public boolean
isExplicitlyNamed()

Overrides com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.isExplicitlyNamed.

Accessor that can be called to check whether property name was due to an explicit marker (usually annotation), or just by naming convention or use of "use-default-name" marker (annotation).
public BeanPropertyDefinition
public BeanPropertyDefinition
public BeanPropertyDefinition
withName(PropertyName newName)

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.withName.

Method that can be used to create a definition with same settings as this one, but with different (external) name; that is, one for which getName() would return newName.
public BeanPropertyDefinition
withSimpleName(String newName)

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.withSimpleName.

Alternate "mutant factory" that will only change simple name, but leave other optional parts (like namespace) as is.
Inherited from com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition:
couldDeserializecouldSerializefindObjectIdInfofindReferenceNamefindReferenceTypefindViewsgetAccessorgetMutatorgetNonConstructorMutatorisRequiredisTypeId

Field Detail

_annotationIntrospectorback to summary
protected final AnnotationIntrospector _annotationIntrospector
_fullNameback to summary
protected final PropertyName _fullName
Since
2.5
_inclusionback to summary
protected final JsonInclude.Value _inclusion
Since
2.5
_memberback to summary
protected final AnnotatedMember _member

Member that defines logical property. Assumption is that it should be a 'simple' accessor; meaning a zero-argument getter, single-argument setter or constructor parameter.

Note

for "virtual" properties, this is null.

_metadataback to summary
protected final PropertyMetadata _metadata
Since
2.5

Constructor Detail

SimpleBeanPropertyDefinitionback to summary
protected SimpleBeanPropertyDefinition(AnnotationIntrospector intr, AnnotatedMember member, PropertyName fullName, PropertyMetadata metadata, JsonInclude.Value inclusion)
Since
2.9

Method Detail

constructback to summary
public static SimpleBeanPropertyDefinition construct(MapperConfig<?> config, AnnotatedMember member)
Since
2.2
constructback to summary
public static SimpleBeanPropertyDefinition construct(MapperConfig<?> config, AnnotatedMember member, PropertyName name)
Since
2.5
constructback to summary
public static SimpleBeanPropertyDefinition construct(MapperConfig<?> config, AnnotatedMember member, PropertyName name, PropertyMetadata metadata, JsonInclude.Include inclusion)

Method called to create instance for virtual properties.

Since
2.5
constructback to summary
public static SimpleBeanPropertyDefinition construct(MapperConfig<?> config, AnnotatedMember member, PropertyName name, PropertyMetadata metadata, JsonInclude.Value inclusion)
Since
2.7
findInclusionback to summary
public JsonInclude.Value findInclusion()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.findInclusion.

Doc from com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.findInclusion.

Method used to check if this property has specific inclusion override associated with it or not. It should NOT check for any default settings (global, per-type, or containing POJO settings)

Annotations
@Override
getConstructorParameterback to summary
public AnnotatedParameter getConstructorParameter()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getConstructorParameter.

Annotations
@Override
getConstructorParametersback to summary
public Iterator<AnnotatedParameter> getConstructorParameters()

Overrides com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getConstructorParameters.

Doc from com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getConstructorParameters.

Additional method that may be called instead of getConstructorParameter() to get access to all constructor parameters, not just the highest priority one.

Annotations
@Override
getFieldback to summary
public AnnotatedField getField()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getField.

Annotations
@Override
getFullNameback to summary
public PropertyName getFullName()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getFullName.

Annotations
@Override
getGetterback to summary
public AnnotatedMethod getGetter()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getGetter.

Annotations
@Override
getInternalNameback to summary
public String getInternalName()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getInternalName.

Doc from com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getInternalName.

Accessor that can be used to determine implicit name from underlying element(s) before possible renaming. This is the "internal" name derived from accessor ("x" from "getX"), and is not based on annotations or naming strategy.

Annotations
@Override
getMetadataback to summary
public PropertyMetadata getMetadata()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getMetadata.

We will indicate that property is optional, since there is nothing to indicate whether it might be required.

Annotations
@Override
getNameback to summary
public String getName()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getName.

Implements com.fasterxml.jackson.databind.util.Named.getName.

Doc from com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getName.

Accessor for name used for external representation (in JSON).

Annotations
@Override
getPrimaryMemberback to summary
public AnnotatedMember getPrimaryMember()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getPrimaryMember.

Doc from com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getPrimaryMember.

Method used to find the property member (getter, setter, field) that has the highest precedence in current context (getter method when serializing, if available, and so forth), if any.

Note

may throw IllegalArgumentException in case problems are found trying to getter or setter info.

Note

abstract since 2.5

Annotations
@Override
getPrimaryTypeback to summary
public JavaType getPrimaryType()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getPrimaryType.

Annotations
@Override
getRawPrimaryTypeback to summary
public Class<?> getRawPrimaryType()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getRawPrimaryType.

Annotations
@Override
getSetterback to summary
public AnnotatedMethod getSetter()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getSetter.

Annotations
@Override
getWrapperNameback to summary
public PropertyName getWrapperName()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getWrapperName.

Doc from com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.getWrapperName.

Accessor for finding wrapper name to use for property (if any).

Annotations
@Override
hasConstructorParameterback to summary
public boolean hasConstructorParameter()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.hasConstructorParameter.

Annotations
@Override
hasFieldback to summary
public boolean hasField()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.hasField.

Annotations
@Override
hasGetterback to summary
public boolean hasGetter()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.hasGetter.

Annotations
@Override
hasNameback to summary
public boolean hasName(PropertyName name)

Overrides com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.hasName.

Annotations
@Override
hasSetterback to summary
public boolean hasSetter()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.hasSetter.

Annotations
@Override
isExplicitlyIncludedback to summary
public boolean isExplicitlyIncluded()

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.isExplicitlyIncluded.

Doc from com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.isExplicitlyIncluded.

Accessor that can be called to check whether property was included due to an explicit marker (usually annotation), or just by naming convention.

Returns:boolean

True if property was explicitly included (usually by having one of components being annotated); false if inclusion was purely due to naming or visibility definitions (that is, implicit)

Annotations
@Override
isExplicitlyNamedback to summary
public boolean isExplicitlyNamed()

Overrides com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.isExplicitlyNamed.

Doc from com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.isExplicitlyNamed.

Accessor that can be called to check whether property name was due to an explicit marker (usually annotation), or just by naming convention or use of "use-default-name" marker (annotation).

Note that entries that return true from this method will always return true for isExplicitlyIncluded(), but not necessarily vice versa.

Annotations
@Override
withInclusionback to summary
public BeanPropertyDefinition withInclusion(JsonInclude.Value inclusion)
Since
2.5
withMetadataback to summary
public BeanPropertyDefinition withMetadata(PropertyMetadata metadata)
Since
2.5
withNameback to summary
public BeanPropertyDefinition withName(PropertyName newName)

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.withName.

Doc from com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.withName.

Method that can be used to create a definition with same settings as this one, but with different (external) name; that is, one for which getName() would return newName.

Annotations
@Override
withSimpleNameback to summary
public BeanPropertyDefinition withSimpleName(String newName)

Implements abstract com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.withSimpleName.

Doc from com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition.withSimpleName.

Alternate "mutant factory" that will only change simple name, but leave other optional parts (like namespace) as is.

Annotations
@Override