uk.ac.ebi.ep.mm.app
Class EbeyeSaxParser
java.lang.Object
org.xml.sax.helpers.DefaultHandler
uk.ac.ebi.ep.mm.app.EbeyeSaxParser
- All Implemented Interfaces:
- ContentHandler, DTDHandler, EntityResolver, ErrorHandler, MmParser
public class EbeyeSaxParser
- extends org.xml.sax.helpers.DefaultHandler
- implements MmParser
Parser for EB-Eye XML files to populate a mega-map.
Currently, this implementation has been used with ChEBI and
ChEMBL-target files (ChEMBL target is the
only one for this database which links compounds with protein IDs).
- Author:
- rafa
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EbeyeSaxParser
public EbeyeSaxParser()
main
public static void main(String... args)
throws Exception
- Parses a EB-Eye XML file and indexes/stores the entry IDs, accessions
and xrefs into a mega-map.
- Parameters:
args - see CliOptionsParser.getCommandLine(String...)
- Throws:
Exception - in case of error while parsing.
parse
public void parse(String xmlFile)
throws Exception
- Description copied from interface:
MmParser
- Parses a XML file and extracts interesting data into a mega-map.
- Specified by:
parse in interface MmParser
- Parameters:
xmlFile - an XML file.
- Throws:
Exception
startElement
public void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException
- Specified by:
startElement in interface ContentHandler- Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
- Throws:
SAXException
characters
public void characters(char[] ch,
int start,
int length)
throws SAXException
- Specified by:
characters in interface ContentHandler- Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
- Throws:
SAXException
endElement
public void endElement(String uri,
String localName,
String qName)
throws SAXException
- Specified by:
endElement in interface ContentHandler- Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
- Throws:
SAXException
setWriter
public void setWriter(MegaMapper writer)
- Description copied from interface:
MmParser
- Sets a writer to make the mega-map persistent.
- Specified by:
setWriter in interface MmParser
getCurrentXpath
protected String getCurrentXpath()
Copyright © 2012 EMBL-EBI. All Rights Reserved.