org.ceryle.xml
Class DeclTracer

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.ceryle.xml.DeclTracer
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, DeclHandler

public class DeclTracer
extends DefaultHandler
implements ErrorHandler, DeclHandler

Uses an instance of a SAX2 parser to provide a DTD declaration event trace.

Since:
JDK1.3
Version:
$Id: DeclTracer.java,v 3.3 2007-06-15 12:10:28 altheim Exp $
Author:
Murray Altheim

Field Summary
protected static String DECLARATION_HANDLER_PROPERTY_ID
          Declaration handler property id (http://xml.org/sax/properties/declaration-handler).
protected static String DEFAULT_PARSER_NAME
          Default parser name.
 
Constructor Summary
DeclTracer(MessageHandler mh)
          Default constructor.
 
Method Summary
 void attributeDecl(String elementName, String attributeName, String type, String valueDefault, String value)
          Attribute declaration.
 void elementDecl(String name, String model)
          Element declaration.
 void error(SAXParseException spe)
          Error.
 void externalEntityDecl(String name, String publicId, String systemId)
          External entity declaration (stub).
 void fatalError(SAXParseException spe)
          Fatal error.
 void internalEntityDecl(String name, String text)
          Internal entity declaration (stub).
 void trace(TypedInputSource source)
          Parse an TypedInputSource source.
 void warning(SAXParseException spe)
          Warning.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DECLARATION_HANDLER_PROPERTY_ID

protected static final String DECLARATION_HANDLER_PROPERTY_ID
Declaration handler property id (http://xml.org/sax/properties/declaration-handler).

See Also:
Constant Field Values

DEFAULT_PARSER_NAME

protected static final String DEFAULT_PARSER_NAME
Default parser name.

See Also:
Constant Field Values
Constructor Detail

DeclTracer

public DeclTracer(MessageHandler mh)
Default constructor.

Method Detail

trace

public void trace(TypedInputSource source)
Parse an TypedInputSource source.


elementDecl

public void elementDecl(String name,
                        String model)
                 throws SAXException
Element declaration.

Specified by:
elementDecl in interface DeclHandler
Throws:
SAXException

attributeDecl

public void attributeDecl(String elementName,
                          String attributeName,
                          String type,
                          String valueDefault,
                          String value)
                   throws SAXException
Attribute declaration.

Specified by:
attributeDecl in interface DeclHandler
Throws:
SAXException

internalEntityDecl

public void internalEntityDecl(String name,
                               String text)
                        throws SAXException
Internal entity declaration (stub).

Specified by:
internalEntityDecl in interface DeclHandler
Throws:
SAXException

externalEntityDecl

public void externalEntityDecl(String name,
                               String publicId,
                               String systemId)
                        throws SAXException
External entity declaration (stub).

Specified by:
externalEntityDecl in interface DeclHandler
Throws:
SAXException

warning

public void warning(SAXParseException spe)
Warning.

Specified by:
warning in interface ErrorHandler
Overrides:
warning in class DefaultHandler

error

public void error(SAXParseException spe)
Error.

Specified by:
error in interface ErrorHandler
Overrides:
error in class DefaultHandler

fatalError

public void fatalError(SAXParseException spe)
Fatal error.

Specified by:
fatalError in interface ErrorHandler
Overrides:
fatalError in class DefaultHandler


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.