INRIA & FluxMedia

fr.fluxmedia.transmorpher.graph
Class Transmorpher

java.lang.Object
  extended by java.util.Observable
      extended by fr.fluxmedia.transmorpher.graph.Transmorpher

public class Transmorpher
extends java.util.Observable

This class provides methods to create a graph structure corresponding to a transformation process defined in an XML file or with Flowcomposer ( a GUI tool for Transmorpher) . There is many ways to use this structure :


Field Summary
protected  int debug
          value of the debug mode
protected  LinearIndexedStruct defexterns
          the list of declared names of components
protected  java.io.File href
          The filename of the Transmorpher sheet
protected  TProcessComposite iExecutionStructure
          the execution structure
protected  java.util.LinkedList imports
          the list of imports must be a list of Transmorphers once the imports have been parsed.
protected  java.util.LinkedList includes
          the list of includes
protected  LinearIndexedStruct listOfType
          store the types of the (built-in) components and their corresponding classes to use for creating them
protected  MainProcess main
          The main process of the Transmorpher sheet
protected  java.lang.String name
          The name of the Transmorpher sheet
protected  boolean opt
          if true the production of XML description of this instance is required
protected  java.lang.String reloc
          a path for the output of transmorpher (java or xslt)
protected  LinearIndexedStruct transformations
          the list of Processes
protected  boolean useThread
          a flag to show if thread are used or not
protected  java.lang.String version
          the version to be used
 
Constructor Summary
Transmorpher(int debug)
          Constructor for the Transmorpher object
Transmorpher(java.lang.String name, java.lang.String version, int debug, boolean optimize)
          Constructor for the Transmorpher object
Transmorpher(java.lang.String name, java.lang.String version, int debug, java.lang.String reloc, boolean optimize)
          Constructor for the Transmorpher object
Transmorpher(java.lang.String name, java.lang.String version, int debug, java.lang.String reloc, boolean optimize, Transmorpher transmorpher)
          Constructor for the Transmorpher object
 
Method Summary
 void addExtern(java.lang.String name, java.lang.String className, java.lang.String impl, boolean def)
          Adds an externs definition to the defextern list
 void addImport(java.lang.String i)
          This is an internal method for dynamically adding imports *
 void addInclude(java.lang.String i)
          Adds a feature to the Include attribute of the Transmorpher object
 void addTransformation(java.lang.String name, Transformation t)
          Adds a feature to the Transformation attribute of the Transmorpher object
 void exec(Parameters p)
          Starts the execution of the process described by this Transmorpher instance
 Transformation findTransformation(java.lang.String name)
          Returns a transformtion corresponding to the name.
 void generateExec(java.lang.String reloc)
          Generates the execution structure corresponding to this Transmorpher instance
 void generateJavaCode(java.lang.String reloc)
          Generates a java code description for this Transmorpher instance
 void generateStylesheet()
          Launches the conversion of Ruleset and Query to XSLT files
 void generateXML()
          Prints an XML description of this Transmorpher instance
 java.lang.String getClassForType(java.lang.String name)
          Looks for a name in the list of type and in the defextern list.
 int getDebug()
          Get the value of debug.
 LinearIndexedStruct getDefexterns()
          Gets the defexterns attribute of the Transmorpher object
 java.lang.String getExtern(java.lang.String name)
          Looks for a name in the defextern list.
 java.io.File getFile()
          Gets the file attribute of the Transmorpher object
 java.util.LinkedList getImports()
          Gets the imports attribute of the Transmorpher object
 java.util.LinkedList getIncludes()
          Gets the includes attribute of the Transmorpher object
 MainProcess getMain()
          Gets the main attribute of the Transmorpher object
 java.lang.String getName()
          Gets the name attribute of the Transmorpher object
 Transformation getTransformation(java.lang.String name)
          Gets the transformation attribute of the Transmorpher object
 LinearIndexedStruct getTransformations()
          Gets the transformations attribute of the Transmorpher object
 java.lang.String getVersion()
          Gets the version attribute of the Transmorpher object
 void initListOfType()
          Initializes the list of type supported by Transmorpher.
 boolean isThread()
          Tests if this Transmorpher instance uses thread
 boolean optimizedP()
          Gets the value of the optimized flag
 void recordImport(java.lang.String i, Transmorpher t)
          replace the import URI by the actual import *
 void removeExtern(java.lang.String name)
          Removes the value corresponding to the name from the extern list
 void removeTransformation(Transformation trans)
          Removes a transformtion from this Transmorpher instance
 void reserveImport(java.lang.String i)
          just put the import URI in the linked list *
 void retroNull()
          Description of the Method
 void save()
          Description of the Method
 void saveAll()
          Description of the Method
 void setDebug(int debug)
          Set the value of debug.
 void setFile(java.io.File uri)
          Sets the file attribute of the Transmorpher object
 void setMain(MainProcess p)
          Sets the main attribute of the Transmorpher object
 void setName(java.lang.String name)
          Sets the name attribute of the Transmorpher object
 void setOptimized(boolean optimize)
          Sets the optimized attribute of the Transmorpher object
 void setVersion(java.lang.String version)
          Sets the version attribute of the Transmorpher object
 void useThread(boolean thread)
          Initializes this Transmorpher instance for the use of thread or not
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
The name of the Transmorpher sheet


