de.tudarmstadt.ukp.jwktl.parser
Class XMLDumpParser.XMLDumpHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by de.tudarmstadt.ukp.jwktl.parser.XMLDumpParser.XMLDumpHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler
Enclosing class:
XMLDumpParser

protected class XMLDumpParser.XMLDumpHandler
extends DefaultHandler


Field Summary
protected  StringBuffer contentBuffer
           
protected  Stack<String> tags
           
 
Constructor Summary
protected XMLDumpParser.XMLDumpHandler()
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(String uri, String localName, String qName)
           
 String getContents()
          Returns the contents of the currently active XML element.
 String getParent()
          Returns the XML tag name of the parent of the currently active XML element.
 boolean hasContents()
          Returns whether there is a non-empty content within the currently active XML element.
 void startDocument()
           
 void startElement(String uri, String localName, String qName, Attributes attributes)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contentBuffer

protected StringBuffer contentBuffer

tags

protected Stack<String> tags
Constructor Detail

XMLDumpParser.XMLDumpHandler

protected XMLDumpParser.XMLDumpHandler()
Method Detail

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class 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 DefaultHandler
Throws:
SAXException

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class 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 DefaultHandler
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class DefaultHandler
Throws:
SAXException

getContents

public String getContents()
Returns the contents of the currently active XML element.


hasContents

public boolean hasContents()
Returns whether there is a non-empty content within the currently active XML element.


getParent

public String getParent()
Returns the XML tag name of the parent of the currently active XML element.



Copyright © 2011-2013 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.