com.fasterxml.jackson.databind.introspect
Class BeanPropertyDefinition

java.lang.Object
  extended by com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition
All Implemented Interfaces:
Named
Direct Known Subclasses:
POJOPropertyBuilder, SimpleBeanPropertyDefinition

public abstract class BeanPropertyDefinition
extends Object
implements Named

Simple value classes that contain definitions of properties, used during introspection of properties to use for serialization and deserialization purposes. These instances are created before actual BeanProperty instances are created, i.e. they are used earlier in the process flow, and are typically use to construct actual BeanProperty instances.


Constructor Summary
BeanPropertyDefinition()
           
 
Method Summary
 boolean couldDeserialize()
           
 boolean couldSerialize()
           
 ObjectIdInfo findObjectIdInfo()
          Method used to check whether this logical property indicates that value POJOs should be written using additional Object Identifier (or, when multiple references exist, all but first AS Object Identifier).
 AnnotationIntrospector.ReferenceProperty findReferenceType()
          Method used to find whether property is part of a bi-directional reference.
 Class<?>[] findViews()
          Method used to find View-inclusion definitions for the property.
abstract  AnnotatedMember getAccessor()
          Method used to find accessor (getter, field to access) to use for accessing value of the property.
abstract  AnnotatedParameter getConstructorParameter()
           
abstract  AnnotatedField getField()
           
abstract  AnnotatedMethod getGetter()
           
abstract  String getInternalName()
          Accessor that can be used to determine implicit name from underlying element(s) before possible renaming.
abstract  AnnotatedMember getMutator()
          Method used to find mutator (constructor parameter, setter, field) to use for changing value of the property.
abstract  String getName()
          Accessor for name used for external representation (in JSON).
 AnnotatedMember 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.
abstract  AnnotatedMethod getSetter()
           
abstract  boolean hasConstructorParameter()
           
abstract  boolean hasField()
           
abstract  boolean hasGetter()
           
abstract  boolean hasSetter()
           
abstract  boolean isExplicitlyIncluded()
          Accessor that can be called to check whether property was included due to an explicit marker (usually annotation), or just by naming convention.
 boolean isRequired()
          Method used to check if this property is expected to have a value; and if none found, should either be considered invalid (and most likely fail deserialization), or handled by other means (by providing default value)
 boolean isTypeId()
          Method used to check whether this logical property has a marker to indicate it should be used as the type id for polymorphic type handling.
abstract  BeanPropertyDefinition withName(String newName)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanPropertyDefinition

public BeanPropertyDefinition()
Method Detail

withName

public abstract BeanPropertyDefinition withName(String newName)
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.


getName

public abstract String getName()
Accessor for name used for external representation (in JSON).

Specified by:
getName in interface Named

getInternalName

public abstract String 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.


isExplicitlyIncluded

public abstract boolean 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:
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)

couldDeserialize

public boolean couldDeserialize()

couldSerialize

public boolean couldSerialize()

hasGetter

public abstract boolean hasGetter()

hasSetter

public abstract boolean hasSetter()

hasField

public abstract boolean hasField()

hasConstructorParameter

public abstract boolean hasConstructorParameter()

getGetter

public abstract AnnotatedMethod getGetter()

getSetter

public abstract AnnotatedMethod getSetter()

getField

public abstract AnnotatedField getField()

getConstructorParameter

public abstract AnnotatedParameter getConstructorParameter()

getAccessor

public abstract AnnotatedMember getAccessor()
Method used to find accessor (getter, field to access) to use for accessing value of the property. Null if no such member exists.


getMutator

public abstract AnnotatedMember getMutator()
Method used to find mutator (constructor parameter, setter, field) to use for changing value of the property. Null if no such member exists.


getPrimaryMember

public AnnotatedMember 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.

Since:
2.1

findViews

public Class<?>[] findViews()
Method used to find View-inclusion definitions for the property.


findReferenceType

public AnnotationIntrospector.ReferenceProperty findReferenceType()
Method used to find whether property is part of a bi-directional reference.


isTypeId

public boolean isTypeId()
Method used to check whether this logical property has a marker to indicate it should be used as the type id for polymorphic type handling.


findObjectIdInfo

public ObjectIdInfo findObjectIdInfo()
Method used to check whether this logical property indicates that value POJOs should be written using additional Object Identifier (or, when multiple references exist, all but first AS Object Identifier).


isRequired

public boolean isRequired()
Method used to check if this property is expected to have a value; and if none found, should either be considered invalid (and most likely fail deserialization), or handled by other means (by providing default value)



Copyright © 2012 FasterXML. All Rights Reserved.