href

protected java.io.File href
The filename of the Transmorpher sheet


main

protected MainProcess main
The main process of the Transmorpher sheet


transformations

protected LinearIndexedStruct transformations
the list of Processes


version

protected java.lang.String version
the version to be used


iExecutionStructure

protected TProcessComposite iExecutionStructure
the execution structure


imports

protected java.util.LinkedList imports
the list of imports must be a list of Transmorphers once the imports have been parsed. In such a case the URL can be found in its href attribute


includes

protected java.util.LinkedList includes
the list of includes


defexterns

protected LinearIndexedStruct defexterns
the list of declared names of components


listOfType

protected LinearIndexedStruct listOfType
store the types of the (built-in) components and their corresponding classes to use for creating them


debug

protected int debug
value of the debug mode


reloc

protected java.lang.String reloc
a path for the output of transmorpher (java or xslt)


opt

protected boolean opt
if true the production of XML description of this instance is required


useThread

protected boolean useThread
a flag to show if thread are used or not

Constructor Detail

Transmorpher

public Transmorpher(int debug)
Constructor for the Transmorpher object

Parameters:
debug - the debug mode value

Transmorpher

public Transmorpher(java.lang.String name,
                    java.lang.String version,
                    int debug,
                    boolean optimize)
Constructor for the Transmorpher object

Parameters:
name - The name of this Transmorpher instance
version - The version of this Transmorpher instance
debug - The debug mode value
optimize - The optimize flag (if true , this instance will produce an XML description of itself)

Transmorpher

public Transmorpher(java.lang.String name,
                    java.lang.String version,
                    int debug,
                    java.lang.String reloc,
                    boolean optimize)
Constructor for the Transmorpher object

Parameters:
name - The name of this Transmorpher instance
version - The version of this Transmorpher instance
debug - The debug mode value
reloc - a path for outputs
optimize - The optimize flag (if true , this instance will produce an XML description of itself)

Transmorpher

public Transmorpher(java.lang.String name,
                    java.lang.String version,
                    int debug,
                    java.lang.String reloc,
                    boolean optimize,
                    Transmorpher transmorpher)
Constructor for the Transmorpher object

Parameters:
name - The name of this Transmorpher instance
version - The version of this Transmorpher instance
debug - The debug mode value
reloc - a path for outputs
optimize - The optimize flag (if true , this instance will produce an XML description of itself)
transmorpher - Description of the Parameter
Method Detail

initListOfType

public void initListOfType()
Initializes the list of type supported by Transmorpher. This list contains all the types of the execution components that are provided with Transmorpher and the corresponding classes to use for instanciate these components.


getName

public final java.lang.String getName()
Gets the name attribute of the Transmorpher object

Returns:
The name value

setName

public final void setName(java.lang.String name)
Sets the name attribute of the Transmorpher object

Parameters:
name - The new name value

getDebug

public int getDebug()
Get the value of debug.

Returns:
value of debug.

setDebug

public void setDebug(int debug)
Set the value of debug.

Parameters:
debug - Value to assign to debug.

isThread

public boolean isThread()
Tests if this Transmorpher instance uses thread

Returns:
true if using thread.

useThread

public void useThread(boolean thread)
Initializes this Transmorpher instance for the use of thread or not

Parameters:
thread - if true, thread are used.

getFile

public final java.io.File getFile()
Gets the file attribute of the Transmorpher object

Returns:
The file value

setFile

public final void setFile(java.io.File uri)
Sets the file attribute of the Transmorpher object

Parameters:
uri - The new file value

getVersion

public final java.lang.String getVersion()
Gets the version attribute of the Transmorpher object

Returns:
The version value

setVersion

public final void setVersion(java.lang.String version)
Sets the version attribute of the Transmorpher object

Parameters:
version - The new version value

optimizedP

public final boolean optimizedP()
Gets the value of the optimized flag

Returns:
true if an XML description of this instance is required else false

setOptimized

public final void setOptimized(boolean optimize)
Sets the optimized attribute of the Transmorpher object

Parameters:
b - The new optimized value

getMain

public final MainProcess getMain()
Gets the main attribute of the Transmorpher object

Returns:
The main value

getTransformations

public LinearIndexedStruct getTransformations()
Gets the transformations attribute of the Transmorpher object

Returns:
The transformations value

findTransformation

public final Transformation findTransformation(java.lang.String name)
Returns a transformtion corresponding to the name.

