Class IsotopeHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.openscience.cdk.config.isotopes.IsotopeHandler
-
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
public class IsotopeHandler extends DefaultHandler
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
Constructors Constructor Description IsotopeHandler(IChemObjectBuilder builder)
Constructs an IsotopeHandler used by the IsotopeReader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] chars, int start, int length)
void
endElement(String uri, String local, String raw)
List<IIsotope>
getIsotopes()
Returns the isotopes read from the XML file.void
startDocument()
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
-
-
-
-
Constructor Detail
-
IsotopeHandler
public IsotopeHandler(IChemObjectBuilder builder)
Constructs an IsotopeHandler used by the IsotopeReader.- Parameters:
builder
- The IChemObjectBuilder used to create new IIsotope's.
-
-
Method Detail
-
getIsotopes
public List<IIsotope> 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
public void endElement(String uri, String local, String raw)
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
-
startElement
public void startElement(String uri, String local, String raw, Attributes atts)
- 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
-
-