Class AbstractCMLDocumentImpl
java.lang.Object
org.episteme.natural.chemistry.loaders.cml.dom.pmr.PMRNodeImpl
org.episteme.natural.chemistry.loaders.cml.dom.pmr.PMRDocumentImpl
org.episteme.natural.chemistry.loaders.cml.cmlimpl.AbstractCMLDocumentImpl
- All Implemented Interfaces:
AbstractCMLDocument, CMLNode, PMRDocument, Document, Node
The base class for any CML Document objects
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanstatic final StringDescription of the Fieldstatic final StringDescription of the Fieldprotected StringFields inherited from class PMRNodeImpl
childNodes, delegateNode, parentNode, pmrDocument, siblingNodesFields inherited from interface AbstractCMLDocument
DEFAULT_OUTPUT_NAMESPACE, NULL_DTD, NULL_NAMESPACE, PACKAGE_NAMEFields inherited from interface Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Constructor Summary
ConstructorsModifierConstructorDescriptioncreate an Empty Document. probably should only be used when we need an instance of this class for introspectionprotectedConstructor for the AbstractCMLDocumentImpl object -
Method Summary
Modifier and TypeMethodDescriptionclone(AbstractBase element) clone element in context of document.creates new AbstractBasecreateSubclassedElement(String tagName) Description of the Methodprotected voidoutput string if debug setbooleangetDebug()debug statusElement[]getElementList(String elementName) getElementList (cf AbstractBase) NOTE this will get subelements as well as toplevel ones (for example Molecules which have Molecule children)getElementVector(String elementName) getChildVector (cf AbstractBase)getFirstElement(String elementName) getFirstChild (cf AbstractBase)static voidmainvoidsetArraySyntax(boolean syntax) set array syntaxvoidsetDebug(boolean d) toggle debuggingvoidsetVersion(String v) set CML versionWraps an existing W3C Element in a CML-specific subclass implementation.static AbstractBasetransferOwnerDocument(AbstractCMLDocument doc, AbstractBase elem) voidupdate delegates. updates documentElement delegates (content and attributes) then recurses through childrenvoidupdate DOM. updates documentElement DOM (content and attributes) then recurses through childrenvoidwrite XML use current control (version and syntax)voidwrite the document in XML, using node-specific routinesMethods inherited from class PMRDocumentImpl
adoptNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, getInputEncoding, getStrictErrorChecking, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, normalizeDocument, renameNode, setDocumentURI, setStrictErrorChecking, setXmlStandalone, setXmlVersion, test, test, toStringMethods inherited from class PMRNodeImpl
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getDelegateNode, getDelegateParentNode, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setDelegateNode, setNodeValue, setOwnerDocument, setOwnerDocumentRecursively, setPrefix, setTextContent, setUserData, wrapRecursivelyMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Document
adoptNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, getInputEncoding, getStrictErrorChecking, getXmlEncoding, getXmlStandalone, getXmlVersion, importNode, normalizeDocument, renameNode, setDocumentURI, setStrictErrorChecking, setXmlStandalone, setXmlVersionMethods inherited from interface Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Field Details
-
DEFAULT_OUTPUT_ENCODING
-
DEFAULT_OUTPUT_DTD
-
version
-
arraySyntax
protected boolean arraySyntax -
debug
protected boolean debug
-
-
Constructor Details
-
AbstractCMLDocumentImpl
public AbstractCMLDocumentImpl()create an Empty Document. probably should only be used when we need an instance of this class for introspection -
AbstractCMLDocumentImpl
Constructor for the AbstractCMLDocumentImpl object- Parameters:
doc- Description of the Parameter
-
-
Method Details
-
transferOwnerDocument
-
createSubclassedElement
Description of the Method- Specified by:
createSubclassedElementin interfaceAbstractCMLDocument- Parameters:
tagName- Description of the Parameter- Returns:
- Description of the Return Value
-
subclass
Description copied from interface:AbstractCMLDocumentWraps an existing W3C Element in a CML-specific subclass implementation.- Specified by:
subclassin interfaceAbstractCMLDocument- Parameters:
oldEl- the generic W3C element to subclass- Returns:
- the subclassed element instance
-
createAbstractBase
creates new AbstractBase- Specified by:
createAbstractBasein interfaceAbstractCMLDocument- Returns:
- the new element
-
getFirstElement
getFirstChild (cf AbstractBase)- Specified by:
getFirstElementin interfaceAbstractCMLDocument- Parameters:
elementName- Description of the Parameter- Returns:
- the Element (null if none)
-
getElementList
getElementList (cf AbstractBase) NOTE this will get subelements as well as toplevel ones (for example Molecules which have Molecule children)- Specified by:
getElementListin interfaceAbstractCMLDocument- Parameters:
elementName- Description of the Parameter- Returns:
- the Elements (null if none)
-
getElementVector
getChildVector (cf AbstractBase)- Specified by:
getElementVectorin interfaceAbstractCMLDocument- Parameters:
elementName- Description of the Parameter- Returns:
- the Elements (empty list if none)
-
setDebug
public void setDebug(boolean d) toggle debugging- Specified by:
setDebugin interfaceAbstractCMLDocument- Parameters:
d- debug
-
getDebug
public boolean getDebug()debug status- Specified by:
getDebugin interfaceAbstractCMLDocument- Returns:
- is debug set
-
debug
-
setVersion
set CML version 1 or 2 at present (default 2)- Specified by:
setVersionin interfaceCMLNode- Parameters:
v- version
-
setArraySyntax
public void setArraySyntax(boolean syntax) set array syntax set CML array syntax (default false)- Specified by:
setArraySyntaxin interfaceCMLNode- Parameters:
syntax-
-
writeXML
write XML use current control (version and syntax)- Specified by:
writeXMLin interfaceCMLNode- Parameters:
w- - output- Throws:
CMLExceptionIOException
-
writeXML
write the document in XML, using node-specific routines- Specified by:
writeXMLin interfaceCMLNode- Parameters:
w- the writercontrol- (cannot remember what this does!)- Throws:
IOException- Description of the ExceptionCMLException- Description of the Exception
-
main
-
clone
clone element in context of document.- Specified by:
clonein interfaceAbstractCMLDocument- Parameters:
element- to clone (may or may not be owned by this)- Returns:
- the cloned element (owner is this)
- Throws:
CMLException- cannot clone non-AbstractBase
-
updateDelegates
public void updateDelegates()update delegates. updates documentElement delegates (content and attributes) then recurses through children- Specified by:
updateDelegatesin interfaceAbstractCMLDocument
-
updateDOM
public void updateDOM()update DOM. updates documentElement DOM (content and attributes) then recurses through children- Specified by:
updateDOMin interfaceAbstractCMLDocument
-