org.xml.sax.ext

Class DefaultHandler2

public class DefaultHandler2 extends DefaultHandler implements LexicalHandler, DeclHandler, 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)

Version: TBS

Author: David Brownell

Constructor Summary
DefaultHandler2()
Constructs a handler which ignores all parsing events.
Method Summary
voidattributeDecl(String eName, String aName, String type, String mode, String value)
voidcomment(char[] ch, int start, int length)
voidelementDecl(String name, String model)
voidendCDATA()
voidendDTD()
voidendEntity(String name)
voidexternalEntityDecl(String name, String publicId, String systemId)
InputSourcegetExternalSubset(String name, String baseURI)
Tells the parser that if no external subset has been declared in the document text, none should be used.
voidinternalEntityDecl(String name, String value)
InputSourceresolveEntity(String name, String publicId, String baseURI, String systemId)
Tells the parser to resolve the systemId against the baseURI and read the entity text from that resulting absolute URI.
InputSourceresolveEntity(String publicId, String systemId)
Invokes {@link EntityResolver2#resolveEntity EntityResolver2.resolveEntity()} with null entity name and base URI.
voidstartCDATA()
voidstartDTD(String name, String publicId, String systemId)
voidstartEntity(String name)

Constructor Detail

DefaultHandler2

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

Method Detail

attributeDecl

public void attributeDecl(String eName, String aName, String type, String mode, String value)

comment

public void comment(char[] ch, int start, int length)

elementDecl

public void elementDecl(String name, String model)

endCDATA

public void endCDATA()

endDTD

public void endDTD()

endEntity

public void endEntity(String name)

externalEntityDecl

public void externalEntityDecl(String name, String publicId, String systemId)

getExternalSubset

public InputSource getExternalSubset(String name, String baseURI)
Tells the parser that if no external subset has been declared in the document text, none should be used.

internalEntityDecl

public void internalEntityDecl(String name, String value)

resolveEntity

public InputSource resolveEntity(String name, String publicId, String baseURI, 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.

resolveEntity

public InputSource resolveEntity(String publicId, 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.

startCDATA

public void startCDATA()

startDTD

public void startDTD(String name, String publicId, String systemId)

startEntity

public void startEntity(String name)