com.fasterxml.jackson.databind

## Class PropertyName

- java.lang.Object
- - com.fasterxml.jackson.databind.PropertyName

- All Implemented Interfaces:
    Serializable

      public class PropertyName
      extends Object
      implements Serializable

  Simple value class used for containing names of properties as defined by annotations (and possibly other configuration sources).
  Since:
    2.1
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected com.fasterxml.jackson.core.SerializableString` | `_encodedSimple` Lazily-constructed efficient representation of the simple name.
    `protected String` | `_namespace` Additional namespace, for formats that have such concept (JSON does not, XML does, for example).
    `protected String` | `_simpleName` Basic name of the property.
    `static PropertyName` | `NO_NAME` Special placeholder value that indicates that there is no name associated.
    `static PropertyName` | `USE_DEFAULT` Special placeholder value that indicates that name to use should be based on the standard heuristics.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PropertyName(String simpleName)`
    `PropertyName(String simpleName, String namespace)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static PropertyName` | `construct(String simpleName, String ns)`
    `boolean` | `equals(Object o)`
    `String` | `getNamespace()`
    `String` | `getSimpleName()`
    `int` | `hashCode()`
    `boolean` | `hasNamespace()`
    `boolean` | `hasSimpleName()`
    `boolean` | `hasSimpleName(String str)`
    `PropertyName` | `internSimpleName()`
    `boolean` | `isEmpty()` Method that is basically equivalent of:
    `protected Object` | `readResolve()`
    `com.fasterxml.jackson.core.SerializableString` | `simpleAsEncoded(MapperConfig<?> config)` Accessor that may be used to get lazily-constructed efficient representation of the simple name.
    `String` | `toString()`
    `PropertyName` | `withNamespace(String ns)` Fluent factory method for constructing an instance with different namespace.
    `PropertyName` | `withSimpleName(String simpleName)` Fluent factory method for constructing an instance with different simple name.

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

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

- - ### Field Detail

    - #### USE_DEFAULT

          public static final PropertyName USE_DEFAULT

      Special placeholder value that indicates that name to use should be based on the standard heuristics. This can be different from returning null, as null means "no information available, whereas this value indicates explicit defaulting.

    - #### NO_NAME

          public static final PropertyName NO_NAME

      Special placeholder value that indicates that there is no name associated. Exact semantics to use (if any) depend on actual annotation in use, but commonly this value disables behavior for which name would be needed.

    - #### _simpleName

          protected final String _simpleName

      Basic name of the property.

    - #### _namespace

          protected final String _namespace

      Additional namespace, for formats that have such concept (JSON does not, XML does, for example).

    - #### _encodedSimple

          protected com.fasterxml.jackson.core.SerializableString _encodedSimple

      Lazily-constructed efficient representation of the simple name.

      NOTE: not defined as volatile to avoid performance problem with concurrent access in multi-core environments; due to statelessness of `SerializedString` at most leads to multiple instantiations.

      Since:
        2.4

  - ### Constructor Detail

    - #### PropertyName

          public PropertyName(String simpleName)

    - #### PropertyName

          public PropertyName(String simpleName,
                      String namespace)

  - ### Method Detail

    - #### readResolve

          protected Object readResolve()

    - #### construct

          public static PropertyName construct(String simpleName,
                               String ns)

    - #### internSimpleName

          public PropertyName internSimpleName()

    - #### withSimpleName

          public PropertyName withSimpleName(String simpleName)

      Fluent factory method for constructing an instance with different simple name.

    - #### withNamespace

          public PropertyName withNamespace(String ns)

      Fluent factory method for constructing an instance with different namespace.

    - #### getSimpleName

          public String getSimpleName()

    - #### simpleAsEncoded

          public com.fasterxml.jackson.core.SerializableString simpleAsEncoded(MapperConfig<?> config)

      Accessor that may be used to get lazily-constructed efficient representation of the simple name.
      Since:
        2.4

    - #### getNamespace

          public String getNamespace()

    - #### hasSimpleName

          public boolean hasSimpleName()

    - #### hasSimpleName

          public boolean hasSimpleName(String str)

      Since:
        2.3

    - #### hasNamespace

          public boolean hasNamespace()

    - #### isEmpty

          public boolean isEmpty()

      Method that is basically equivalent of:

             !hasSimpleName() && !hasNamespace();

      Since:
        2.4

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2014-2015 FasterXML. All Rights Reserved.