org.primordion.xholon.io
Class Xmi2Xholon

java.lang.Object
  extended byorg.primordion.xholon.io.Xmi2Xholon
All Implemented Interfaces:
IXmi2Xholon

public class Xmi2Xholon
extends java.lang.Object
implements IXmi2Xholon

Transform XMI-formatted files into Xholon format. These files include: .zargo ArgoUML .mdxml MagicDraw .zuml Poseidon .uml Topcased .sysml Topcased SysML

Since:
0.7 (Created on July 30, 2007)
Author:
Ken Webb

Nested Class Summary
 class Xmi2Xholon.XhErrorListener
          XSLT transformer error listener.
 
Field Summary
 
Fields inherited from interface org.primordion.xholon.io.IXmi2Xholon
XMI2XH_ENVIRONMENT_APP, XMI2XH_ENVIRONMENT_DEFAULT, XMI2XH_ENVIRONMENT_ECLIPSEPLUGIN, XMI2XH_TRANSFORM_TYPE_ALL, XMI2XH_TRANSFORM_TYPE_CD, XMI2XH_TRANSFORM_TYPE_CE, XMI2XH_TRANSFORM_TYPE_CN, XMI2XH_TRANSFORM_TYPE_CSH, XMI2XH_TRANSFORM_TYPE_IH, XMI2XH_TRANSFORM_TYPE_INFO, XMI2XH_TRANSFORM_TYPE_JA, XMI2XH_TRANSFORM_TYPE_JG, XMI2XH_TRANSFORM_TYPE_JX, XMI2XH_TRANSFORM_TYPE_XHN
 
Constructor Summary
Xmi2Xholon()
          constructor
 
Method Summary
 boolean compile(java.lang.String className)
          Compile a generated Java class.
static void main(java.lang.String[] args)
          Generate Java and/or XML files from a UML/SysML model.
 void setRootPath(java.lang.String rootPath)
          Set the root path.
 void setRuntimeEnv(int runtimeEnv)
          Set the runtime environment.
 void setShouldCompile(boolean shouldCompile)
          Set whether the generated code should be compiled.
 void setXholonJarPath(java.lang.String xholonJarPath)
          Set the Xholon jar path, for use by the compiler.
 void usage()
          How to call this class directly from the command line.
 boolean xmi2xh(java.lang.String toolName, int transformType, java.lang.String xmiFileName, java.lang.String rootXholon)
          Transform the model, and optionally compile the generated Java classes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Xmi2Xholon

public Xmi2Xholon()
constructor

Method Detail

setRuntimeEnv

public void setRuntimeEnv(int runtimeEnv)
Description copied from interface: IXmi2Xholon
Set the runtime environment.

Specified by:
setRuntimeEnv in interface IXmi2Xholon
Parameters:
runtimeEnv - Whether this is a standard Java app, or an Eclipse plugin.

setRootPath

public void setRootPath(java.lang.String rootPath)
Description copied from interface: IXmi2Xholon
Set the root path.

Specified by:
setRootPath in interface IXmi2Xholon
Parameters:
rootPath - An absolute or relative root, from which transform config src bin derive.

setShouldCompile

public void setShouldCompile(boolean shouldCompile)
Description copied from interface: IXmi2Xholon
Set whether the generated code should be compiled.

Specified by:
setShouldCompile in interface IXmi2Xholon
Parameters:
shouldCompile - true or false

setXholonJarPath

public void setXholonJarPath(java.lang.String xholonJarPath)
Description copied from interface: IXmi2Xholon
Set the Xholon jar path, for use by the compiler.

Specified by:
setXholonJarPath in interface IXmi2Xholon
Parameters:
xholonJarPath -

compile

public boolean compile(java.lang.String className)
Description copied from interface: IXmi2Xholon
Compile a generated Java class.

Specified by:
compile in interface IXmi2Xholon
Parameters:
className - Name of the class to compile.
Returns:
true or false

xmi2xh

public boolean xmi2xh(java.lang.String toolName,
                      int transformType,
                      java.lang.String xmiFileName,
                      java.lang.String rootXholon)
Description copied from interface: IXmi2Xholon
Transform the model, and optionally compile the generated Java classes.

Specified by:
xmi2xh in interface IXmi2Xholon
Parameters:
toolName - The name of the modeling tool (ex: Topcased MagicDraw Poseidon ArgoUML TopcasedSysML).
transformType - One of ih|ce|cs|cd|jx|ja|jg|in|xhn|all|cn
xmiFileName - The name of the input XMI-formatted file (ex: HelloWorldTutorial.uml).
rootXholon - The root of the composite structure hierarchy, or null.

usage

public void usage()
How to call this class directly from the command line.


main

public static void main(java.lang.String[] args)
Generate Java and/or XML files from a UML/SysML model. Compile generated Java classes. This class can be executed from the command line, for example: C:\Xholon\transform\MagicDraw> java -classpath ..\..\bin;..\..\lib\ecj.jar org.primordion.xholon.io.Xmi2Xholon jg Rcs_GP_FSM.mdzip

Parameters:
args - transformType xmiFileName