com.oroad.stxx.transform.document
Class SAXDocumentBuilder.RootNodeFilter

java.lang.Object
  extended bycom.oroad.stxx.util.AbstractSAXFilter
      extended bycom.oroad.stxx.transform.document.SAXDocumentBuilder.RootNodeFilter
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler, XMLConsumer
Enclosing class:
SAXDocumentBuilder

protected class SAXDocumentBuilder.RootNodeFilter
extends AbstractSAXFilter

Swallows the closing of the root node and stores its name.

Author:
Don Brown

Field Summary
 
Fields inherited from class com.oroad.stxx.util.AbstractSAXFilter
contentHandler, lexicalHandler
 
Constructor Summary
SAXDocumentBuilder.RootNodeFilter(XMLConsumer handler)
          Constructor for the RootNodeFilter object
 
Method Summary
 void endElement(java.lang.String uri, java.lang.String loc, java.lang.String raw)
          Traps the closing of the root node
 java.lang.String getRootNode()
          Returns the name of the root node
 void startElement(java.lang.String uri, java.lang.String loc, java.lang.String raw, org.xml.sax.Attributes a)
          Catches the name of the root node
 
Methods inherited from class com.oroad.stxx.util.AbstractSAXFilter
characters, comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, setLexicalHandler, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXDocumentBuilder.RootNodeFilter

public SAXDocumentBuilder.RootNodeFilter(XMLConsumer handler)
Constructor for the RootNodeFilter object

Parameters:
handler - Handler to send events too
Method Detail

getRootNode

public java.lang.String getRootNode()
Returns the name of the root node

Returns:
The node name

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
Catches the name of the root node

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class AbstractSAXFilter
Parameters:
uri - The uri
loc - The local name
raw - The raw name
a - The attributes
Throws:
org.xml.sax.SAXException - If something goes wrong

endElement

public void endElement(java.lang.String uri,
                       java.lang.String loc,
                       java.lang.String raw)
                throws org.xml.sax.SAXException
Traps the closing of the root node

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class AbstractSAXFilter
Parameters:
uri - The uri
loc - The local name
raw - The raw name
Throws:
org.xml.sax.SAXException - If something goes wrong