|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.ml.cml.cmlimpl.BaseToolImpl
public class BaseToolImpl
Performs editing functions on a generic CMLObject
| Field Summary | |
|---|---|
protected AbstractBase |
abstractBase
|
protected static java.util.Hashtable |
baseToolTable
|
protected static java.lang.String |
CONSTRUCT
|
protected boolean |
debug
|
protected java.lang.reflect.Constructor[] |
declaredPublicConstructors
|
protected java.lang.reflect.Method[] |
declaredPublicMethods
|
protected AbstractCMLDocument |
document
|
protected static java.lang.String |
editorPackageName
|
protected java.util.Hashtable |
ignoreAttributeTable
|
protected static JumboLogger |
jumboLogger
|
protected static java.lang.String |
TEST
|
protected Workflow |
workflow
|
| Fields inherited from interface org.jscience.ml.cml.BaseTool |
|---|
DOUBLE, INTEGER, STRING, XSD_DOUBLE, XSD_INTEGER, XSD_STRING |
| Constructor Summary | |
|---|---|
protected |
BaseToolImpl()
new BaseTool. |
protected |
BaseToolImpl(AbstractBase base)
|
|
BaseToolImpl(AbstractCMLDocument document)
new BaseTool containing a new AbstractBase. |
| Method Summary | |
|---|---|
void |
characters(SaxHandler saxHandler,
java.lang.String content)
SAX2 parsing routine - called from characters() callback NOT namespace aware |
static void |
clear(java.util.Hashtable editorTable)
clears an editorTable. |
protected void |
constructorsUsage()
|
static java.lang.String |
convertClassToInterface(java.lang.String className)
converts CML classname to interface. |
static java.lang.String |
convertInterfaceToClass(java.lang.String interfaceName)
converts CMLInterface to class. |
void |
copyAttributesFromTo(AbstractBase from,
AbstractBase to)
copy attributes from one AbstractBase to another. |
static BaseTool |
createToolForName(java.lang.String baseName)
constructs a tools class object. |
protected void |
debug(java.lang.String s)
output string if debug set |
void |
endElement(SaxHandler saxHandler)
SAX2 parsing routine - called from endElement() callback NOT namespace aware |
boolean |
equals(BaseTool baseTool)
is the contained object equal to the other contained object. |
java.lang.String |
formatNumber(java.lang.String s)
|
AbstractBase |
getAbstractBase()
get abstract base only defined for implemented editors (default => null) |
AbstractCMLDocument |
getCMLDocument()
|
protected java.lang.reflect.Constructor |
getConstructor(java.util.List argVector)
|
boolean |
getDebug()
debug status |
java.lang.reflect.Constructor[] |
getDeclaredPublicConstructors()
get all public constructors belonging just to this class. |
java.lang.reflect.Method[] |
getDeclaredPublicMethods()
get all public methods belonging just to this class. |
protected static double[] |
getDoubleArgs(int start,
int nargs,
java.lang.String[] args)
|
protected java.lang.reflect.Method |
getMethod(java.lang.String methodS,
java.util.List argVector)
|
BaseTool |
getTestInstance(AbstractCMLDocument doc,
int serial)
a standard instance for testing. |
static BaseTool |
getTool(AbstractBase base)
gets tool or creates new one. |
static BaseTool |
getTool(AbstractBase base,
BaseTool tool)
gets existing tool for base or
returns tool after initialising
it with base. |
protected java.lang.reflect.Method |
getUniqueMethod(java.lang.String methodS)
gets unique method if possible does not use args at present |
Workflow |
getWorkflow()
get the workflow. |
protected void |
methodsUsage()
|
void |
mustEqual(BaseTool otherTool)
throws exception if the contained object is not equal to the other contained object. |
void |
mustEqualAttributes(BaseTool otherTool)
|
void |
mustEqualChildNodes(BaseTool otherTool)
|
void |
processArgs(java.lang.String[] args)
process args. |
int |
processCommandLine(java.lang.String[] args,
int offset,
java.util.List argVector,
AbstractCMLDocument doc)
process the commandline from main routines. |
void |
processCurrentCommand(Workflow workflow)
run workflow script or object. |
org.w3c.dom.Element |
removeElement(java.lang.String elementName)
removes the first element by tagName finds first element with that name and removes it from its parent. |
java.lang.Object |
runConstructor(java.util.List argVector)
run any public constructor introspects the above constructors Example: CMLVector3 projectOnto(CMLVector3 v) is called with v as arg v1, v2 and floatArg as dontCare and returns Object of type CMLVector3 |
java.lang.Object |
runMethod(java.lang.String methodS,
java.util.List argVector)
run any public method introspects the above methods Example: CMLVector3 projectOnto(CMLVector3 v) is called with v as arg v1, v2 and floatArg as dontCare and returns Object of type CMLVector3 Returns without action if duplicate method name |
void |
setAbstractBase(AbstractBase ab)
set abstract base only defined for implemented editors (default => null) should not be required in user code |
void |
setDebug(boolean d)
toggle debugging |
void |
setIgnoreAttribute(java.lang.String name,
boolean descend)
ignore an attribute |
static void |
setToolPackage(java.lang.String pName)
set Tool package. |
void |
startElement(SaxHandler saxHandler,
org.xml.sax.Attributes attributes)
SAX2 parsing routine - called from startElement() callback NOT namespace aware |
protected void |
superInit(AbstractBase base)
|
void |
testMethods()
test all declared public methods. |
void |
transferChildrenFromTo(AbstractBase from,
AbstractBase to)
transfer children from one AbstractBase to another. |
protected void |
usage(java.lang.String className)
|
void |
writeXML(java.io.Writer w,
java.lang.String control)
write XML, using class-specific information NOT namespace aware |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static JumboLogger jumboLogger
protected static java.lang.String editorPackageName
protected static java.lang.String CONSTRUCT
protected static java.lang.String TEST
protected static java.util.Hashtable baseToolTable
protected AbstractBase abstractBase
protected AbstractCMLDocument document
protected boolean debug
protected java.util.Hashtable ignoreAttributeTable
protected Workflow workflow
protected java.lang.reflect.Method[] declaredPublicMethods
protected java.lang.reflect.Constructor[] declaredPublicConstructors
| Constructor Detail |
|---|
protected BaseToolImpl()
public BaseToolImpl(AbstractCMLDocument document)
document - the owner documentprotected BaseToolImpl(AbstractBase base)
| Method Detail |
|---|
protected void superInit(AbstractBase base)
public static BaseTool getTool(AbstractBase base)
base -
public static BaseTool getTool(AbstractBase base,
BaseTool tool)
base or
returns tool after initialising
it with base.
base - the item that you want a tool fortool - the tool to use should base not already have one
public AbstractCMLDocument getCMLDocument()
public AbstractBase getAbstractBase()
getAbstractBase in interface BaseToolpublic void setAbstractBase(AbstractBase ab)
setAbstractBase in interface BaseToolab - the element associated with this editorpublic boolean equals(BaseTool baseTool)
equals in interface BaseToolbaseTool - the other element editor (must be of same class)
public void mustEqual(BaseTool otherTool)
throws CMLException
mustEqual in interface BaseToolotherTool - the other element (must be of same class)
CMLException - the reason for non-equality
public void mustEqualAttributes(BaseTool otherTool)
throws CMLException
CMLException
public void mustEqualChildNodes(BaseTool otherTool)
throws CMLException
CMLException
public void setIgnoreAttribute(java.lang.String name,
boolean descend)
setIgnoreAttribute in interface BaseToolname - attribute to ignoredescend - carry over to descendantspublic org.w3c.dom.Element removeElement(java.lang.String elementName)
removeElement in interface BaseTool
public void characters(SaxHandler saxHandler,
java.lang.String content)
throws CMLException
characters in interface BaseToolsaxHandler - SaxHandlercontent - throws exception (probably application specific)
CMLException
public void endElement(SaxHandler saxHandler)
throws CMLException
endElement in interface BaseToolsaxHandler - Saxhandler
throws exception (probably application specific)
CMLException
public void startElement(SaxHandler saxHandler,
org.xml.sax.Attributes attributes)
throws CMLException
startElement in interface BaseToolsaxHandler - Saxhandlerattributes - the attribute list
throws exception (probably application specific)
CMLException
public void writeXML(java.io.Writer w,
java.lang.String control)
throws CMLException,
java.io.IOException
writeXML in interface BaseToolw - the writercontrol - (concatenation of CML version and array)
exception - (probably application specific)
CMLException
java.io.IOExceptionpublic void setDebug(boolean d)
d - debugpublic boolean getDebug()
protected void debug(java.lang.String s)
s - string to output
public void copyAttributesFromTo(AbstractBase from,
AbstractBase to)
copyAttributesFromTo in interface BaseToolfrom - element to copy fromto - element to copy to
public void transferChildrenFromTo(AbstractBase from,
AbstractBase to)
transferChildrenFromTo in interface BaseToolfrom - element to copy fromto - element to copy topublic static void clear(java.util.Hashtable editorTable)
editorTable - the table to clearpublic static void setToolPackage(java.lang.String pName)
pName - the package in which Tools will be foundpublic static BaseTool createToolForName(java.lang.String baseName)
public void processCurrentCommand(Workflow workflow)
throws CMLException
processCurrentCommand in interface BaseToolworkflow - to process.
CMLExceptionpublic Workflow getWorkflow()
getWorkflow in interface BaseToolpublic java.lang.String formatNumber(java.lang.String s)
public java.lang.reflect.Constructor[] getDeclaredPublicConstructors()
public java.lang.reflect.Method[] getDeclaredPublicMethods()
getDeclaredPublicMethods in interface BaseToolpublic java.lang.Object runConstructor(java.util.List argVector)
argVector - arguments in order.
public java.lang.Object runMethod(java.lang.String methodS,
java.util.List argVector)
runMethod in interface BaseToolmethodS - case-sensitive method.argVector - arguments in order. First arg is instance of this
protected java.lang.reflect.Method getMethod(java.lang.String methodS,
java.util.List argVector)
protected java.lang.reflect.Constructor getConstructor(java.util.List argVector)
protected java.lang.reflect.Method getUniqueMethod(java.lang.String methodS)
methodS - method name
protected static double[] getDoubleArgs(int start,
int nargs,
java.lang.String[] args)
protected void usage(java.lang.String className)
protected void constructorsUsage()
protected void methodsUsage()
public void testMethods()
public static java.lang.String convertInterfaceToClass(java.lang.String interfaceName)
interfaceName - the interface
public static java.lang.String convertClassToInterface(java.lang.String className)
className -
public void processArgs(java.lang.String[] args)
args -
public BaseTool getTestInstance(AbstractCMLDocument doc,
int serial)
getTestInstance in interface BaseTooldoc - the owner documentserial - the instance (1,2,3)
public int processCommandLine(java.lang.String[] args,
int offset,
java.util.List argVector,
AbstractCMLDocument doc)
processCommandLine in interface BaseToolargs - the argumentsoffset - current position in argsargVector - vector to accumulate argumentsdoc - owner document
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||