com.fasterxml.jackson.databind.introspect

## Class POJOPropertyBuilder

- java.lang.Object
- - com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition
  - - com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder

All Implemented Interfaces:
  Named, Comparable<POJOPropertyBuilder>

    public class POJOPropertyBuilder
    extends BeanPropertyDefinition
    implements Comparable<POJOPropertyBuilder>

Helper class used for aggregating information about a single potential POJO property.

### Field Summary

Fields
`protected AnnotationIntrospector` `_annotationIntrospector`
`protected com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.Linked<AnnotatedParameter>` `_ctorParameters`
`protected com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.Linked<AnnotatedField>` `_fields`
`protected boolean` `_forSerialization` Whether property is being composed for serialization (true) or deserialization (false)
`protected com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.Linked<AnnotatedMethod>` `_getters`
`protected String` `_internalName` Original internal name, derived from accessor, of this property.
`protected String` `_name` External name of logical property; may change with renaming (by new instance being constructed using a new name)
`protected com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.Linked<AnnotatedMethod>` `_setters`

### Constructor Summary

Constructors
Constructor and Description
`POJOPropertyBuilder(POJOPropertyBuilder src, String newName)`
`POJOPropertyBuilder(String internalName, AnnotationIntrospector annotationIntrospector, boolean forSerialization)`

### Method Summary

Methods
`void` `addAll(POJOPropertyBuilder src)` Method for adding all property members from specified collector into this collector.
`void` `addCtor(AnnotatedParameter a, String ename, boolean visible, boolean ignored)`
`void` `addField(AnnotatedField a, String ename, boolean visible, boolean ignored)`
`void` `addGetter(AnnotatedMethod a, String ename, boolean visible, boolean ignored)`
`void` `addSetter(AnnotatedMethod a, String ename, boolean visible, boolean ignored)`
`boolean` `anyIgnorals()`
`boolean` `anyVisible()`
`int` `compareTo(POJOPropertyBuilder other)`
`boolean` `couldSerialize()`
`String` `findNewName()` Method called to check whether property represented by this collector should be renamed from the implicit name; and also verify that there are no conflicting rename definitions.
`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.
`protected <T> T` `fromMemberAnnotations(com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.WithMember<T> func)` Helper method used for finding annotation values, from accessors relevant to current usage (deserialization, serialization)
`AnnotatedMember` `getAccessor()` Method used to find accessor (getter, field to access) to use for accessing value of the property.
`AnnotatedParameter` `getConstructorParameter()`
`AnnotatedField` `getField()`
`AnnotatedMethod` `getGetter()`
`String` `getInternalName()` Accessor that can be used to determine implicit name from underlying element(s) before possible renaming.
`AnnotatedMember` `getMutator()` Method used to find mutator (constructor parameter, setter, field) to use for changing value of the property.
`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.
`AnnotatedMethod` `getSetter()`
`boolean` `hasConstructorParameter()`
`boolean` `hasField()`
`boolean` `hasGetter()`
`boolean` `hasSetter()`
`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.
`void` `mergeAnnotations(boolean forSerialization)`
`void` `removeIgnored()` Method called to remove all entries that are marked as ignored.
`void` `removeNonVisible()`
`String` `toString()`
`void` `trimByVisibility()` Method called to trim unnecessary entries, such as implicit getter if there is an explict one available.
`POJOPropertyBuilder` `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 `BeanPropertyDefinition.getName()` would return `newName`.

### Methods inherited from class com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition

`couldDeserialize`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### _forSerialization

    protected final boolean _forSerialization

Whether property is being composed for serialization (true) or deserialization (false)

#### _annotationIntrospector

    protected final AnnotationIntrospector _annotationIntrospector

#### _name

    protected final String _name

External name of logical property; may change with renaming (by new instance being constructed using a new name)

#### _internalName

    protected final String _internalName

Original internal name, derived from accessor, of this property. Will not be changed by renaming.

#### _fields

    protected com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.Linked<AnnotatedField> _fields

#### _ctorParameters

    protected com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.Linked<AnnotatedParameter> _ctorParameters

#### _getters

    protected com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.Linked<AnnotatedMethod> _getters

#### _setters

    protected com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.Linked<AnnotatedMethod> _setters

### Constructor Detail

#### POJOPropertyBuilder

    public POJOPropertyBuilder(String internalName,
                       AnnotationIntrospector annotationIntrospector,
                       boolean forSerialization)

#### POJOPropertyBuilder

    public POJOPropertyBuilder(POJOPropertyBuilder src,
                       String newName)

### Method Detail

#### withName

    public POJOPropertyBuilder withName(String newName)

Description copied from class: `BeanPropertyDefinition`
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 `BeanPropertyDefinition.getName()` would return `newName`.

Specified by:
  `withName` in class `BeanPropertyDefinition`

#### compareTo

    public int compareTo(POJOPropertyBuilder other)

Specified by:
  `compareTo` in interface `Comparable<POJOPropertyBuilder>`

#### getName

    public String getName()

Description copied from class: `BeanPropertyDefinition`
Accessor for name used for external representation (in JSON).

Specified by:
  `getName` in interface `Named`
