com.fasterxml.jackson.databind.util

## Class NameTransformer

- java.lang.Object
- - com.fasterxml.jackson.databind.util.NameTransformer

- Direct Known Subclasses:
    NameTransformer.Chained, NameTransformer.NopTransformer

      public abstract class NameTransformer
      extends java.lang.Object

  Helper class used to encapsulate details of name mangling, transforming of names using different strategies (prefixes, suffixes). Default implementation is "no-operation" (aka identity transformation).

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `NameTransformer.Chained`
    `protected static class` | `NameTransformer.NopTransformer`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static NameTransformer` | `NOP` Singleton "no-operation" transformer which simply returns given name as is.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `NameTransformer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static NameTransformer` | `chainedTransformer(NameTransformer t1, NameTransformer t2)` Method that constructs transformer that applies given transformers as a sequence; essentially combines separate transform operations into one logical transformation.
    `abstract java.lang.String` | `reverse(java.lang.String transformed)` Method called when reversal of transformation is needed; should return null if this is not possible, that is, given name can not have been result of calling `transform(java.lang.String)` of this object.
    `static NameTransformer` | `simpleTransformer(java.lang.String prefix, java.lang.String suffix)` Factory method for constructing a simple transformer based on prefix and/or suffix.
    `abstract java.lang.String` | `transform(java.lang.String name)` Method called when (forward) transformation is needed.

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

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

- - ### Field Detail

    - #### NOP

          public static final NameTransformer NOP

      Singleton "no-operation" transformer which simply returns given name as is. Used commonly as placeholder or marker.

  - ### Constructor Detail

    - #### NameTransformer

          protected NameTransformer()

  - ### Method Detail

    - #### simpleTransformer

          public static NameTransformer simpleTransformer(java.lang.String prefix,
                                          java.lang.String suffix)

      Factory method for constructing a simple transformer based on prefix and/or suffix.

    - #### chainedTransformer

          public static NameTransformer chainedTransformer(NameTransformer t1,
                                           NameTransformer t2)

      Method that constructs transformer that applies given transformers as a sequence; essentially combines separate transform operations into one logical transformation.

    - #### transform

          public abstract java.lang.String transform(java.lang.String name)

      Method called when (forward) transformation is needed.

    - #### reverse

          public abstract java.lang.String reverse(java.lang.String transformed)

      Method called when reversal of transformation is needed; should return null if this is not possible, that is, given name can not have been result of calling `transform(java.lang.String)` of this object.