org.apache.torque.generator.control

## Class TokenReplacer

- java.lang.Object
- - org.apache.torque.generator.control.TokenReplacer

- All Implemented Interfaces:
    StringProcessor

      public class TokenReplacer
      extends Object
      implements StringProcessor

  Replaces placeholder tokens like ${option:optionName} in a string by the resolved values. The escape character is the backslash (\). $Id: TokenReplacer.java 1856207 2019-03-25 15:40:01Z painter $

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static char` | `ESCAPE` The escape character.
    `static String` | `OPTION_PREFIX` The prefix for an option token.
    `static char` | `PREFIX_SEPARATOR` The separator between prefix and key.
    `static char` | `TOKEN_END` The character ending a token.
    `static char` | `TOKEN_START_1` First character of a Token start.
    `static char` | `TOKEN_START_2` Second character of a Token start.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TokenReplacer(ControllerState controllerState)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `process(String toProcess)` Resolves all Tokens ${option:optionName} and replaces them with the appropriate value.

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

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

- - ### Field Detail

    - #### TOKEN_START_1

          public static final char TOKEN_START_1

      First character of a Token start.
      See Also:
        Constant Field Values

    - #### TOKEN_START_2

          public static final char TOKEN_START_2

      Second character of a Token start.
      See Also:
        Constant Field Values

    - #### TOKEN_END

          public static final char TOKEN_END

      The character ending a token.
      See Also:
        Constant Field Values

    - #### ESCAPE

          public static final char ESCAPE

      The escape character.
      See Also:
        Constant Field Values

    - #### OPTION_PREFIX

          public static final String OPTION_PREFIX

      The prefix for an option token.
      See Also:
        Constant Field Values

    - #### PREFIX_SEPARATOR

          public static final char PREFIX_SEPARATOR

      The separator between prefix and key.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TokenReplacer

          public TokenReplacer(ControllerState controllerState)

      Parameters:
        `controllerState` - to init the token replacer

  - ### Method Detail

    - #### process

          public String process(String toProcess)

      Resolves all Tokens ${option:optionName} and replaces them with the appropriate value.
      Specified by:
        `process` in interface `StringProcessor`
      Parameters:
        `toProcess` - the String to remove tokens from, or null.
      Returns:
        the processed String.

Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.