org.apache.torque.generator.control.action

## Class OptionAction

- java.lang.Object
- - org.apache.torque.generator.control.action.OptionAction

- All Implemented Interfaces:
    MergepointAction

      public class OptionAction
      extends Object
      implements MergepointAction

  Inserts the value of an option into a mergepoint.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OptionAction(String option, Boolean acceptNotSet)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `OutletResult` | `execute(ControllerState controllerState)` Returns the value of the configured option.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### OptionAction

          public OptionAction(String option,
                              Boolean acceptNotSet)

      Constructor.
      Parameters:
        `option` - the name of the option. May or may not be prefixed with a namespace (if no namespace is used, the namespace of the current outlet is used).
        `acceptNotSet` - true if it is acceptable that the option is not set, false if it is an error that the option is not set. null means true.

  - ### Method Detail

    - #### execute

          public OutletResult execute(ControllerState controllerState)
                               throws GeneratorException

      Returns the value of the configured option.
      Specified by:
        `execute` in interface `MergepointAction`
      Parameters:
        `controllerState` - the current state of the controller.
      Returns:
        The value of the option, or the empty String if acceptNotSet is true and the option is not set.
      Throws:
        `GeneratorException` - if acceptNotSet is false and the option is not set.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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