com.fasterxml.jackson.databind.util

## Class SimpleBeanPropertyDefinition

- java.lang.Object
- - com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition
  - - com.fasterxml.jackson.databind.util.SimpleBeanPropertyDefinition

- All Implemented Interfaces:
    Named

      public class SimpleBeanPropertyDefinition
      extends BeanPropertyDefinition

  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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected PropertyName` | `_fullName`
    `protected com.fasterxml.jackson.annotation.JsonInclude.Value` | `_inclusion`
    `protected AnnotationIntrospector` | `_introspector`
    `protected AnnotatedMember` | `_member` Member that defines logical property.
    `protected PropertyMetadata` | `_metadata`
    `protected java.lang.String` | `_name` Deprecated. Since 2.5 use `_fullName` instead.

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

      `EMPTY_INCLUDE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SimpleBeanPropertyDefinition(AnnotatedMember member, PropertyName fullName, AnnotationIntrospector intr, PropertyMetadata metadata, com.fasterxml.jackson.annotation.JsonInclude.Include inclusion)`
    `protected` | `SimpleBeanPropertyDefinition(AnnotatedMember member, PropertyName fullName, AnnotationIntrospector intr, PropertyMetadata metadata, com.fasterxml.jackson.annotation.JsonInclude.Value inclusion)`
    `protected` | `SimpleBeanPropertyDefinition(AnnotatedMember member, java.lang.String name, AnnotationIntrospector intr)` Deprecated. Since 2.5 Use variant that takes PropertyName

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SimpleBeanPropertyDefinition` | `construct(MapperConfig<?> config, AnnotatedMember member)`
    `static SimpleBeanPropertyDefinition` | `construct(MapperConfig<?> config, AnnotatedMember member, PropertyName name)`
    `static SimpleBeanPropertyDefinition` | `construct(MapperConfig<?> config, AnnotatedMember member, PropertyName name, PropertyMetadata metadata, com.fasterxml.jackson.annotation.JsonInclude.Include inclusion)`
    `static SimpleBeanPropertyDefinition` | `construct(MapperConfig<?> config, AnnotatedMember member, PropertyName name, PropertyMetadata metadata, com.fasterxml.jackson.annotation.JsonInclude.Value inclusion)`
    `static SimpleBeanPropertyDefinition` | `construct(MapperConfig<?> config, AnnotatedMember member, java.lang.String name)` Deprecated. Since 2.5
    `com.fasterxml.jackson.annotation.JsonInclude.Value` | `findInclusion()` Method used to check if this property has specific inclusion override associated with it or not.
    `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()` We will indicate that property is optional, since there is nothing to indicate whether it might be required.
    `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).
    `BeanPropertyDefinition` | `withInclusion(com.fasterxml.jackson.annotation.JsonInclude.Value inclusion)`
    `BeanPropertyDefinition` | `withMetadata(PropertyMetadata metadata)`
    `BeanPropertyDefinition` | `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`.
    `BeanPropertyDefinition` | `withName(java.lang.String newName)` Deprecated.
    `BeanPropertyDefinition` | `withSimpleName(java.lang.String newName)` 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

      `couldDeserialize, couldSerialize, findObjectIdInfo, findReferenceType, findViews, isRequired, isTypeId`

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

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

- - ### Field Detail

    - #### _introspector

          protected final AnnotationIntrospector _introspector

    - #### _member

          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.

    - #### _metadata

          protected final PropertyMetadata _metadata

      Since:
        2.5

    - #### _fullName

          protected final PropertyName _fullName

      Since:
        2.5

    - #### _inclusion

          protected final com.fasterxml.jackson.annotation.JsonInclude.Value _inclusion

      Since:
        2.5

    - #### _name

          @Deprecated
          protected final java.lang.String _name

      Deprecated. Since 2.5 use `_fullName` instead.

  - ### Constructor Detail

    - #### SimpleBeanPropertyDefinition

          protected SimpleBeanPropertyDefinition(AnnotatedMember member,
                                      PropertyName fullName,
                                      AnnotationIntrospector intr,
                                      PropertyMetadata metadata,
                                      com.fasterxml.jackson.annotation.JsonInclude.Include inclusion)

    - #### SimpleBeanPropertyDefinition

          protected SimpleBeanPropertyDefinition(AnnotatedMember member,
                                      PropertyName fullName,
                                      AnnotationIntrospector intr,
                                      PropertyMetadata metadata,
                                      com.fasterxml.jackson.annotation.JsonInclude.Value inclusion)

    - #### SimpleBeanPropertyDefinition

          @Deprecated
          protected SimpleBeanPropertyDefinition(AnnotatedMember member,
                                                 java.lang.String name,
                                                 AnnotationIntrospector intr)

      Deprecated. Since 2.5 Use variant that takes PropertyName

  - ### Method Detail

    - #### construct

          public static SimpleBeanPropertyDefinition construct(MapperConfig<?> config,
                                               AnnotatedMember member)

      Since:
        2.2

    - #### construct

          @Deprecated
          public static SimpleBeanPropertyDefinition construct(MapperConfig<?> config,
                                                          AnnotatedMember member,
                                                          java.lang.String name)

      Deprecated. Since 2.5

    - #### construct

          public static SimpleBeanPropertyDefinition construct(MapperConfig<?> config,
                                               AnnotatedMember member,
                                               PropertyName name)

      Since:
        2.5

    - #### construct

          public static SimpleBeanPropertyDefinition construct(MapperConfig<?> config,
                                               AnnotatedMember member,
                                               PropertyName name,
                                               PropertyMetadata metadata,
                                               com.fasterxml.jackson.annotation.JsonInclude.Include inclusion)

      Since:
        2.5

    - #### construct

          public static SimpleBeanPropertyDefinition construct(MapperConfig<?> config,
                                               AnnotatedMember member,
                                               PropertyName name,
                                               PropertyMetadata metadata,
                                               com.fasterxml.jackson.annotation.JsonInclude.Value inclusion)

      Since:
        2.7

    - #### withName

          @Deprecated
          public BeanPropertyDefinition withName(java.lang.String newName)

      Deprecated.

    - #### withSimpleName

          public BeanPropertyDefinition withSimpleName(java.lang.String newName)

      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`

    - #### withName

          public BeanPropertyDefinition 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`

    - #### withMetadata

          public BeanPropertyDefinition withMetadata(PropertyMetadata metadata)

      Since:
        2.5

    - #### withInclusion

          public BeanPropertyDefinition withInclusion(com.fasterxml.jackson.annotation.JsonInclude.Value inclusion)

      Since:
        2.5

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

    - #### getMetadata

          public PropertyMetadata getMetadata()

      We will indicate that property is optional, since there is nothing to indicate whether it might be required.
      Specified by:
        `getMetadata` 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`

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

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

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

      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`