public class TransformationUnit extends Object
Each transformation unit describes the way a program can be used in order to perform a transformation from a source to a target content type. The program is the one that the transformation program, in which the transformation unit belongs to, references. The transformation unit determines the behaviour of each program by passing to it the proper program parameters.
Transformation units may reference other (external) transformation units and use them as �black-box� components in the transformation process. Each transformation unit is identified by the pair (transformation program id, transformation unit id).
| Constructor and Description |
|---|
TransformationUnit() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBridge(String id)
Adds a new data bridge to this TU.
|
void |
bindHandler(String id,
DataHandler handler)
Binds an id of a data handler with a data handler instance.
|
boolean |
containsHandler(String id)
Checks if a handler with id id is contained in this TU.
|
void |
fromDOM(Element transformation) |
DataHandler |
getDataHandler(String id)
Returns the instance of a data handler by its id.
|
ArrayList<ExtTransformationUnit> |
getExtTransformationList()
Returns the references to external TUs.
|
String |
getId()
Returns the id of the transformation unit.
|
ArrayList<HandlerDesc> |
getIOs()
Returns all the handler descriptions of this TU.
|
ArrayList<Parameter> |
getProgramParameters()
Returns the program parameters.
|
ArrayList<Source> |
getSources()
Returns the sources of the transformation unit.
|
Target |
getTarget()
Returns the target of the transformation unit.
|
TransformationProgram |
getTransformationProgram()
Returns the transformation program in which this TU is contained.
|
boolean |
isComposite() |
List<Parameter> |
mergeProgramParameters()
Merges the global and the program parameters contained in a
TransformationUnit into one List. |
void |
setComposite(boolean isComposite) |
void |
setExtTransformationList(ArrayList<ExtTransformationUnit> extTransformationList)
Sets the references to external TUs.
|
void |
setId(String id)
Sets the id of the transformation unit.
|
void |
setProgramParameters(ArrayList<Parameter> programParameters)
Sets the program parameters.
|
void |
setSources(ArrayList<Source> sources)
Sets the sources of the transformation unit.
|
void |
setTarget(Target target)
Sets the target of the transformation unit.
|
void |
setTransformationProgram(TransformationProgram transformationProgram)
Sets the transformation program in which this TU is contained.
|
void |
toDOM(Element tp) |
public ArrayList<Parameter> getProgramParameters()
public void setProgramParameters(ArrayList<Parameter> programParameters)
programParameters - the program parameters.public void fromDOM(Element transformation)
public void toDOM(Element tp)
public ArrayList<ExtTransformationUnit> getExtTransformationList()
public void setExtTransformationList(ArrayList<ExtTransformationUnit> extTransformationList)
extTransformationList - the references to external TUs.public String getId()
public void setId(String id)
id - The id of the transformation unit.public boolean isComposite()
public void setComposite(boolean isComposite)
isComposite - if the TU is composite.public ArrayList<Source> getSources()
public void setSources(ArrayList<Source> sources)
sources - the sources of the transformation unit.public Target getTarget()
public void setTarget(Target target)
target - the target of the transformation unit.public TransformationProgram getTransformationProgram()
public void setTransformationProgram(TransformationProgram transformationProgram)
transformationProgram - the transformation program in which this TU is contained.public ArrayList<HandlerDesc> getIOs()
public void addBridge(String id)
id - The id of this bridge.public boolean containsHandler(String id)
id - The id to be checked.public void bindHandler(String id, DataHandler handler) throws Exception
id - The id of the handler.handler - The data handler instance.Exception - If the id already exists.public DataHandler getDataHandler(String id) throws Exception
id - The id of the handler.Exception - If the handler could not be found.public List<Parameter> mergeProgramParameters()
Merges the global and the program parameters contained in a TransformationUnit into one List.
The program parameters of the TransformationUnit have higher priority in comparison with the grobalProgramParameters.
globalProgramParameters - The global program parameters.tUnitProgramParameters - The program parameters set by the TransformationUnit.List with the merged program parameters.Copyright © 2014. All Rights Reserved.