com.evelopers.unimod.transform.xml
Class ModelToXML

java.lang.Object
  extended bycom.evelopers.unimod.transform.xml.ModelToXML
All Implemented Interfaces:
XML

public class ModelToXML
extends java.lang.Object
implements XML

Transforms in-memory state machine model into XML description.


Nested Class Summary
 
Nested classes inherited from class com.evelopers.unimod.transform.xml.XML
XML.Attribute, XML.Path, XML.Tag
 
Field Summary
 
Fields inherited from interface com.evelopers.unimod.transform.xml.XML
DTD_RESOURCE, PUBLIC_ID, SYSTEM_ID
 
Method Summary
static ModelToXML create()
          Returns transformer instance
 org.w3c.dom.Document transform(Model source)
           
static void write(Model model, java.io.OutputStream out)
           Transforms given StateMachine to Document and serializes it to given OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static ModelToXML create()
Returns transformer instance

Returns:
singleton instance

write

public static void write(Model model,
                         java.io.OutputStream out)
                  throws TransformException

Transforms given StateMachine to Document and serializes it to given OutputStream.

Note: this method doesn't close output stream

Usage:

 StateMachine sm = StateMachine.create("A1");
 // ... fill state machine code here ...
 FileOutputStream out = new FileOutputStream("A1.xml");
 StateMachineToXML.write(sm, out);
 out.close();
 

Parameters:
out - output stream to serialize machine to
Throws:
TransformException - if some transformation error occurs

transform

public org.w3c.dom.Document transform(Model source)
                               throws TransformException
Throws:
TransformException