org.xmlcml.cml
Interface CMLBase
- All Known Subinterfaces:
- AbstractAngle, AbstractAtom, AbstractAtomRef, AbstractBond, AbstractBuiltinContainer, AbstractStringVal, Angle, Atom, AtomArray, Bond, BondArray, CML, Crystal, Electron, Execute, Feature, FloatArray, FloatMatrix, FloatVal, Formula, HasExecute, IntegerArray, IntegerVal, Link, List, Molecule, NumericVal, Reaction, Sequence, StringArray, StringVal, Torsion
- All Known Implementing Classes:
- CMLBaseImpl
- public interface CMLBase
- extends PMRElement, HasTitle, HasDictRef, HasId, HasConvention
The base class for all elementObjects mentioned in the CML
DTD.
Any CML element may have attributes:
- title
- id
- dictRef
- convention
and convenience get/set methods are provided for all, through
the interfaces HasTitle, HasId and HasConvention.
An element (FOO) subclassed from a CMLBase may be constructed in the
following ways:
- FOO(). Creates a new empty element with null values of the
attributes. Required for newInstance(), but use carefully since
it has no tagName and no document associated with it.
- FOO(String tagName, Document document). Creates an empty
element with null attribute names.
- FOO(org.w3c.dom.Element element). Creates a subclassed Element with
the same attribute values as the input Element. Used when a DOM has
been created with non-CML-aware software. The routine
makeAndProcessSubclass(Element element) will replace the current Element
with the appropriate CML subclass.
- FOO(String title, String id, String dictRef, String conventionName).
Makes subclassed Element and sets attribute values.
| Fields inherited from interface org.xmlcml.cml.HasId |
ID |
| Fields inherited from interface uk.co.demon.ursus.dom.PMRNode |
ATTRIBUTES,
CONTENT,
ELEMENTNAME,
IDLIST,
NESTED,
NESTEDATTS,
PACKAGENAME,
PRETTY,
SPLITFILES,
STYLE,
TAGGED,
UNTAGGED,
WHITESPACE,
XMLCONTENT |
| Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE,
CDATA_SECTION_NODE,
COMMENT_NODE,
DOCUMENT_FRAGMENT_NODE,
DOCUMENT_NODE,
DOCUMENT_TYPE_NODE,
ELEMENT_NODE,
ENTITY_NODE,
ENTITY_REFERENCE_NODE,
NOTATION_NODE,
PROCESSING_INSTRUCTION_NODE,
TEXT_NODE |
| Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE,
CDATA_SECTION_NODE,
COMMENT_NODE,
DOCUMENT_FRAGMENT_NODE,
DOCUMENT_NODE,
DOCUMENT_TYPE_NODE,
ELEMENT_NODE,
ENTITY_NODE,
ENTITY_REFERENCE_NODE,
NOTATION_NODE,
PROCESSING_INSTRUCTION_NODE,
TEXT_NODE |
|
Method Summary |
void |
addValidity(CMLValidity validity)
potentially subclassable to determine whether an element has
valid attributes and content. |
void |
debug(java.io.Writer w)
output debug info to Writer and return String equivalent (e.g. |
boolean |
isValid()
convenience to avoid analysing Validity |
void |
processDOM()
carries out class-specific processing for subclasses of PMRElement. |
void |
updateDOM()
|
| Methods inherited from interface org.w3c.dom.Element |
getAttribute,
getAttributeNode,
getAttributeNodeNS,
getAttributeNS,
getElementsByTagName,
getElementsByTagNameNS,
getTagName,
hasAttribute,
hasAttributeNS,
removeAttribute,
removeAttributeNode,
removeAttributeNS,
setAttribute,
setAttributeNode,
setAttributeNodeNS,
setAttributeNS |
PACKAGE_NAME
public static final java.lang.String PACKAGE_NAME
UNK_ELEM
public static final int UNK_ELEM
ELEMENT_NAMES
public static final java.lang.String[] ELEMENT_NAMES
UNK
public static final int UNK
ANGLE
public static final int ANGLE
ATOM
public static final int ATOM
ATOMARRAY
public static final int ATOMARRAY
BOND
public static final int BOND
BONDARRAY
public static final int BONDARRAY
CML
public static final int CML
CRYSTAL
public static final int CRYSTAL
ELECTRON
public static final int ELECTRON
EXECUTE
public static final int EXECUTE
FEATURE
public static final int FEATURE
FLOAT
public static final int FLOAT
FLOATARRAY
public static final int FLOATARRAY
FLOATMATRIX
public static final int FLOATMATRIX
FORMULA
public static final int FORMULA
INTEGER
public static final int INTEGER
INTEGERARRAY
public static final int INTEGERARRAY
LINK
public static final int LINK
LIST
public static final int LIST
MOLECULE
public static final int MOLECULE
REACTION
public static final int REACTION
SEQUENCE
public static final int SEQUENCE
STRING
public static final int STRING
STRINGARRAY
public static final int STRINGARRAY
TORSION
public static final int TORSION
ELEMENT_COUNT
public static final int ELEMENT_COUNT
BUILTIN
public static final java.lang.String BUILTIN
- "builtin" attribute name
UNKNOWN
public static final int UNKNOWN
STRING_TYPE
public static final int STRING_TYPE
FLOAT_TYPE
public static final int FLOAT_TYPE
INTEGER_TYPE
public static final int INTEGER_TYPE
addValidity
public void addValidity(CMLValidity validity)
- potentially subclassable to determine whether an element has
valid attributes and content.
- Returns:
- boolean truue by default
isValid
public boolean isValid()
- convenience to avoid analysing Validity
debug
public void debug(java.io.Writer w)
throws java.io.IOException
- output debug info to Writer and return String equivalent (e.g. with
new StringWriter()
- Parameters:
Writer - w Writer to output to- Returns:
- the String equivalent
processDOM
public void processDOM()
throws CMLException
- Description copied from interface: PMRElement
- carries out class-specific processing for subclasses of PMRElement.
The default for a generic PMRElement is no-op. Often creates an internal model
- Specified by:
- processDOM in interface PMRElement
updateDOM
public void updateDOM()
throws CMLException