org.bibop.xml.xforge.types
Class XMLFragment

java.lang.Object
  |
  +--org.bibop.xml.xforge.types.AbstractXForgeClass
        |
        +--org.bibop.xml.xforge.types.XMLFragment
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler, PrefixesMonitor, XForgeClass, XMLConsumer, XMLProducer

public class XMLFragment
extends AbstractXForgeClass

A default implementation of SAX events processing.

Version:
1.0
Author:
Alberto Garoffolo

Field Summary
protected  DOMBuilder db
           
protected  java.util.List existingprefixes
           
static java.lang.String FRAGMENT_NSURI
           
static java.lang.String FRAGMENT_PREFIX
           
 
Fields inherited from class org.bibop.xml.xforge.types.AbstractXForgeClass
contentHandler, lexicalHandler
 
Constructor Summary
XMLFragment()
           
 
Method Summary
 void characters(char[] ch, int start, int len)
          Receive notification of character data.
protected  void closeDocument()
           
 void comment(char[] ch, int start, int len)
          Report an XML comment anywhere in the document.
 void endCDATA()
          Report the end of a CDATA section.
 void endDocument()
          Receive notification of the end of a document.
 void endElement(java.lang.String uri, java.lang.String loc, java.lang.String raw)
          Receive notification of the end of an element.
 void endEntity(java.lang.String name)
          Report the end of an entity.
 void endPrefixMapping(java.lang.String prefix)
          End the scope of a prefix-URI mapping.
 org.w3c.dom.Element getRoot()
           
 void ignorableWhitespace(char[] ch, int start, int len)
          Receive notification of ignorable whitespace in element content.
protected  void openDocument()
           
 void reset()
           
 void reset(java.io.InputStream cxis)
           
 void reset(org.w3c.dom.Node nl)
           
 void reset(org.w3c.dom.NodeList nl)
           
 void reset(java.lang.String str)
           
 void skippedEntity(java.lang.String name)
          Receive notification of a skipped entity.
 void startCDATA()
          Report the start of a CDATA section.
 void startDocument()
          Receive notification of the beginning of a document.
 void startElement(java.lang.String uri, java.lang.String loc, java.lang.String raw, org.xml.sax.Attributes a)
          Receive notification of the beginning of an element.
 void startEntity(java.lang.String name)
          Report the beginning of an entity.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Begin the scope of a prefix-URI Namespace mapping.
 void toSax()
          Creates the SAX events once processing has finished.
 
Methods inherited from class org.bibop.xml.xforge.types.AbstractXForgeClass
endDTD, flushSAXCache, getActivePrefixes, processingInstruction, setConsumer, setContentHandler, setDocumentLocator, setLexicalHandler, setParentPrefixesMonitor, startDTD
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FRAGMENT_PREFIX

public static java.lang.String FRAGMENT_PREFIX

FRAGMENT_NSURI

public static java.lang.String FRAGMENT_NSURI

db

protected DOMBuilder db

existingprefixes

protected java.util.List existingprefixes
Constructor Detail

XMLFragment

public XMLFragment()
            throws XForgeException
Method Detail

openDocument

protected void openDocument()
                     throws org.xml.sax.SAXException
org.xml.sax.SAXException

closeDocument

protected void closeDocument()
                      throws org.xml.sax.SAXException
org.xml.sax.SAXException

reset

public void reset()
           throws XForgeException
XForgeException

reset

public void reset(org.w3c.dom.Node nl)
           throws XForgeException
XForgeException

reset

public void reset(org.w3c.dom.NodeList nl)
           throws XForgeException
XForgeException

reset

public void reset(java.lang.String str)
           throws XForgeException
XForgeException

reset

public void reset(java.io.InputStream cxis)
           throws XForgeException
XForgeException

getRoot

public org.w3c.dom.Element getRoot()

toSax

public void toSax()
           throws org.xml.sax.SAXException
Creates the SAX events once processing has finished.

Throws:
org.xml.sax.SAXException

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Receive notification of the beginning of a document.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class AbstractXForgeClass
org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Receive notification of the end of a document.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class AbstractXForgeClass
org.xml.sax.SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Begin the scope of a prefix-URI Namespace mapping.

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
startPrefixMapping in class AbstractXForgeClass
Parameters:
prefix - The Namespace prefix being declared.
uri - The Namespace URI the prefix is mapped to.
org.xml.sax.SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
End the scope of a prefix-URI mapping.

Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
endPrefixMapping in class AbstractXForgeClass
Parameters:
prefix - The prefix that was being mapping.
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
Receive notification of the beginning of an element.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class AbstractXForgeClass
Parameters:
uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
loc - The local name (without prefix), or the empty string if Namespace processing is not being performed.
raw - The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
a - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
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
Receive notification of the end of an element.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class AbstractXForgeClass
Parameters:
uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
loc - The local name (without prefix), or the empty string if Namespace processing is not being performed.
raw - The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int len)
                throws org.xml.sax.SAXException
Receive notification of character data.

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class AbstractXForgeClass
Parameters:
ch - The characters from the XML document.
start - The start position in the array.
len - The number of characters to read from the array.
org.xml.sax.SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int len)
                         throws org.xml.sax.SAXException
Receive notification of ignorable whitespace in element content.

Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Overrides:
ignorableWhitespace in class AbstractXForgeClass
Parameters:
ch - The characters from the XML document.
start - The start position in the array.
len - The number of characters to read from the array.
org.xml.sax.SAXException

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException
Receive notification of a skipped entity.

Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Overrides:
skippedEntity in class AbstractXForgeClass
Parameters:
name - The name of the skipped entity. If it is a parameter entity, the name will begin with '%'.
org.xml.sax.SAXException

startEntity

public void startEntity(java.lang.String name)
                 throws org.xml.sax.SAXException
Report the beginning of an entity.

Specified by:
startEntity in interface org.xml.sax.ext.LexicalHandler
Overrides:
startEntity in class AbstractXForgeClass
Parameters:
name - The name of the entity. If it is a parameter entity, the name will begin with '%'.
org.xml.sax.SAXException

endEntity

public void endEntity(java.lang.String name)
               throws org.xml.sax.SAXException
Report the end of an entity.

Specified by:
endEntity in interface org.xml.sax.ext.LexicalHandler
Overrides:
endEntity in class AbstractXForgeClass
Parameters:
name - The name of the entity that is ending.
org.xml.sax.SAXException

startCDATA

public void startCDATA()
                throws org.xml.sax.SAXException
Report the start of a CDATA section.

Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler
Overrides:
startCDATA in class AbstractXForgeClass
org.xml.sax.SAXException

endCDATA

public void endCDATA()
              throws org.xml.sax.SAXException
Report the end of a CDATA section.

Specified by:
endCDATA in interface org.xml.sax.ext.LexicalHandler
Overrides:
endCDATA in class AbstractXForgeClass
org.xml.sax.SAXException

comment

public void comment(char[] ch,
                    int start,
                    int len)
             throws org.xml.sax.SAXException
Report an XML comment anywhere in the document.

Specified by:
comment in interface org.xml.sax.ext.LexicalHandler
Overrides:
comment in class AbstractXForgeClass
Parameters:
ch - An array holding the characters in the comment.
start - The starting position in the array.
len - The number of characters to use from the array.
org.xml.sax.SAXException


Copyright 2003 Bibop Research International. All Rights Reserved.