org.iso_relax.dispatcher.impl

Class DispatcherImpl

Implemented Interfaces:
Dispatcher

public class DispatcherImpl
extends java.lang.Object
implements Dispatcher

reference implementation of Dispatcher interface.
Author:
Kohsuke KAWAGUCHI

Constructor Summary

DispatcherImpl(SchemaProvider schema)

Method Summary

void
attachXMLReader(XMLReader reader)
configure XMLReader to use this Dispatcher as a ContentHandler.
int
countNotationDecls()
counts notation declarations found in this XML instance.
int
countUnparsedEntityDecls()
counts unparsed entities found in this XML instance.
ErrorHandler
getErrorHandler()
gets ErrorHandler to which IslandVerifier reports validation errors.
NotationDecl
getNotationDecl(int index)
gets ith notation declaration found in this XML instance.
SchemaProvider
getSchemaProvider()
get ShcmeaProvider object which is attached to this Dispatcher.
UnparsedEntityDecl
getUnparsedEntityDecl(int index)
gets ith unparsed entity found in this XML instance.
void
setErrorHandler(ErrorHandler handler)
sets application-implemented ErrorHandler, which will receive all validation errors.
void
switchVerifier(IslandVerifier newVerifier)
switches to the child IslandVerifier.

Constructor Details

DispatcherImpl

public DispatcherImpl(SchemaProvider schema)

Method Details

attachXMLReader

public void attachXMLReader(XMLReader reader)
configure XMLReader to use this Dispatcher as a ContentHandler.
Specified by:
attachXMLReader in interface Dispatcher

countNotationDecls

public int countNotationDecls()
counts notation declarations found in this XML instance.
Specified by:
countNotationDecls in interface Dispatcher

countUnparsedEntityDecls

public int countUnparsedEntityDecls()
counts unparsed entities found in this XML instance.
Specified by:
countUnparsedEntityDecls in interface Dispatcher

getErrorHandler

public ErrorHandler getErrorHandler()
gets ErrorHandler to which IslandVerifier reports validation errors. the caller may not assume that this method returns the same object that was passed to setErrorHandler method. this method cannot return null.
Specified by:
getErrorHandler in interface Dispatcher

getNotationDecl

public NotationDecl getNotationDecl(int index)
gets ith notation declaration found in this XML instance. IslandVerifiers can not receive DTDHandler events. Those who need DTD information should call this method.
Specified by:
getNotationDecl in interface Dispatcher

getSchemaProvider

public SchemaProvider getSchemaProvider()
get ShcmeaProvider object which is attached to this Dispatcher.
Specified by:
getSchemaProvider in interface Dispatcher

getUnparsedEntityDecl

public UnparsedEntityDecl getUnparsedEntityDecl(int index)
gets ith unparsed entity found in this XML instance. IslandVerifiers can not receive DTDHandler events. Those who need DTD information should call this method.
Specified by:
getUnparsedEntityDecl in interface Dispatcher

setErrorHandler

public void setErrorHandler(ErrorHandler handler)
sets application-implemented ErrorHandler, which will receive all validation errors.
Specified by:
setErrorHandler in interface Dispatcher

switchVerifier

public void switchVerifier(IslandVerifier newVerifier)
            throws SAXException
switches to the child IslandVerifier. this method can only be called during startElement method.
Specified by:
switchVerifier in interface Dispatcher