Interface BaseTool
- All Known Implementing Classes:
BaseToolImpl
public interface BaseTool
Performs editing functions on a generic CMLObject
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(SaxHandler saxHandler, String content) SAX2 parsing routine - called from characters() callbackvoidcopyAttributesFromTo(AbstractBase from, AbstractBase to) copy attributes from one AbstractBase to another.voidendElement(SaxHandler saxHandler) SAX2 parsing routine - called from endElement() callbackbooleanis the contained object equal to the other contained object.get abstract base.Method[]get all public methods belonging just to this class.getTestInstance(AbstractCMLDocument doc, int serial) a standard instance for testing. returns null unless subclassedget the workflow.voidthrows exception if the contained object is not equal to the other contained object.intprocessCommandLine(String[] args, int offset, List<Object> argVector, AbstractCMLDocument doc) process the commandline from main routines. normally subclassedvoidprocessCurrentCommand(Workflow workflow) run workflow script or object.removeElement(String elementName) removes the first element by tagNamerun 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 CMLVector3voidset abstract basevoidsetIgnoreAttribute(String name, boolean descend) ignore an attributevoidstartElement(SaxHandler saxHandler, Attributes attributes) SAX2 parsing routine - called from startElement() callbackvoidtransferChildrenFromTo(AbstractBase from, AbstractBase to) transfer children from one AbstractBase to another.voidwrite XML, using class-specific information
-
Field Details
-
DOUBLE
- See Also:
-
INTEGER
- See Also:
-
STRING
- See Also:
-
XSD_DOUBLE
- See Also:
-
XSD_INTEGER
- See Also:
-
XSD_STRING
- See Also:
-
-
Method Details
-
getAbstractBase
AbstractBase getAbstractBase()get abstract base. only defined for implemented tools (default => null)- Returns:
- the element associated with this tool (null for default)
-
setAbstractBase
set abstract base only defined for implemented tools (default => null) should not be required in user code- Parameters:
ab- the element associated with this tool
-
setIgnoreAttribute
ignore an attribute- Parameters:
name- attribute to ignoredescend- carry over to descendants
-
equals
is the contained object equal to the other contained object. The two objects contained in the elements are compared. The default is to use an element-by-element and attribute-by-attribute comparison. This can be overridden for subclasses. For example the order of children in some elements matters while in others (e.g. molecules) it does not. The compared object must be of the same class but may have different namespace prefix, etc. By default ownerDocuments are ignored (thus molecules in different documents can be compared.) The tools may have sepcial methods to affect of control equality. Thus it is possible to ignore Ids. If the reason for non-equality is required, the mustEqual() method should be used.- Parameters:
baseTool- the other element tool (must be of same class)
-
mustEqual
throws exception if the contained object is not equal to the other contained object. Essentially an assert() mechanism; see equals() for strategy.- Parameters:
baseTool- the other element tool (must be of same class)- Throws:
CMLException- the reason for non-equality
-
removeElement
-
characters
SAX2 parsing routine - called from characters() callback NOT namespace aware- Parameters:
saxHandler- SaxHandlercontent- throws exception (probably application specific)- Throws:
CMLException
-
endElement
SAX2 parsing routine - called from endElement() callback NOT namespace aware- Parameters:
saxHandler- Saxhandler throws exception (probably application specific)- Throws:
CMLException
-
startElement
SAX2 parsing routine - called from startElement() callback NOT namespace aware- Parameters:
saxHandler- Saxhandlerattributes- the attribute list throws exception (probably application specific)- Throws:
CMLException
-
writeXML
write XML, using class-specific information NOT namespace aware- Parameters:
w- the writercontrol- (concatenation of CML version and array)
-
copyAttributesFromTo
copy attributes from one AbstractBase to another. overwrites existing atts- Parameters:
from- element to copy fromto- element to copy to
-
transferChildrenFromTo
transfer children from one AbstractBase to another.- Parameters:
from- element to copy fromto- element to copy to
-
processCurrentCommand
run workflow script or object. sets workflow to the tool and runs the current command all information (current command, symbolTables can be accessed from workflow- Parameters:
workflow- to process.- Throws:
CMLException
-
getWorkflow
-
runMethod
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- Parameters:
methodS- case-sensitive?. Returns without action if duplicate method nameargVector- arguments in order. First arg is instance of this- Returns:
- any return value (see Method.invoke for classes)
-
getDeclaredPublicMethods
Method[] getDeclaredPublicMethods()get all public methods belonging just to this class.- Returns:
- array of methods
-
processCommandLine
process the commandline from main routines. normally subclassed- Parameters:
args- the argumentsoffset- current position in argsargVector- vector to accumulate argumentsdoc- owner document- Returns:
- position in args after parsing
-
getTestInstance
a standard instance for testing. returns null unless subclassed- Parameters:
doc- the owner documentserial- the instance (1,2,3)- Returns:
- the new instance (null unless subclassed)
-