Parameters:
name - The name of the transformation to find
Returns:
The transformation corresponding to the name, null if no transformation found

getTransformation

public final Transformation getTransformation(java.lang.String name)
Gets the transformation attribute of the Transmorpher object

Parameters:
name - Description of the Parameter
Returns:
The transformation value

addTransformation

public final void addTransformation(java.lang.String name,
                                    Transformation t)
Adds a feature to the Transformation attribute of the Transmorpher object

Parameters:
name - The feature to be added to the Transformation attribute
t - The feature to be added to the Transformation attribute

removeTransformation

public final void removeTransformation(Transformation trans)
Removes a transformtion from this Transmorpher instance

Parameters:
trans - The transformation to remove

getClassForType

public final java.lang.String getClassForType(java.lang.String name)
Looks for a name in the list of type and in the defextern list. Returns the name of the class which corresponds to this name.

Parameters:
name - The name
Returns:
The class corresponding to the searched type

getExtern

public final java.lang.String getExtern(java.lang.String name)
Looks for a name in the defextern list. Returns the name of the class which corresponds to this name.

Parameters:
name - Description of the Parameter
Returns:
The class corresponding to the searched name

addExtern

public final void addExtern(java.lang.String name,
                            java.lang.String className,
                            java.lang.String impl,
                            boolean def)
Adds an externs definition to the defextern list

Parameters:
name - The type of the component to add
className - The class of the component to add
impl - The feature to be added to the Extern attribute
def - The feature to be added to the Extern attribute

removeExtern

public final void removeExtern(java.lang.String name)
Removes the value corresponding to the name from the extern list

Parameters:
name - the name of the extern defniition to remove

getDefexterns

public final LinearIndexedStruct getDefexterns()
Gets the defexterns attribute of the Transmorpher object

Returns:
The defexterns value

reserveImport

public final void reserveImport(java.lang.String i)
just put the import URI in the linked list *

Parameters:
i - Description of the Parameter

recordImport

public final void recordImport(java.lang.String i,
                               Transmorpher t)
replace the import URI by the actual import *

Parameters:
i - Description of the Parameter
t - Description of the Parameter

addImport

public final void addImport(java.lang.String i)
                     throws javax.xml.parsers.ParserConfigurationException,
                            org.xml.sax.SAXException,
                            java.io.IOException
This is an internal method for dynamically adding imports *

Parameters:
i - The feature to be added to the Import attribute
Throws:
javax.xml.parsers.ParserConfigurationException - Description of the Exception
org.xml.sax.SAXException - Description of the Exception
java.io.IOException - Description of the Exception

getImports

public final java.util.LinkedList getImports()
Gets the imports attribute of the Transmorpher object

Returns:
The imports value

addInclude

public final void addInclude(java.lang.String i)
Adds a feature to the Include attribute of the Transmorpher object

Parameters:
i - The feature to be added to the Include attribute

getIncludes

public final java.util.LinkedList getIncludes()
Gets the includes attribute of the Transmorpher object

Returns:
The includes value

setMain

public final void setMain(MainProcess p)
Sets the main attribute of the Transmorpher object

Parameters:
p - The new main value

retroNull

public final void retroNull()
Description of the Method


save

public final void save()
                throws TMException
Description of the Method

Throws:
TMException - Description of the Exception

saveAll

public final void saveAll()
                   throws TMException
Description of the Method

Throws:
TMException - Description of the Exception

generateXML

public final void generateXML()
Prints an XML description of this Transmorpher instance


generateStylesheet

public void generateStylesheet()
                        throws TMException,
                               java.io.IOException
Launches the conversion of Ruleset and Query to XSLT files

Throws:
TMException - Description of the Exception
java.io.IOException - Description of the Exception

generateExec

public final void generateExec(java.lang.String reloc)
                        throws javax.xml.transform.TransformerException,
                               javax.xml.transform.TransformerConfigurationException,
                               TMException,
                               org.xml.sax.SAXException,
                               java.io.IOException
Generates the execution structure corresponding to this Transmorpher instance

Parameters:
reloc - Description of the Parameter
Throws:
javax.xml.transform.TransformerException - Description of the Exception
javax.xml.transform.TransformerConfigurationException - Description of the Exception
TMException - Description of the Exception
org.xml.sax.SAXException - Description of the Exception
java.io.IOException - Description of the Exception

generateJavaCode

public final void generateJavaCode(java.lang.String reloc)
                            throws java.io.IOException,
                                   TMException
Generates a java code description for this Transmorpher instance

Parameters:
reloc - The path for the outputs
Throws:
java.io.IOException - Description of the Exception
TMException - Description of the Exception

exec

public final void exec(Parameters p)
                throws java.lang.Exception
Starts the execution of the process described by this Transmorpher instance

Parameters:
p - Description of the Parameter
Throws:
java.lang.Exception - Description of the Exception

INRIA & FluxMedia

..no bottom yet...