Package org.openscience.cdk.io.cml
Class CMLHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.openscience.cdk.io.cml.CMLHandler
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
- Direct Known Subclasses:
EventCMLHandler
public class CMLHandler extends DefaultHandler
SAX2 implementation for CML XML fragment reading. CML Core is supported as well is the CRML module.Data is stored into the Chemical Document Object which is passed when instantiating this class. This makes it possible that programs that do not use CDK for internal data storage, use this CML library.
- Author:
- Egon Willighagen <egonw@sci.kun.nl>
- Source code:
- main
- Belongs to CDK module:
- io
-
-
Constructor Summary
Constructors Constructor Description CMLHandler(IChemFile chemFile)
Constructor for the CMLHandler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
Implementation of the characters() procedure overwriting the DefaultHandler interface.void
doctypeDecl(String name, String publicId, String systemId)
void
endDocument()
Calling this procedure signals the end of the XML document.void
endElement(String uri, String local, String raw)
void
registerConvention(String convention, ICMLModule conv)
void
startDocument()
void
startElement(String uri, String local, String raw, Attributes atts)
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
CMLHandler
public CMLHandler(IChemFile chemFile)
Constructor for the CMLHandler.- Parameters:
chemFile
- The document in which data is stored
-
-
Method Detail
-
registerConvention
public void registerConvention(String convention, ICMLModule conv)
-
characters
public void characters(char[] ch, int start, int length)
Implementation of the characters() procedure overwriting the DefaultHandler interface.- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Parameters:
ch
- characters to handle
-
doctypeDecl
public void doctypeDecl(String name, String publicId, String systemId) throws Exception
- Throws:
Exception
-
endDocument
public void endDocument()
Calling this procedure signals the end of the XML document.- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classDefaultHandler
-
endElement
public void endElement(String uri, String local, String raw)
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
-
startDocument
public void startDocument()
- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classDefaultHandler
-
startElement
public void startElement(String uri, String local, String raw, Attributes atts)
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
-
-