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>
-
Constructor Summary
ConstructorsConstructorDescriptionIsotopeHandler(IChemObjectBuilder builder) Constructs an IsotopeHandler used by the IsotopeReader. -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] chars, int start, int length) voidendElement(String uri, String local, String raw) Returns the isotopes read from the XML file.voidvoidstartElement(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, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler
-
startElement
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler
-
characters
public void characters(char[] chars, int start, int length) - Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler
-