gnu.xml.util
Class DefaultHandler

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--gnu.xml.util.DefaultHandler
All Implemented Interfaces:
ContentHandler, DeclHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler

public class DefaultHandler
extends DefaultHandler
implements LexicalHandler, DeclHandler

This class extends the SAX base handler class to support the SAX2 Lexical and Declaration handlers. All the handler methods do is return; except that the SAX base class handles fatal errors by throwing an exception.

Version:
$Date: 2001/06/08 20:59:00 $
Author:
David Brownell

Constructor Summary
DefaultHandler()
          Constructs a handler which ignores all parsing events.
 
Method Summary
 void attributeDecl(java.lang.String element, java.lang.String name, java.lang.String type, java.lang.String defaultType, java.lang.String defaltValue)
          SAX2: called on attribute declarations
 void comment(char[] buf, int off, int len)
          SAX2: called when comments are parsed
 void elementDecl(java.lang.String name, java.lang.String model)
          SAX2: called on element declarations
 void endCDATA()
          SAX2: called after parsing CDATA characters
 void endDTD()
          SAX2: called after the doctype is parsed
 void endEntity(java.lang.String name)
          SAX2: called after parsing a general entity in content
 void externalEntityDecl(java.lang.String name, java.lang.String pubid, java.lang.String sysid)
          SAX2: called on external entity declarations
 void internalEntityDecl(java.lang.String name, java.lang.String value)
          SAX2: called on internal entity declarations
 void startCDATA()
          SAX2: called before parsing CDATA characters
 void startDTD(java.lang.String root, java.lang.String pubid, java.lang.String sysid)
          SAX2: called when the doctype is partially parsed
 void startEntity(java.lang.String name)
          SAX2: called before parsing a general entity in content
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHandler

public DefaultHandler()
Constructs a handler which ignores all parsing events.
Method Detail

startCDATA

public void startCDATA()
                throws SAXException
SAX2: called before parsing CDATA characters
Specified by:
startCDATA in interface LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Throws:
SAXException - The application may raise an exception.
See Also:
LexicalHandler.endCDATA()

endCDATA

public void endCDATA()
              throws SAXException
SAX2: called after parsing CDATA characters
Specified by:
endCDATA in interface LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Throws:
SAXException - The application may raise an exception.
See Also:
LexicalHandler.startCDATA()

startDTD

public void startDTD(java.lang.String root,
                     java.lang.String pubid,
                     java.lang.String sysid)
              throws SAXException
SAX2: called when the doctype is partially parsed
Specified by:
startDTD in interface LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Parameters:
name - The document type name.
publicId - The declared public identifier for the external DTD subset, or null if none was declared.
systemId - The declared system identifier for the external DTD subset, or null if none was declared.
Throws:
SAXException - The application may raise an exception.
See Also:
LexicalHandler.endDTD(), LexicalHandler.startEntity(java.lang.String)

endDTD

public void endDTD()
            throws SAXException
SAX2: called after the doctype is parsed
Specified by:
endDTD in interface LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Throws:
SAXException - The application may raise an exception.
See Also:
LexicalHandler.startDTD(java.lang.String, java.lang.String, java.lang.String)

startEntity

public void startEntity(java.lang.String name)
                 throws SAXException
SAX2: called before parsing a general entity in content
Specified by:
startEntity in interface LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Parameters:
name - The name of the entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be "[dtd]".
Throws:
SAXException - The application may raise an exception.
See Also:
LexicalHandler.endEntity(java.lang.String), DeclHandler.internalEntityDecl(java.lang.String, java.lang.String), DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)

endEntity

public void endEntity(java.lang.String name)
               throws SAXException
SAX2: called after parsing a general entity in content
Specified by:
endEntity in interface LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Parameters:
name - The name of the entity that is ending.
Throws:
SAXException - The application may raise an exception.
See Also:
LexicalHandler.startEntity(java.lang.String)

comment

public void comment(char[] buf,
                    int off,
                    int len)
             throws SAXException
SAX2: called when comments are parsed
Specified by:
comment in interface LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Parameters:
ch - An array holding the characters in the comment.
start - The starting position in the array.
length - The number of characters to use from the array.
Throws:
SAXException - The application may raise an exception.

attributeDecl

public void attributeDecl(java.lang.String element,
                          java.lang.String name,
                          java.lang.String type,
                          java.lang.String defaultType,
                          java.lang.String defaltValue)
                   throws SAXException
SAX2: called on attribute declarations
Specified by:
attributeDecl in interface DeclHandler
Following copied from interface: org.xml.sax.ext.DeclHandler
Parameters:
eName - The name of the associated element.
aName - The name of the attribute.
type - A string representing the attribute type.
valueDefault - A string representing the attribute default ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies.
value - A string representing the attribute's default value, or null if there is none.
Throws:
SAXException - The application may raise an exception.

elementDecl

public void elementDecl(java.lang.String name,
                        java.lang.String model)
                 throws SAXException
SAX2: called on element declarations
Specified by:
elementDecl in interface DeclHandler
Following copied from interface: org.xml.sax.ext.DeclHandler
Parameters:
name - The element type name.
model - The content model as a normalized string.
Throws:
SAXException - The application may raise an exception.

externalEntityDecl

public void externalEntityDecl(java.lang.String name,
                               java.lang.String pubid,
                               java.lang.String sysid)
                        throws SAXException
SAX2: called on external entity declarations
Specified by:
externalEntityDecl in interface DeclHandler
Following copied from interface: org.xml.sax.ext.DeclHandler
Parameters:
name - The name of the entity. If it is a parameter entity, the name will begin with '%'.
publicId - The declared public identifier of the entity, or null if none was declared.
systemId - The declared system identifier of the entity.
Throws:
SAXException - The application may raise an exception.
See Also:
DeclHandler.internalEntityDecl(java.lang.String, java.lang.String), DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

internalEntityDecl

public void internalEntityDecl(java.lang.String name,
                               java.lang.String value)
                        throws SAXException
SAX2: called on internal entity declarations
Specified by:
internalEntityDecl in interface DeclHandler
Following copied from interface: org.xml.sax.ext.DeclHandler
Parameters:
name - The name of the entity. If it is a parameter entity, the name will begin with '%'.
value - The replacement text of the entity.
Throws:
SAXException - The application may raise an exception.
See Also:
DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String), DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

Source code is GPL'd in the JAXP subproject at http://savannah.gnu.org/projects/classpathx
This documentation was derived from that source code on 2001-07-12.