Package org.biojava.bio.dist
Class XMLDistributionReader
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.biojava.bio.dist.XMLDistributionReader
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
A SAX parser that reads an XML representation of a
Distribution from a file and recreates it as a Distribution Object.
Handles OrderNDistributions and Simple Distributions but
ensure the OrderNDistributions being read in was made using
conditioning and conditioned Alphabets.
- Since:
- 1.3
- Author:
- Russell Smithies, Mark Schreiber, Matthew Pocock
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparseXML(InputStream is) Reads an XML representation of a Distribution from a file.voidstartElement(String nameSpaceURI, String localName, String rawName, Attributes attributes) Required by SAXParser to be public.Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, 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
-
XMLDistributionReader
public XMLDistributionReader()
-
-
Method Details
-
parseXML
Reads an XML representation of a Distribution from a file.- Parameters:
is- input in XML format- Returns:
- dist the Distribution created.
- Throws:
IOException- if an error occurs during reading.SAXException- if the XML is not as expected.
-
startElement
public void startElement(String nameSpaceURI, String localName, String rawName, Attributes attributes) throws SAXException Required by SAXParser to be public.It is not reccomended that you use this method directly. Use ParseXML instead.
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-