org.onemind.commons.java.xml.digest
Class SaxDigesterHandler

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.onemind.commons.java.xml.digest.SaxDigesterHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class SaxDigesterHandler
extends org.xml.sax.helpers.DefaultHandler

The SaxDigesterHandler use digesters to digest the elements in the xml. The digesters can be added using the addDigester(). By default the sequential digester list is used.

Version:
$Id: SaxDigesterHandler.java,v 1.3 2005/01/30 06:31:37 thlee Exp $ $Name: $
Author:
TiongHiang Lee (thlee@thinklient.org)

Constructor Summary
SaxDigesterHandler()
          Constructor
 
Method Summary
 void addDigester(ElementDigester dig)
          Adding a digester to the root path
 void addDigester(java.lang.String path, ElementDigester dig)
          Add a digester for the path
 void addSubDigester(ElementDigester dig)
          Add a subdigester to current element path
 void addSubDigester(java.lang.String prefixPath, ElementDigester dig)
          Add a sub digester at a path of current path + prefixPath
 void characters(char[] ch, int start, int length)
          
 void endDocument()
          
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          
 java.lang.String getCurrentPath()
          Get the current element path
 void parse(java.io.InputStream stream)
          Parse an input
 void startDocument()
          
 void startElement(java.lang.String namespaceURI, java.lang.String lName, java.lang.String qName, org.xml.sax.Attributes attrs)
          
 
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
 

Constructor Detail

SaxDigesterHandler

public SaxDigesterHandler()
Constructor

Method Detail

addDigester

public void addDigester(ElementDigester dig)
Adding a digester to the root path

Parameters:
dig - the digester

addDigester

public void addDigester(java.lang.String path,
                        ElementDigester dig)
Add a digester for the path

Parameters:
path - the path
dig - the digester

addSubDigester

public void addSubDigester(ElementDigester dig)
Add a subdigester to current element path

Parameters:
dig - the digester

addSubDigester

public void addSubDigester(java.lang.String prefixPath,
                           ElementDigester dig)
Add a sub digester at a path of current path + prefixPath

Parameters:
prefixPath - the prefix path
dig - the digester

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException

Throws:
org.xml.sax.SAXException

endDocument

public void endDocument()
                 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

getCurrentPath

public java.lang.String getCurrentPath()
Get the current element path

Returns:
the path, or null if at start of document

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException

Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String lName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXException

Throws:
org.xml.sax.SAXException

parse

public void parse(java.io.InputStream stream)
           throws javax.xml.parsers.ParserConfigurationException,
                  org.xml.sax.SAXException,
                  java.io.IOException
Parse an input

Parameters:
stream - the stream
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException


Copyright © 2004-2006 . All Rights Reserved.