Specified by:
  `getName` in class `BeanPropertyDefinition`

#### getInternalName

    public String getInternalName()

Description copied from class: `BeanPropertyDefinition`
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.

Specified by:
  `getInternalName` in class `BeanPropertyDefinition`

#### isExplicitlyIncluded

    public boolean isExplicitlyIncluded()

Description copied from class: `BeanPropertyDefinition`
Accessor that can be called to check whether property was included due to an explicit marker (usually annotation), or just by naming convention.

Specified by:
  `isExplicitlyIncluded` in class `BeanPropertyDefinition`
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)

#### hasGetter

    public boolean hasGetter()

Specified by:
  `hasGetter` in class `BeanPropertyDefinition`

#### hasSetter

    public boolean hasSetter()

Specified by:
  `hasSetter` in class `BeanPropertyDefinition`

#### hasField

    public boolean hasField()

Specified by:
  `hasField` in class `BeanPropertyDefinition`

#### hasConstructorParameter

    public boolean hasConstructorParameter()

Specified by:
  `hasConstructorParameter` in class `BeanPropertyDefinition`

#### couldSerialize

    public boolean couldSerialize()

Overrides:
  `couldSerialize` in class `BeanPropertyDefinition`

#### getGetter

    public AnnotatedMethod getGetter()

Specified by:
  `getGetter` in class `BeanPropertyDefinition`

#### getSetter

    public AnnotatedMethod getSetter()

Specified by:
  `getSetter` in class `BeanPropertyDefinition`

#### getField

    public AnnotatedField getField()

Specified by:
  `getField` in class `BeanPropertyDefinition`

#### getConstructorParameter

    public AnnotatedParameter getConstructorParameter()

Specified by:
  `getConstructorParameter` in class `BeanPropertyDefinition`

#### getAccessor

    public AnnotatedMember getAccessor()

Description copied from class: `BeanPropertyDefinition`
Method used to find accessor (getter, field to access) to use for accessing value of the property. Null if no such member exists.

Specified by:
  `getAccessor` in class `BeanPropertyDefinition`

#### getMutator

    public AnnotatedMember getMutator()

Description copied from class: `BeanPropertyDefinition`
Method used to find mutator (constructor parameter, setter, field) to use for changing value of the property. Null if no such member exists.

Specified by:
  `getMutator` in class `BeanPropertyDefinition`

#### getPrimaryMember

    public AnnotatedMember getPrimaryMember()

Description copied from class: `BeanPropertyDefinition`
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.

Overrides:
  `getPrimaryMember` in class `BeanPropertyDefinition`

#### findViews

    public Class<?>[] findViews()

Description copied from class: `BeanPropertyDefinition`
Method used to find View-inclusion definitions for the property.

Overrides:
  `findViews` in class `BeanPropertyDefinition`

#### findReferenceType

    public AnnotationIntrospector.ReferenceProperty findReferenceType()

Description copied from class: `BeanPropertyDefinition`
Method used to find whether property is part of a bi-directional reference.

Overrides:
  `findReferenceType` in class `BeanPropertyDefinition`

#### isTypeId

    public boolean isTypeId()

Description copied from class: `BeanPropertyDefinition`
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.

Overrides:
  `isTypeId` in class `BeanPropertyDefinition`

#### isRequired

    public boolean isRequired()

Description copied from class: `BeanPropertyDefinition`
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)

Overrides:
  `isRequired` in class `BeanPropertyDefinition`

#### findObjectIdInfo

    public ObjectIdInfo findObjectIdInfo()

Description copied from class: `BeanPropertyDefinition`
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).

Overrides:
  `findObjectIdInfo` in class `BeanPropertyDefinition`

#### addField

    public void addField(AnnotatedField a,
                String ename,
                boolean visible,
                boolean ignored)

#### addCtor

    public void addCtor(AnnotatedParameter a,
               String ename,
               boolean visible,
               boolean ignored)

#### addGetter

    public void addGetter(AnnotatedMethod a,
                 String ename,
                 boolean visible,
                 boolean ignored)

#### addSetter

    public void addSetter(AnnotatedMethod a,
                 String ename,
                 boolean visible,
                 boolean ignored)

#### addAll

    public void addAll(POJOPropertyBuilder src)

Method for adding all property members from specified collector into this collector.

#### removeIgnored

    public void removeIgnored()

Method called to remove all entries that are marked as ignored.

#### removeNonVisible

    public void removeNonVisible()

#### trimByVisibility

    public void trimByVisibility()

Method called to trim unnecessary entries, such as implicit getter if there is an explict one available. This is important for later stages, to avoid unnecessary conflicts.

#### mergeAnnotations

    public void mergeAnnotations(boolean forSerialization)

#### anyVisible

    public boolean anyVisible()

#### anyIgnorals

    public boolean anyIgnorals()

#### findNewName

    public String findNewName()

Method called to check whether property represented by this collector should be renamed from the implicit name; and also verify that there are no conflicting rename definitions.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### fromMemberAnnotations

    protected <T> T fromMemberAnnotations(com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.WithMember<T> func)

Helper method used for finding annotation values, from accessors relevant to current usage (deserialization, serialization)