FileDocCategorySizeDatePackage
DefaultHandler2.javaAPI DocAndroid 1.5 API6844Wed May 06 22:41:06 BST 2009org.xml.sax.ext

DefaultHandler2

public class DefaultHandler2 extends DefaultHandler implements DeclHandler, LexicalHandler, EntityResolver2
This class extends the SAX2 base handler class to support the SAX2 {@link LexicalHandler}, {@link DeclHandler}, and {@link EntityResolver2} extensions. Except for overriding the original SAX1 {@link DefaultHandler#resolveEntity resolveEntity()} method the added handler methods just return. Subclassers may override everything on a method-by-method basis.
This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY.

Note: this class might yet learn that the ContentHandler.setDocumentLocator() call might be passed a {@link Locator2} object, and that the ContentHandler.startElement() call might be passed a {@link Attributes2} object.

since
SAX 2.0 (extensions 1.1 alpha)
author
David Brownell
version
TBS

Fields Summary
Constructors Summary
public DefaultHandler2()
Constructs a handler which ignores all parsing events.

 
Methods Summary
public voidattributeDecl(java.lang.String eName, java.lang.String aName, java.lang.String type, java.lang.String mode, java.lang.String value)

public voidcomment(char[] ch, int start, int length)

 
public voidelementDecl(java.lang.String name, java.lang.String model)

public voidendCDATA()

public voidendDTD()

public voidendEntity(java.lang.String name)

public voidexternalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)

public org.xml.sax.InputSourcegetExternalSubset(java.lang.String name, java.lang.String baseURI)
Tells the parser that if no external subset has been declared in the document text, none should be used.

param
name Identifies the document root element. This name comes from a DOCTYPE declaration (where available) or from the actual root element. The parameter is ignored.
param
baseURI The document's base URI, serving as an additional hint for selecting the external subset. This is always an absolute URI, unless it is null because the XMLReader was given an InputSource without one. The parameter is ignored.
return
null (always).
exception
SAXException Any SAX exception, possibly wrapping another exception.
exception
IOException Probably indicating a failure to create a new InputStream or Reader, or an illegal URL.

 return null; 
public voidinternalEntityDecl(java.lang.String name, java.lang.String value)

public org.xml.sax.InputSourceresolveEntity(java.lang.String name, java.lang.String publicId, java.lang.String baseURI, java.lang.String systemId)
Tells the parser to resolve the systemId against the baseURI and read the entity text from that resulting absolute URI. Note that because the older {@link DefaultHandler#resolveEntity DefaultHandler.resolveEntity()}, method is overridden to call this one, this method may sometimes be invoked with null name and baseURI, and with the systemId already absolutized.

param
name Identifies the external entity being resolved. Either "[dtd]" for the external subset, or a name starting with "%" to indicate a parameter entity, or else the name of a general entity. This is never null when invoked by a SAX2 parser.
param
publicId The public identifier of the external entity being referenced (normalized as required by the XML specification), or null if none was supplied.
param
baseURI The URI with respect to which relative systemIDs are interpreted. This is always an absolute URI, unless it is null (likely because the XMLReader was given an InputSource without one). This URI is defined by the XML specification to be the one associated with the "<" starting the relevant declaration.
param
systemId The system identifier of the external entity being referenced; either a relative or absolute URI. This is never null when invoked by a SAX2 parser; only declared entities, and any external subset, are resolved by such parsers.
return
An InputSource object describing the new input source.
exception
SAXException Any SAX exception, possibly wrapping another exception.
exception
IOException Probably indicating a failure to create a new InputStream or Reader, or an illegal URL.

 return null; 
public org.xml.sax.InputSourceresolveEntity(java.lang.String publicId, java.lang.String systemId)
Invokes {@link EntityResolver2#resolveEntity EntityResolver2.resolveEntity()} with null entity name and base URI. You only need to override that method to use this class.

param
publicId The public identifier of the external entity being referenced (normalized as required by the XML specification), or null if none was supplied.
param
systemId The system identifier of the external entity being referenced; either a relative or absolute URI. This is never null when invoked by a SAX2 parser; only declared entities, and any external subset, are resolved by such parsers.
return
An InputSource object describing the new input source.
exception
SAXException Any SAX exception, possibly wrapping another exception.
exception
IOException Probably indicating a failure to create a new InputStream or Reader, or an illegal URL.

 return resolveEntity (null, publicId, null, systemId); 
public voidstartCDATA()

public voidstartDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)

public voidstartEntity(java.lang.String name)