Package org.apache.torque.generator.source.transform

# Klasse SourceTargetAttributeTransformer

java.lang.Object
org.apache.torque.generator.source.transform.SourceTargetAttributeTransformer

Alle implementierten Schnittstellen:
  `SourceTransformer`

Bekannte direkte Unterklassen:
  `BeanPropertyMethodNameTransformer`, `CopyAttributeTransformer`

public abstract class SourceTargetAttributeTransformer extends Object implements SourceTransformer
A transformer which has a source attribute and a target attribute.

Version:
  $Id: SourceTargetAttributeTransformer.java 1839288 2018-08-27 09:48:33Z tv $

- ## Konstruktorübersicht

  Konstruktoren
  Konstruktor
  Beschreibung
  `SourceTargetAttributeTransformer()`
  Standard constructor.
  `SourceTargetAttributeTransformer(String sourceAttributeName, String targetAttributeName)`
  Constructor used to set default attribute names.

- ## Methodenübersicht

  Modifizierer und Typ
  Methode
  Beschreibung
  `String`
  `getSourceAttributeName()`
  Returns the name of the attribute which is read as Input.
  `String`
  `getTargetAttributeName()`
  Returns the name of the attribute into which the result is stored.
  `boolean`
  `isOverwrite()`
  Returns whether the content of the target attribute is overwritten if it exists.
  `void`
  `setOverwrite(boolean overwrite)`
  Sets whether the content of the target attribute should be overwritten if it exists.
  `void`
  `setSourceAttributeName(String sourceAttributeName)`
  Sets the name of the attribute which is read as Input.
  `void`
  `setTargetAttributeName(String targetAttributeName)`
  Sets the name of the attribute into which the result is stored.
  `abstract Object`
  `transform(Object toTransformRoot, ControllerState controllerState)`
  Performs the transformation.

  ### Von Klasse geerbte Methoden java.lang.Object

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

- ## Konstruktordetails

  - ### SourceTargetAttributeTransformer

    public SourceTargetAttributeTransformer()
    Standard constructor.

  - ### SourceTargetAttributeTransformer

    public SourceTargetAttributeTransformer(String sourceAttributeName, String targetAttributeName)
    Constructor used to set default attribute names.
    Parameter:
      `sourceAttributeName` - the default sourceAttributeName.
      `targetAttributeName` - the default targetAttributeName.

- ## Methodendetails

  - ### getSourceAttributeName

    public String getSourceAttributeName()
    Returns the name of the attribute which is read as Input.
    Gibt zurück:
      the name of the attribute which is read as Input.

  - ### setSourceAttributeName

    public void setSourceAttributeName(String sourceAttributeName)
    Sets the name of the attribute which is read as Input.
    Parameter:
      `sourceAttributeName` - the name of the attribute which is read as Input, not null.
    Löst aus:
      `NullPointerException` - if sourceAttributeName is null.

  - ### getTargetAttributeName

    public String getTargetAttributeName()
    Returns the name of the attribute into which the result is stored.
    Gibt zurück:
      the name of the attribute into which the result is stored.

  - ### setTargetAttributeName

    public void setTargetAttributeName(String targetAttributeName)
    Sets the name of the attribute into which the result is stored.
    Parameter:
      `targetAttributeName` - the name of the attribute into which the result is stored, not null.
    Löst aus:
      `NullPointerException` - if targetAttributeName is null.

  - ### isOverwrite

    public boolean isOverwrite()
    Returns whether the content of the target attribute is overwritten if it exists.
    Gibt zurück:
      true if the target is overwritten, false if it is only filled when not set.

  - ### setOverwrite

    public void setOverwrite(boolean overwrite)
    Sets whether the content of the target attribute should be overwritten if it exists.
    Parameter:
      `overwrite` - true if the target is overwritten, false if it is only filled when not set.

  - ### transform

    public abstract Object transform(Object toTransformRoot, ControllerState controllerState) throws SourceTransformerException
    Performs the transformation.
    Angegeben von:
      `transform` in Schnittstelle `SourceTransformer`
    Parameter:
      `toTransformRoot` - the root object of the source tree to transform, not null.
      `controllerState` - the state of the controller, not null.
    Gibt zurück:
      the root element of the transformed source tree, not null.
    Löst aus:
      `SourceTransformerException` - if the source cannot be transformed.
    Siehe auch:
      - `SourceTransformer.transform(Object, ControllerState)`