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

# Klasse SourceElementToModelTransformer

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

Alle implementierten Schnittstellen:
  `SourceTransformer`

public class SourceElementToModelTransformer extends Object implements SourceTransformer
A Source transformer transforming a SourceElement graph to a typed model.

Version:
  $Id: $

- ## Feldübersicht

  Felder
  Modifizierer und Typ
  Feld
  Beschreibung
  `static final String`
  `NULL_ATTRIBUTE_FIELD_NAME`
  The field name in the model which is filled if the attribute name `null` appears in the source graph.

- ## Konstruktorübersicht

  Konstruktoren
  Konstruktor
  Beschreibung
  `SourceElementToModelTransformer()`
  Standard constructor.
  `SourceElementToModelTransformer(Class<?> modelRootClass)`
  Constructor defining the model root class.

- ## Methodenübersicht

  Modifizierer und Typ
  Methode
  Beschreibung
  `protected static Object`
  `getInstance(String className, UnitConfiguration unitConfiguration)`
  Creates an instance of a class.
  `void`
  `setIgnoreUnknownAttributes(boolean ignoreUnknownAttributes)`
  Sets whether to ignore unknown attributes in the source tree.
  `void`
  `setIgnoreUnknownElements(boolean ignoreUnknownElements)`
  Sets whether to ignore unknown elements in the source tree.
  `void`
  `setModelRootClass(String modelRootClass)`
  Sets the class which the model root must have.
  `Object`
  `transform(Object modelRoot, ControllerState controllerState)`
  Transforms one source root into another source root.

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

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

- ## Felddetails

  - ### NULL_ATTRIBUTE_FIELD_NAME

    public static final String NULL_ATTRIBUTE_FIELD_NAME
    The field name in the model which is filled if the attribute name `null` appears in the source graph.
    Siehe auch:
      - Konstantenfeldwerte

- ## Konstruktordetails

  - ### SourceElementToModelTransformer

    public SourceElementToModelTransformer()
    Standard constructor.

  - ### SourceElementToModelTransformer

    public SourceElementToModelTransformer(Class<?> modelRootClass)
    Constructor defining the model root class.
    Parameter:
      `modelRootClass` - the model root class, not null.

- ## Methodendetails

  - ### setModelRootClass

    public void setModelRootClass(String modelRootClass)
    Sets the class which the model root must have.
    Parameter:
      `modelRootClass` - the class the model root must have, or null for any class

  - ### setIgnoreUnknownAttributes

    public void setIgnoreUnknownAttributes(boolean ignoreUnknownAttributes)
    Sets whether to ignore unknown attributes in the source tree.
    Parameter:
      `ignoreUnknownAttributes` - true if unknown attributes should be ignored, false otherwise.

  - ### setIgnoreUnknownElements

    public void setIgnoreUnknownElements(boolean ignoreUnknownElements)
    Sets whether to ignore unknown elements in the source tree.
    Parameter:
      `ignoreUnknownElements` - true if unknown elements should be ignored, false otherwise.

  - ### transform

    public Object transform(Object modelRoot, ControllerState controllerState) throws SourceTransformerException
    Beschreibung aus Schnittstelle kopiert: `SourceTransformer`
    Transforms one source root into another source root. It is allowed to modify the toTransformRoot tree and return the same tree.
    Angegeben von:
      `transform` in Schnittstelle `SourceTransformer`
    Parameter:
      `modelRoot` - the root object to fill, not null.
      `controllerState` - the controller state object
    Gibt zurück:
      the transformed source root, not null.
    Löst aus:
      `SourceTransformerException` - if filling the source graph fails, e.g. if an attribute name or element name has no corresponding field in a model element.
    Siehe auch:
      - `Transforms the source graph into the model. This is done by recursively walking through the source graph and setting the fields corresponding to the names of the attributes resp. child elements.`

  - ### getInstance

    protected static Object getInstance(String className, UnitConfiguration unitConfiguration) throws SourceTransformerException
    Creates an instance of a class.
    Parameter:
      `className` - the fully qualified name of the class to instantiate.
      `unitConfiguration` - The configuration of the generation unit, not null.
    Gibt zurück:
      the instance of the class
    Löst aus:
      `SourceTransformerException` - if the class cannot be instantiated.