Package org.apache.torque.generator.outlet.java

# Class StringInputOutlet

java.lang.Object
org.apache.torque.generator.outlet.OutletImpl
org.apache.torque.generator.outlet.java.OutletWithoutMergepoints
org.apache.torque.generator.outlet.java.StringInputOutlet

All Implemented Interfaces:
  `Outlet`

Direct Known Subclasses:
  `CamelbackOutlet`, `ConstantNameOutlet`, `PackageToPathOutlet`

public abstract class StringInputOutlet extends OutletWithoutMergepoints
A base class for a outlet which takes a String as input (not a Source Element as a normal outlet would).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StringInputOutlet(QualifiedName qualifiedName)`
  Constructs a singleInputOutlet.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected String`
  `getInput(ControllerState controllerState)`
  Retrieves the input from the different possibilities nputValue, inputOption, inputVariable, or inputSourceElement.
  `void`
  `setInputOption(String inputOption)`
  Sets the name of the option which should be used as input.
  `void`
  `setInputSourceElement(String inputSourceElement)`
  Sets the name of the source element which contains the attribute which should be used as input.
  `void`
  `setInputValue(String inputValue)`
  Sets the input value directly.
  `void`
  `setInputVariable(String inputVariable)`
  Sets the name of the variable which should be used as input.
  `void`
  `setSourceElementAttribute(String sourceElementAttribute)`
  Sets the name of the source element attribute from which the input should be read.

  ### Methods inherited from class org.apache.torque.generator.outlet.java.OutletWithoutMergepoints

  `addMergepointMapping, getMergepointMapping`

  ### Methods inherited from class org.apache.torque.generator.outlet.OutletImpl

  `afterExecute, beforeExecute, execute, getInputClass, getInputElementName, getMergepointMappings, getName, getVariable, mergepoint, setInputClass, setInputElementName, setMergepointMapping, setVariable, setVariable, toString`

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

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

- ## Constructor Details

  - ### StringInputOutlet

    public StringInputOutlet(QualifiedName qualifiedName)
    Constructs a singleInputOutlet.
    Parameters:
      `qualifiedName` - the name of the outlet.

- ## Method Details

  - ### setInputValue

    public void setInputValue(String inputValue)
    Sets the input value directly.
    Parameters:
      `inputValue` - the input value, or null if the direct input value should not be used.

  - ### setInputOption

    public void setInputOption(String inputOption)
    Sets the name of the option which should be used as input.
    Parameters:
      `inputOption` - the name of the option which contains the input, or null if no option should be used as input.

  - ### setInputVariable

    public void setInputVariable(String inputVariable)
    Sets the name of the variable which should be used as input.
    Parameters:
      `inputVariable` - the name of the variable which should be used as input, or null if no variable should be used as input.

  - ### setInputSourceElement

    public void setInputSourceElement(String inputSourceElement)
    Sets the name of the source element which contains the attribute which should be used as input.
    Parameters:
      `inputSourceElement` - the name of the source element, or null if no source element should be used as input.

  - ### setSourceElementAttribute

    public void setSourceElementAttribute(String sourceElementAttribute)
    Sets the name of the source element attribute from which the input should be read. Only used if inputsourceElement is not null.
    Parameters:
      `sourceElementAttribute` - the attribute from which the input is read.

  - ### getInput

    protected String getInput(ControllerState controllerState) throws GeneratorException
    Retrieves the input from the different possibilities nputValue, inputOption, inputVariable, or inputSourceElement.
    Parameters:
      `controllerState` - the current controller state.
    Returns:
      the retrieved value, not null.
    Throws:
      `GeneratorException` - if no possibility or more than one possibility is chosen, or if the desired input is not set(except when a variable is not set or set to null, this results in "" being returned)