Class IsotopeHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.openscience.cdk.config.isotopes.IsotopeHandler
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
Reads an isotope list in CML2 format. An example definition is:
<isotopeList id="H">
<isotope id="H1" isotopeNumber="1" elementTyp="H">
<abundance dictRef="cdk:relativeAbundance">100.0</abundance>
<scalar dictRef="cdk:exactMass">1.00782504</scalar>
<scalar dictRef="cdk:atomicNumber">1</scalar>
</isotope>
<isotope id="H2" isotopeNumber="2" elementTyp="H">
<abundance dictRef="cdk:relativeAbundance">0.015</abundance>
<scalar dictRef="cdk:exactMass">2.01410179</scalar>
<scalar dictRef="cdk:atomicNumber">1</scalar>
</isotope>
</isotopeList>
- Source code:
- main
- Belongs to CDK module:
- extra
-
Constructor Summary
ConstructorsConstructorDescriptionIsotopeHandler
(IChemObjectBuilder builder) Constructs an IsotopeHandler used by the IsotopeReader. -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] chars, int start, int length) void
endElement
(String uri, String local, String raw) Returns the isotopes read from the XML file.void
void
startElement
(String uri, String local, String raw, Attributes atts) Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
IsotopeHandler
Constructs an IsotopeHandler used by the IsotopeReader.- Parameters:
builder
- The IChemObjectBuilder used to create new IIsotope's.
-
-
Method Details
-
getIsotopes
Returns the isotopes read from the XML file.- Returns:
- A List object with all isotopes
-
startDocument
public void startDocument()- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classDefaultHandler
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
-
startElement
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
-
characters
public void characters(char[] chars, int start, int length) - Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
-