Klasse OutletImpl

java.lang.Object
org.apache.torque.generator.outlet.OutletImpl
Alle implementierten Schnittstellen:
Outlet
Bekannte direkte Unterklassen:
CopyOutlet, JavadocOutlet, JavaFilenameOutlet, ModifySourcenameOutlet, OutletWithoutMergepoints, TemplateOutletImpl

public abstract class OutletImpl extends Object implements Outlet
Implementation of the features in the Outlet interface which do not depend on type of Outlet.
  • Konstruktordetails

    • OutletImpl

      public OutletImpl(QualifiedName name)
      Constructs a OutletImpl with the given name.
      Parameter:
      name - the name of this outlet, not null.
      Löst aus:
      NullPointerException - if name is null.
  • Methodendetails

    • getName

      public QualifiedName getName()
      Beschreibung aus Schnittstelle kopiert: Outlet
      Returns the name of the outlet. The namespace part of the name defines the default context of the outlet.
      Angegeben von:
      getName in Schnittstelle Outlet
      Gibt zurück:
      the name of the outlet, not null.
    • getInputElementName

      public String getInputElementName()
      Beschreibung aus Schnittstelle kopiert: Outlet
      Returns the name of the input root element. If not null, the outlet checks if the name of the input root element corresponds to the set element name and throws an exception if the names do not match.
      Angegeben von:
      getInputElementName in Schnittstelle Outlet
      Gibt zurück:
      inputName the name of the root element of the source, or if any input name is accepted.
    • setInputElementName

      public void setInputElementName(String inputElementName)
      Beschreibung aus Schnittstelle kopiert: Outlet
      Sets the name of the input root element. If set, the outlet checks if the name of the input root element corresponds to the set element name and throws an exception if the names do not match.
      Angegeben von:
      setInputElementName in Schnittstelle Outlet
      Parameter:
      inputElementName - the name of the root element of the source, or null to accept any input name.
    • getInputClass

      public String getInputClass()
      Beschreibung aus Schnittstelle kopiert: Outlet
      Returns the fully qualified name of the input root class. If not null, the outlet checks if the class name of the input root corresponds to the set class name and throws an exception if the names do not match.
      Angegeben von:
      getInputClass in Schnittstelle Outlet
      Gibt zurück:
      inputName the name of the root element of the source, or if any input name is accepted.
    • setInputClass

      public void setInputClass(String inputClass)
      Beschreibung aus Schnittstelle kopiert: Outlet
      Sets the fully qualified name of the input model root class. If set, the outlet checks if the class name of the input model root corresponds to the set class name and throws an exception if the names do not match.
      Angegeben von:
      setInputClass in Schnittstelle Outlet
      Parameter:
      inputClass - the name of the root element of the source, or null to accept any input name.
    • addMergepointMapping

      public void addMergepointMapping(MergepointMapping mergepointMapping) throws ConfigurationException
      Adds an mergepoint mapping to the outlet. No mergepoint mappings must exist with the given name.
      Angegeben von:
      addMergepointMapping in Schnittstelle Outlet
      Parameter:
      mergepointMapping - the mergepointMapping to add, not null.
      Löst aus:
      NullPointerException - if mergepointMapping is null.
      ConfigurationException - if an mergepointMapping for the given name already exists.
    • setMergepointMapping

      public MergepointMapping setMergepointMapping(MergepointMapping mergepointMapping)
      Sets an mergepoint mapping in the outlet. If a mergepoint mapping with the given name already exists, it is replaced.
      Angegeben von:
      setMergepointMapping in Schnittstelle Outlet
      Parameter:
      mergepointMapping - the mergepointMapping to add, not null.
      Gibt zurück:
      the replaced mergepoint mapping, not null.
      Löst aus:
      NullPointerException - if mergepointMapping is null.
    • getMergepointMapping

      public MergepointMapping getMergepointMapping(String name)
      Returns the mergepoint mapping for the given mergepoint name.
      Angegeben von:
      getMergepointMapping in Schnittstelle Outlet
      Parameter:
      name - the name of the mergepoint mapping.
      Gibt zurück:
      the mergepoint mapping for the given name, or null if no mergepoint mapping exists for this name.
    • getMergepointMappings

      public Map<String,MergepointMapping> getMergepointMappings()
      Beschreibung aus Schnittstelle kopiert: Outlet
      Returns the map of all mergepoint mappings, keyed by their name.
      Angegeben von:
      getMergepointMappings in Schnittstelle Outlet
      Gibt zurück:
      the map of mergepoint mappings, not null.
    • beforeExecute

      public void beforeExecute(ControllerState controllerState) throws GeneratorException
      Beschreibung aus Schnittstelle kopiert: Outlet
      Adjusts the state of the Controller before generation.
      Angegeben von:
      beforeExecute in Schnittstelle Outlet
      Parameter:
      controllerState - the current controller state, not null.
      Löst aus:
      GeneratorException - if adjusting the controller state fails.
    • afterExecute

      public void afterExecute(ControllerState controllerState)
      Beschreibung aus Schnittstelle kopiert: Outlet
      Adjusts the state of the Controller after generation.
      Angegeben von:
      afterExecute in Schnittstelle Outlet
      Parameter:
      controllerState - the current controller state, not null.
    • execute

      public abstract OutletResult execute(ControllerState controllerState) throws GeneratorException
      Beschreibung aus Schnittstelle kopiert: Outlet
      Generates the output for this template into the Generated object.
      Angegeben von:
      execute in Schnittstelle Outlet
      Parameter:
      controllerState - the current controller state, not null.
      Gibt zurück:
      the output of the Outlet.
      Löst aus:
      GeneratorException - if generation fails.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • setVariable

      public void setVariable(String key, Object value, ControllerState controllerState)
      Sets a variable. The key can be given with or without namespace; in the latter case, the variable is set in the namespace of this outlet. The scope of the variable is this outlet and its children.
      Parameter:
      key - the name of the variable, not null
      value - the value of the variable, may be null.
      controllerState - the context of the controller, not null.
      Löst aus:
      NullPointerException - if key, scope or controllerState is null.
      IllegalArgumentException - if the key is no valid QualifiedName.
    • setVariable

      public void setVariable(String key, Object value, Variable.Scope scope, ControllerState controllerState)
      Sets a variable. The key can be given with or without namespace; in the latter case, the variable is set in the namespace of this outlet.
      Parameter:
      key - the name of the variable, not null.
      value - the value of the variable, may be null.
      scope - the scope of the variable, not null.
      controllerState - the context of the controller, not null.
      Löst aus:
      NullPointerException - if key or scope is null.
      IllegalArgumentException - if the key is no valid QualifiedName.
    • getVariable

      public Object getVariable(String key, ControllerState controllerState)
      Returns the variable with the given key. The key can either be a name prefixed with a namespace, or a name without namespace, in which case the namespace of the outlet is used. In the case that the variable is not set in this namespace, the parent namespaces are searched recursively. If the variable is not set in any of the parent namespaces, null is returned.
      Parameter:
      key - the key for the variable to retrieve.
      controllerState - the context of the controller, not null.
      Gibt zurück:
      the variable for the given key, or null if the variable is not set or explicitly set to null.
    • mergepoint

      public String mergepoint(String mergepointName, ControllerState controllerState) throws GeneratorException
      Processes the mergepoint with the given name.
      Parameter:
      mergepointName - the name of the mergepoint.
      controllerState - the context of the controller, not null.
      Gibt zurück:
      the output generated by the mergepoint.
      Löst aus:
      GeneratorException - if the mergepoint could not be processed completely.