net.sourceforge.jeuclid.biparser
Class JEuclidSAXHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by net.sourceforge.jeuclid.biparser.JEuclidSAXHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class JEuclidSAXHandler
extends DefaultHandler

this class is used for SAX parsing. it builds a BiTree out of a text while parsing

Version:
$Revision: 006d990a217c $

Constructor Summary
JEuclidSAXHandler(String c, BiTree t)
          create a new SAX-Handler for parsing and creating a BiTree.
 
Method Summary
 void characters(char[] buf, int offset, int len)
          concat characters while parsing.
 void endDocument()
          end document.
 void endElement(String namespaceURI, String sName, String qName)
          end element, called at end of every close tag.
 InputSource resolveEntity(String publicId, String systemId)
          stop resolving of entities (dtd).
 void setDocumentLocator(Locator l)
          set the document locator.
 void startDocument()
          start document.
 void startElement(String namespaceURI, String sName, String qName, Attributes attrs)
          start element, called at end of every new open tag.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JEuclidSAXHandler

public JEuclidSAXHandler(String c,
                         BiTree t)
create a new SAX-Handler for parsing and creating a BiTree.

Parameters:
c - inputtext to parse
t - BiTree to construct
Method Detail

setDocumentLocator

public final void setDocumentLocator(Locator l)
set the document locator.

Specified by:
setDocumentLocator in interface ContentHandler
Overrides:
setDocumentLocator in class DefaultHandler
Parameters:
l - locator

resolveEntity

public final InputSource resolveEntity(String publicId,
                                       String systemId)
stop resolving of entities (dtd).

Specified by:
resolveEntity in interface EntityResolver
Overrides:
resolveEntity in class DefaultHandler
Parameters:
publicId - publicId
systemId - systemId
Returns:
empty InputSource

startDocument

public final void startDocument()
start document.

Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class DefaultHandler

endDocument

public final void endDocument()
                       throws SAXException
end document.

Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class DefaultHandler
Throws:
SAXException - if a sax parse exception occurs

startElement

public final void startElement(String namespaceURI,
                               String sName,
                               String qName,
                               Attributes attrs)
                        throws SAXException
start element, called at end of every new open tag.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Parameters:
namespaceURI - namespace
sName - simple name
qName - qualified name
attrs - attributes of node
Throws:
SAXException - if a sax parse exception occurs

endElement

public final void endElement(String namespaceURI,
                             String sName,
                             String qName)
end element, called at end of every close tag.

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Parameters:
namespaceURI - namespace
sName - simple name
qName - qulified name

characters

public final void characters(char[] buf,
                             int offset,
                             int len)
                      throws SAXException
concat characters while parsing.

Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Parameters:
buf - inputtext
offset - offset of characters to inputtext
len - number of characters
Throws:
SAXException - if a sax parse exception occurs


Copyright © 2002-2010 The JEuclid project. All Rights Reserved.