edu.ucsb.nceas.morpho.datapackage
Class TripleParser
java.lang.Object
org.xml.sax.helpers.DefaultHandler
edu.ucsb.nceas.morpho.datapackage.TripleParser
- All Implemented Interfaces:
- org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
- public class TripleParser
- extends org.xml.sax.helpers.DefaultHandler
A Class implementing callback bethods for the SAX parser. This class finds
any triple tag in the xml file and creates a TripleCollection of Triple objects.
Constructor Summary |
TripleParser(java.io.Reader xml)
|
TripleParser(java.io.Reader xml,
com.arbortext.catalog.CatalogEntityResolver cer)
|
Method Summary |
void |
characters(char[] ch,
int start,
int length)
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
TripleCollection |
getTriples()
returns the TripleCollection of all of the triples in this document |
static void |
main(java.lang.String[] args)
command line test method. |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
|
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 |
TripleParser
public TripleParser(java.io.Reader xml)
TripleParser
public TripleParser(java.io.Reader xml,
com.arbortext.catalog.CatalogEntityResolver cer)
startElement
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
endElement
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
characters
public void characters(char[] ch,
int start,
int length)
getTriples
public TripleCollection getTriples()
- returns the TripleCollection of all of the triples in this document
main
public static void main(java.lang.String[] args)
- command line test method. the first argument is the file you want to parse
Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.