|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
salsa.corpora.xmlparser.CorpusHandler
public class CorpusHandler
This handles events of the CorpusParser
. It tells the parser
how to properly read in a SalsaXML file into the Corpus
data
structure.
Constructor Summary | |
---|---|
CorpusHandler()
Zero-argumented default constructor. |
Method Summary | |
---|---|
void |
characters(char[] c,
int start,
int length)
This method is called when some text is found in the XML file. |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qualName)
This overrides DefaultHandler.endElement(java.lang.String, java.lang.String, java.lang.String) . |
Corpus |
getCorpus()
This returns the Corpus that has been read out of the XML
file. |
void |
startDocument()
This method is called when the XML document starts. |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qualName,
org.xml.sax.Attributes atts)
This overrides DefaultHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) . |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CorpusHandler()
Method Detail |
---|
public void characters(char[] c, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qualName) throws org.xml.sax.SAXException
DefaultHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
.
This method is called when the parser has found a closing element tag.
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
uri
- a String
with the namespace URI, empty if
parser factory is not namespace aware (default)localName
- a String
with the local name (without prefix),
empty if parser factory is not namespace aware (default)qualName
- a String
with the qualified (with prefix) name,
or the empty string if qualified names are not available
org.xml.sax.SAXException
- if an error occurs, possibly wrapping another exceptionpublic Corpus getCorpus()
Corpus
that has been read out of the XML
file.
public void startDocument()
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qualName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
DefaultHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
.
This method is called when the parser has found an opening element tag.
It initializes new objects and assigns them to their superordinating
elements. For example, it creates a new Head
and assigns
it to the Corpus
.
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
uri
- a String
with the namespace URI, empty if
parser factory is not namespace aware (default)localName
- a String
with the local name (without prefix),
empty if parser factory is not namespace aware (default)qualName
- a String
with the qualified (with prefix) name,
or the empty string if qualified names are not availableatts
- Attributes
attached to the element, empty if
there are no attributes
org.xml.sax.SAXException
- if an error occurs, possibly wrapping another exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |