POJOPropertyBuilder
Date: 2016-12-04

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, java.lang.Comparable<POJOPropertyBuilder>

      public class POJOPropertyBuilder
      extends BeanPropertyDefinition
      implements java.lang.Comparable<POJOPropertyBuilder>

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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `POJOPropertyBuilder.Linked<T>` Node used for creating simple linked lists to efficiently store small sets of things.
    `protected static class` | `POJOPropertyBuilder.MemberIterator<T extends AnnotatedMember>`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AnnotationIntrospector` | `_annotationIntrospector`
    `protected MapperConfig<?>` | `_config`
    `protected POJOPropertyBuilder.Linked<AnnotatedParameter>` | `_ctorParameters`
    `protected POJOPropertyBuilder.Linked<AnnotatedField>` | `_fields`
    `protected boolean` | `_forSerialization` Whether property is being composed for serialization (true) or deserialization (false)
    `protected POJOPropertyBuilder.Linked<AnnotatedMethod>` | `_getters`
    `protected PropertyName` | `_internalName` Original internal name, derived from accessor, of this property.
    `protected PropertyName` | `_name` External name of logical property; may change with renaming (by new instance being constructed using a new name)
    `protected POJOPropertyBuilder.Linked<AnnotatedMethod>` | `_setters`

    - ### Fields inherited from class com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition

      `EMPTY_INCLUDE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `POJOPropertyBuilder(MapperConfig<?> config, AnnotationIntrospector ai, boolean forSerialization, PropertyName internalName)`
    `protected` | `POJOPropertyBuilder(MapperConfig<?> config, AnnotationIntrospector ai, boolean forSerialization, PropertyName internalName, PropertyName name)`
    `` | `POJOPropertyBuilder(POJOPropertyBuilder src, PropertyName newName)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.String` | `_findDefaultValue()`
    `protected java.lang.String` | `_findDescription()`
    `protected java.lang.Integer` | `_findIndex()`
    `protected java.lang.Boolean` | `_findRequired()`
    `protected int` | `_getterPriority(AnnotatedMethod m)`
    `protected int` | `_setterPriority(AnnotatedMethod m)`
    `void` | `addAll(POJOPropertyBuilder src)` Method for adding all property members from specified collector into this collector.
    `void` | `addCtor(AnnotatedParameter a, PropertyName name, boolean explName, boolean visible, boolean ignored)`
    `void` | `addField(AnnotatedField a, PropertyName name, boolean explName, boolean visible, boolean ignored)`
    `void` | `addGetter(AnnotatedMethod a, PropertyName name, boolean explName, boolean visible, boolean ignored)`
    `void` | `addSetter(AnnotatedMethod a, PropertyName name, boolean explName, boolean visible, boolean ignored)`
    `boolean` | `anyIgnorals()`
    `boolean` | `anyVisible()`
    `int` | `compareTo(POJOPropertyBuilder other)`
    `boolean` | `couldDeserialize()`
    `boolean` | `couldSerialize()`
    `java.util.Collection<POJOPropertyBuilder>` | `explode(java.util.Collection<PropertyName> newNames)` Method called when a previous call to `findExplicitNames()` found multiple distinct explicit names, and the property this builder represents basically needs to be broken apart and replaced by a set of more than one properties.
    `com.fasterxml.jackson.annotation.JsonProperty.Access` | `findAccess()`
    `java.util.Set<PropertyName>` | `findExplicitNames()` Method called to find out set of explicit names for accessors bound together due to implicit name.
    `com.fasterxml.jackson.annotation.JsonInclude.Value` | `findInclusion()` Method used to check if this property has specific inclusion override associated with it or not.
    `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.
    `java.lang.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)
    `protected <T> T` | `fromMemberAnnotationsExcept(com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.WithMember<T> func, T defaultValue)`
    `AnnotatedMember` | `getAccessor()` Method used to find accessor (getter, field to access) to use for accessing value of the property.
    `AnnotatedParameter` | `getConstructorParameter()`
    `java.util.Iterator<AnnotatedParameter>` | `getConstructorParameters()` Additional method that may be called instead of `BeanPropertyDefinition.getConstructorParameter()` to get access to all constructor parameters, not just the highest priority one.
    `AnnotatedField` | `getField()`
    `PropertyName` | `getFullName()`
    `AnnotatedMethod` | `getGetter()`
    `java.lang.String` | `getInternalName()` Accessor that can be used to determine implicit name from underlying element(s) before possible renaming.
    `PropertyMetadata` | `getMetadata()` Method for accessing additional metadata.
    `AnnotatedMember` | `getMutator()` Method used to find mutator (constructor parameter, setter, field) to use for changing value of the property.
    `java.lang.String` | `getName()` Accessor for name used for external representation (in JSON).
    `AnnotatedMember` | `getNonConstructorMutator()`
    `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()`
    `PropertyName` | `getWrapperName()` Accessor for finding wrapper name to use for property (if any).
    `boolean` | `hasConstructorParameter()`
    `boolean` | `hasField()`
    `boolean` | `hasGetter()`
    `boolean` | `hasName(PropertyName name)`
    `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` | `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).
    `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` | `removeConstructors()` Mutator that will simply drop any constructor parameters property may have.
    `void` | `removeIgnored()` Method called to remove all entries that are marked as ignored.
    `void` | `removeNonVisible(boolean inferMutators)`
    `java.lang.String` | `toString()`
    `void` | `trimByVisibility()` Method called to trim unnecessary entries, such as implicit getter if there is an explict one available.
    `POJOPropertyBuilder` | `withName(PropertyName 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`.
    `POJOPropertyBuilder` | `withSimpleName(java.lang.String newSimpleName)` Alternate "mutant factory" that will only change simple name, but leave other optional parts (like namespace) as is.

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

      `isRequired`

    - ### 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)

    - #### _config

          protected final MapperConfig<?> _config

    - #### _annotationIntrospector

          protected final AnnotationIntrospector _annotationIntrospector

    - #### _name

          protected final PropertyName _name

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

    - #### _internalName

          protected final PropertyName _internalName

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

    - #### _fields

          protected POJOPropertyBuilder.Linked<AnnotatedField> _fields

    - #### _ctorParameters

          protected POJOPropertyBuilder.Linked<AnnotatedParameter> _ctorParameters

    - #### _getters

          protected POJOPropertyBuilder.Linked<AnnotatedMethod> _getters

    - #### _setters

          protected POJOPropertyBuilder.Linked<AnnotatedMethod> _setters

  - ### Constructor Detail

    - #### POJOPropertyBuilder

          public POJOPropertyBuilder(MapperConfig<?> config,
                             AnnotationIntrospector ai,
                             boolean forSerialization,
                             PropertyName internalName)

    - #### POJOPropertyBuilder

          protected POJOPropertyBuilder(MapperConfig<?> config,
                             AnnotationIntrospector ai,
                             boolean forSerialization,
                             PropertyName internalName,
                             PropertyName name)

    - #### POJOPropertyBuilder

          public POJOPropertyBuilder(POJOPropertyBuilder src,
                             PropertyName newName)

  - ### Method Detail

    - #### withName

          public POJOPropertyBuilder withName(PropertyName 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`

    - #### withSimpleName

          public POJOPropertyBuilder withSimpleName(java.lang.String newSimpleName)

      Description copied from class: `BeanPropertyDefinition`
      Alternate "mutant factory" that will only change simple name, but leave other optional parts (like namespace) as is.
      Specified by:
        `withSimpleName` in class `BeanPropertyDefinition`

    - #### compareTo

          public int compareTo(POJOPropertyBuilder other)

      Specified by:
        `compareTo` in interface `java.lang.Comparable<POJOPropertyBuilder>`

    - #### getName

          public java.lang.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`

    - #### getFullName

          public PropertyName getFullName()

      Specified by:
        `getFullName` in class `BeanPropertyDefinition`

    - #### hasName

          public boolean hasName(PropertyName name)

      Overrides:
        `hasName` in class `BeanPropertyDefinition`

    - #### getInternalName

          public java.lang.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`

    - #### getWrapperName

          public PropertyName getWrapperName()

      Description copied from class: `BeanPropertyDefinition`
      Accessor for finding wrapper name to use for property (if any).
      Specified by:
        `getWrapperName` 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)

    - #### isExplicitlyNamed

          public boolean isExplicitlyNamed()

      Description copied from class: `BeanPropertyDefinition`
      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 `BeanPropertyDefinition.isExplicitlyIncluded()`, but not necessarily vice versa.

      Overrides:
        `isExplicitlyNamed` in class `BeanPropertyDefinition`

    - #### 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`

    - #### couldDeserialize

          public boolean couldDeserialize()

      Overrides:
        `couldDeserialize` 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`

    - #### getConstructorParameters

          public java.util.Iterator<AnnotatedParameter> getConstructorParameters()

      Description copied from class: `BeanPropertyDefinition`
      Additional method that may be called instead of `BeanPropertyDefinition.getConstructorParameter()` to get access to all constructor parameters, not just the highest priority one.
      Overrides:
        `getConstructorParameters` 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`

    - #### getNonConstructorMutator

          public AnnotatedMember getNonConstructorMutator()

      Specified by:
        `getNonConstructorMutator` 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.

      Note: abstract since 2.5

      Specified by:
        `getPrimaryMember` in class `BeanPropertyDefinition`

    - #### _getterPriority

          protected int _getterPriority(AnnotatedMethod m)

    - #### _setterPriority

          protected int _setterPriority(AnnotatedMethod m)

    - #### findViews

          public java.lang.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`

    - #### getMetadata

          public PropertyMetadata getMetadata()

      Description copied from class: `BeanPropertyDefinition`
      Method for accessing additional metadata. NOTE: will never return null, so de-referencing return value is safe.
      Specified by:
        `getMetadata` in class `BeanPropertyDefinition`

    - #### _findRequired

          protected java.lang.Boolean _findRequired()

    - #### _findDescription

          protected java.lang.String _findDescription()

    - #### _findIndex

          protected java.lang.Integer _findIndex()

    - #### _findDefaultValue

          protected java.lang.String _findDefaultValue()

    - #### 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`

    - #### findInclusion

          public com.fasterxml.jackson.annotation.JsonInclude.Value findInclusion()

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

    - #### findAccess

          public com.fasterxml.jackson.annotation.JsonProperty.Access findAccess()

    - #### addField

          public void addField(AnnotatedField a,
                      PropertyName name,
                      boolean explName,
                      boolean visible,
                      boolean ignored)

    - #### addCtor

          public void addCtor(AnnotatedParameter a,
                     PropertyName name,
                     boolean explName,
                     boolean visible,
                     boolean ignored)

    - #### addGetter

          public void addGetter(AnnotatedMethod a,
                       PropertyName name,
                       boolean explName,
                       boolean visible,
                       boolean ignored)

    - #### addSetter

          public void addSetter(AnnotatedMethod a,
                       PropertyName name,
                       boolean explName,
                       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(boolean inferMutators)

      Parameters:
        `inferMutators` - Whether mutators can be "pulled in" by visible accessors or not.

    - #### removeConstructors

          public void removeConstructors()

      Mutator that will simply drop any constructor parameters property may have.
      Since:
        2.5

    - #### 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()

    - #### findExplicitNames

          public java.util.Set<PropertyName> findExplicitNames()

      Method called to find out set of explicit names for accessors bound together due to implicit name.
      Since:
        2.4

    - #### explode

          public java.util.Collection<POJOPropertyBuilder> explode(java.util.Collection<PropertyName> newNames)

      Method called when a previous call to `findExplicitNames()` found multiple distinct explicit names, and the property this builder represents basically needs to be broken apart and replaced by a set of more than one properties.
      Since:
        2.4

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.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)

    - #### fromMemberAnnotationsExcept

          protected <T> T fromMemberAnnotationsExcept(com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.WithMember<T> func,
                                          T defaultValue)