net.sf.tomp.xtcl.command
Class JavaCommand

java.lang.Object
  extended by net.sf.tomp.xtcl.command.AbstractCommand
      extended by net.sf.tomp.xtcl.command.JavaCommand
All Implemented Interfaces:
Command

public class JavaCommand
extends AbstractCommand

Executes an executable Java class (i.e. with main method)

Author:
tomp

Field Summary
protected  java.lang.String[] args
          the Java class arguments
protected  java.lang.String className
          the Java class name
 
Constructor Summary
JavaCommand()
           
 
Method Summary
 int execute(Context c)
          Executes the commmand, i.e. the Java class with args
 void setArgs(java.lang.String[] r)
          sets the args
 void setClassName(java.lang.String r)
          the executed Java class name
 java.lang.String toString()
           
 
Methods inherited from class net.sf.tomp.xtcl.command.AbstractCommand
done, initParameters, listArray, listList, listMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

className

protected java.lang.String className
the Java class name


args

protected java.lang.String[] args
the Java class arguments

Constructor Detail

JavaCommand

public JavaCommand()
Method Detail

setArgs

public void setArgs(java.lang.String[] r)
sets the args

Parameters:
r - the Java class args

setClassName

public void setClassName(java.lang.String r)
the executed Java class name

Parameters:
r - the executed Java class name

execute

public int execute(Context c)
            throws java.lang.Exception
Executes the commmand, i.e. the Java class with args

Specified by:
execute in interface Command
Overrides:
execute in class AbstractCommand
Parameters:
c - Context this command will be executed in.
Returns:
always 0 == success, OK
Throws:
java.lang.Exception - only if I/O error occurs when reporting the result to user.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
"JAVA " + className + "(" + listArray(args) + ")";


Copyright © 2004-2005 Masaryk University in Brno, Faculty of Informatics, Czech Republic. All Rights Reserved.