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 voidcharacters(char[] chars, int start, int length)voidendElement(String uri, String local, String raw)List<IIsotope>getIsotopes()Returns the isotopes read from the XML file.voidstartDocument()voidstartElement(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:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler
-
endElement
public void endElement(String uri, String local, String raw)
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler
-
startElement
public void startElement(String uri, String local, String raw, Attributes atts)
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler
-
characters
public void characters(char[] chars, int start, int length)- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler
-
-