tomp.xtcl.command
Class AbstractCommand

java.lang.Object
  extended bytomp.xtcl.command.AbstractCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
Block, CatchCommand, Dump, DumpCommand, Echo, End, Err, ExeCommand, Function, Help, Chain, JavaCommand, Label, Ret, Sequence, Transform, VarCommand

public class AbstractCommand
extends java.lang.Object
implements Command


Constructor Summary
AbstractCommand()
           
 
Method Summary
 int execute(Context c)
           
protected  int initParameters(java.util.Map params, java.util.Map realParams, Parametrized f, Context context)
           
static java.lang.String listArray(java.lang.Object[] os)
           
static java.lang.String listList(java.util.List m)
           
static java.lang.String listMap(java.util.Map m)
           
static java.io.File newFile(Context context, java.lang.String filename)
           
 java.io.File refToFile(java.lang.Object ref, Context context)
           
 org.xml.sax.InputSource refToInputSource(java.lang.Object ref, Context context)
           
 javax.xml.transform.Templates refToJoostStyle(java.lang.Object ref, Context context)
           
 javax.xml.transform.Result refToResult(java.lang.Object ref, Context context)
          public Object refToTransformParam(Object ref, Context context) { Object o = context.get(ref); //System.out.println("refToTransformParam="+o); if (o instanceof Document) { return new DOMSource((Document)o); } else if (o instanceof File) { return new StreamSource((File)o); } return o; }
 javax.xml.transform.Source refToSource(java.lang.Object ref, Context context)
           
 javax.xml.transform.Templates refToStyle(java.lang.Object ref, Context context)
           
 org.xml.sax.XMLFilter refToXMLFilter(java.lang.Object ref, Context context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCommand

public AbstractCommand()
Method Detail

execute

public int execute(Context c)
            throws java.lang.Exception
Specified by:
execute in interface Command
Parameters:
c - Context in which the command is executed
Returns:
int errorCode (0 = OK)
Throws:
java.lang.Exception

refToFile

public java.io.File refToFile(java.lang.Object ref,
                              Context context)

refToXMLFilter

public org.xml.sax.XMLFilter refToXMLFilter(java.lang.Object ref,
                                            Context context)

refToSource

public javax.xml.transform.Source refToSource(java.lang.Object ref,
                                              Context context)

refToInputSource

public org.xml.sax.InputSource refToInputSource(java.lang.Object ref,
                                                Context context)
                                         throws java.io.IOException
Throws:
java.io.IOException

refToStyle

public javax.xml.transform.Templates refToStyle(java.lang.Object ref,
                                                Context context)
                                         throws javax.xml.transform.TransformerConfigurationException
Throws:
javax.xml.transform.TransformerConfigurationException

refToJoostStyle

public javax.xml.transform.Templates refToJoostStyle(java.lang.Object ref,
                                                     Context context)
                                              throws javax.xml.transform.TransformerConfigurationException
Throws:
javax.xml.transform.TransformerConfigurationException

refToResult

public javax.xml.transform.Result refToResult(java.lang.Object ref,
                                              Context context)
public Object refToTransformParam(Object ref, Context context) { Object o = context.get(ref); //System.out.println("refToTransformParam="+o); if (o instanceof Document) { return new DOMSource((Document)o); } else if (o instanceof File) { return new StreamSource((File)o); } return o; }


initParameters

protected int initParameters(java.util.Map params,
                             java.util.Map realParams,
                             Parametrized f,
                             Context context)

listArray

public static java.lang.String listArray(java.lang.Object[] os)

listList

public static java.lang.String listList(java.util.List m)

listMap

public static java.lang.String listMap(java.util.Map m)

newFile

public static java.io.File newFile(Context context,
                                   java.lang.String filename)