com.ashridgetech.jamda.transform
Class Transformation

java.lang.Object
  |
  +--com.ashridgetech.jamda.transform.Transformation

public class Transformation
extends java.lang.Object

Runs a transformation on an XMI UML file.

Author:
Paul Boocock version 1.0

Field Summary
static java.lang.String CONFIG_COMMENT_MARKER
           
 
Constructor Summary
Transformation()
          Construct a Transformation configured to do nothing.
 
Method Summary
 void addTransformer(ModelTransformer transformer)
          Add a new ModelTransformer to the configuration.
 java.util.List getModelTransformers()
          Get the ModelTransformers in this Transformation.
 java.io.File getOutputFile()
          Get the file to which a list of transformations applied is output
 java.io.File getStylesheetFile()
          Get the XSLT file used to process the input file before it is loaded
 Model run(java.io.File xmiFile)
          Run a transformation against a given XMI file.
 void run(Model inputModel)
          Run a transformation against a given Model.
 Model run(java.lang.String xmiFileName)
          Run a transformation against a given XMI file.
 void setOutputFile(java.io.File outputFile)
          Set the file to which a list of transformations applied is output
 void setStylesheetFile(java.io.File stylesheetFile)
          Set the XSLT file used to process the input file before it is loaded
static void xsltTransform(java.io.File inputFile, java.io.File outputFile, java.io.File stylesheet)
          Transform a given XML File to another using XSLT.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_COMMENT_MARKER

public static final java.lang.String CONFIG_COMMENT_MARKER
See Also:
Constant Field Values
Constructor Detail

Transformation

public Transformation()
Construct a Transformation configured to do nothing.

Method Detail

getOutputFile

public java.io.File getOutputFile()
Get the file to which a list of transformations applied is output

Returns:
the file - may be null

setOutputFile

public void setOutputFile(java.io.File outputFile)
Set the file to which a list of transformations applied is output

Parameters:
outputFile - - the file, may be null if no output file required

getStylesheetFile

public java.io.File getStylesheetFile()
Get the XSLT file used to process the input file before it is loaded

Returns:
the file - may be null

setStylesheetFile

public void setStylesheetFile(java.io.File stylesheetFile)
Set the XSLT file used to process the input file before it is loaded

Parameters:
stylesheetFile - - the file, may be null if no stylesheet file required

addTransformer

public void addTransformer(ModelTransformer transformer)
Add a new ModelTransformer to the configuration.

Parameters:
transformer - the ModelTransformer to add

getModelTransformers

public java.util.List getModelTransformers()
Get the ModelTransformers in this Transformation.

Returns:
an unmodifiable list of the ModelTransformers.

run

public Model run(java.lang.String xmiFileName)
          throws ModelTransformer.TransformException
Run a transformation against a given XMI file. Do not save the output. This method assumes that the output is written elsewhere by the transformation. If an XSLT stylesheet has been set with setStylesheetFile(java.io.File), xmiFileName will be transformed into a new file in the same directory with an added extension of .jamda, and this file will be used as the input file.

Parameters:
xmiFileName - the name of the XMI file to transform
Returns:
the transformed Model
ModelTransformer.TransformException

run

public Model run(java.io.File xmiFile)
          throws ModelTransformer.TransformException
Run a transformation against a given XMI file. Do not save the output. This method assumes that the output is written elsewhere by the transformation.

Parameters:
xmiFile - the XMI file to transform
Returns:
the transformed Model
ModelTransformer.TransformException

run

public void run(Model inputModel)
         throws ModelTransformer.TransformException
Run a transformation against a given Model. Do not save the output. This method assumes that the output is written elsewhere by the transformation.

Parameters:
inputModel - the Model to transform
ModelTransformer.TransformException

xsltTransform

public static void xsltTransform(java.io.File inputFile,
                                 java.io.File outputFile,
                                 java.io.File stylesheet)
                          throws java.io.IOException,
                                 javax.xml.transform.TransformerException
Transform a given XML File to another using XSLT.

Parameters:
inputFile - the input XML file
outputFile - the output XML file
stylesheet - the stylesheet file to apply
java.io.IOException
javax.xml.transform.TransformerException


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.