org.bibop.xml.utils
Class DOMBuilder

java.lang.Object
  |
  +--org.bibop.xml.utils.DOMBuilder
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler, org.apache.avalon.framework.logger.LogEnabled, XMLConsumer

public class DOMBuilder
extends java.lang.Object
implements XMLConsumer, org.apache.avalon.framework.logger.LogEnabled


Nested Class Summary
static interface DOMBuilder.Listener
          The Listener interface must be implemented by those objects willing to be notified of a successful DOM tree generation.
 
Field Summary
private  org.w3c.dom.Node current
           
private  org.w3c.dom.Document document
           
protected  org.apache.cocoon.xml.dom.DOMFactory factory
           
protected  DOMBuilder.Listener listener
           
private  org.xml.sax.Locator locator
           
protected  org.apache.avalon.framework.logger.Logger log
           
private  java.lang.String name
           
private  NamespacesTable namespaces
           
private static int S_AVAIL
           
private static int S_BODY
           
private static int S_CDATA
           
private static int S_DOC
           
private static int S_DTD
           
private  int state
           
private static java.lang.String[] stateName
           
private  java.util.Vector undecl
           
 
Constructor Summary
protected DOMBuilder()
           
  DOMBuilder(org.apache.cocoon.xml.dom.DOMFactory factory)
           
  DOMBuilder(org.apache.cocoon.xml.dom.DOMFactory factory, DOMBuilder.Listener listener)
           
  DOMBuilder(org.w3c.dom.Node parentNode)
           
 
Method Summary
 void characters(char[] chars, int start, int len)
           
 void comment(char[] chars, int start, int len)
           
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
           
 void endCDATA()
           
 void endDocument()
           
 void endDTD()
           
 void endElement(java.lang.String uri, java.lang.String loc, java.lang.String raw)
           
 void endEntity(java.lang.String name)
           
 void endPrefixMapping(java.lang.String prefix)
           
 org.w3c.dom.Document getDocument()
           
 void ignorableWhitespace(char[] chars, int start, int len)
           
private  java.lang.String location()
           
protected  void notify(org.w3c.dom.Document doc)
           
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 void setDocumentLocator(org.xml.sax.Locator loc)
           
 void skippedEntity(java.lang.String name)
           
 void startCDATA()
           
 void startDocument()
           
 void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
           
 void startElement(java.lang.String uri, java.lang.String loc, java.lang.String raw, org.xml.sax.Attributes a)
           
 void startEntity(java.lang.String name)
           
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.avalon.framework.logger.Logger log

S_AVAIL

private static final int S_AVAIL
See Also:
Constant Field Values

S_DTD

private static final int S_DTD
See Also:
Constant Field Values

S_DOC

private static final int S_DOC
See Also:
Constant Field Values

S_BODY

private static final int S_BODY
See Also:
Constant Field Values

S_CDATA

private static final int S_CDATA
See Also:
Constant Field Values

stateName

private static final java.lang.String[] stateName

state

private int state

locator

private org.xml.sax.Locator locator

listener

protected DOMBuilder.Listener listener

namespaces

private NamespacesTable namespaces

document

private org.w3c.dom.Document document

current

private org.w3c.dom.Node current

name

private java.lang.String name

undecl

private java.util.Vector undecl

factory

protected org.apache.cocoon.xml.dom.DOMFactory factory
Constructor Detail

DOMBuilder

protected DOMBuilder()

DOMBuilder

public DOMBuilder(org.apache.cocoon.xml.dom.DOMFactory factory)

DOMBuilder

public DOMBuilder(org.apache.cocoon.xml.dom.DOMFactory factory,
                  DOMBuilder.Listener listener)

DOMBuilder

public DOMBuilder(org.w3c.dom.Node parentNode)
Method Detail

characters

public void characters(char[] chars,
                       int start,
                       int len)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException

comment

public void comment(char[] chars,
                    int start,
                    int len)
             throws org.xml.sax.SAXException
Specified by:
comment in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException

endCDATA

public void endCDATA()
              throws org.xml.sax.SAXException
Specified by:
endCDATA in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException

endDTD

public void endDTD()
            throws org.xml.sax.SAXException
Specified by:
endDTD in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Specified by:
endDocument in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String loc,
                       java.lang.String raw)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException

endEntity

public void endEntity(java.lang.String name)
               throws org.xml.sax.SAXException
Specified by:
endEntity in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException

getDocument

public org.w3c.dom.Document getDocument()

ignorableWhitespace

public void ignorableWhitespace(char[] chars,
                                int start,
                                int len)
                         throws org.xml.sax.SAXException
Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException

location

private java.lang.String location()

notify

protected void notify(org.w3c.dom.Document doc)
               throws org.xml.sax.SAXException
org.xml.sax.SAXException

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator loc)
Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler

enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Specified by:
enableLogging in interface org.apache.avalon.framework.logger.LogEnabled

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException
Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException

startCDATA

public void startCDATA()
                throws org.xml.sax.SAXException
Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException

startDTD

public void startDTD(java.lang.String name,
                     java.lang.String publicId,
                     java.lang.String systemId)
              throws org.xml.sax.SAXException
Specified by:
startDTD in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Specified by:
startDocument in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String uri,
                         java.lang.String loc,
                         java.lang.String raw,
                         org.xml.sax.Attributes a)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException

startEntity

public void startEntity(java.lang.String name)
                 throws org.xml.sax.SAXException
Specified by:
startEntity in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
org.xml.sax.SAXException


Copyright 2003 Bibop Research International. All Rights Reserved.