org.iso_relax.verifier.impl
Class VerifierFilterImpl

java.lang.Object
  |
  +--org.xml.sax.helpers.XMLFilterImpl
        |
        +--org.iso_relax.verifier.impl.VerifierFilterImpl
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, VerifierFilter, XMLFilter, XMLReader

public class VerifierFilterImpl
extends XMLFilterImpl
implements VerifierFilter

plain vanilla VerifierFilter implementation.

A verifier implementation can use this class to support VerifierFilter functionality.

To use this class, implement the Verifier.getVerifierFilter() method as follows:

 public VerifierFilter getVerifierFilter() throws SAXException {
   return new VerifierFilterImpl(getVerifierHandler());
 }
 

Also, usually you may want to override setErrorHandler method so that your VerifierHandler will send errors to that handler.

Version:
$Id: VerifierFilterImpl.java,v 1.5 2003/05/30 23:46:33 kkawa Exp $
Author:
Kohsuke KAWAGUCHI

Constructor Summary
VerifierFilterImpl(Verifier _verifier)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
           
 void endPrefixMapping(java.lang.String prefix)
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
 boolean isValid()
          checks if the document was valid.
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 void setDocumentLocator(Locator locator)
           
 void setEntityResolver(EntityResolver resolver)
           
 void setErrorHandler(ErrorHandler handler)
           
 void skippedEntity(java.lang.String name)
           
 void startDocument()
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, Attributes attributes)
           
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
           
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, notationDecl, parse, parse, resolveEntity, setContentHandler, setDTDHandler, setFeature, setParent, setProperty, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.XMLFilter
getParent, setParent
 
Methods inherited from interface org.xml.sax.XMLReader
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getProperty, parse, parse, setContentHandler, setDTDHandler, setFeature, setProperty
 

Constructor Detail

VerifierFilterImpl

public VerifierFilterImpl(Verifier _verifier)
                   throws SAXException
Method Detail

isValid

public boolean isValid()
Description copied from interface: VerifierFilter
checks if the document was valid.

This method can be only called after this handler receives the endDocument event.

Specified by:
isValid in interface VerifierFilter
Returns:
true if the document was valid, false if not.

setErrorHandler

public void setErrorHandler(ErrorHandler handler)
Specified by:
setErrorHandler in interface XMLReader
Overrides:
setErrorHandler in class XMLFilterImpl

setEntityResolver

public void setEntityResolver(EntityResolver resolver)
Specified by:
setEntityResolver in interface XMLReader
Overrides:
setEntityResolver in class XMLFilterImpl

setDocumentLocator

public void setDocumentLocator(Locator locator)
Specified by:
setDocumentLocator in interface ContentHandler
Overrides:
setDocumentLocator in class XMLFilterImpl

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class XMLFilterImpl
SAXException

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class XMLFilterImpl
SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws SAXException
Specified by:
startPrefixMapping in interface ContentHandler
Overrides:
startPrefixMapping in class XMLFilterImpl
SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws SAXException
Specified by:
endPrefixMapping in interface ContentHandler
Overrides:
endPrefixMapping in class XMLFilterImpl
SAXException

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         Attributes attributes)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class XMLFilterImpl
SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class XMLFilterImpl
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class XMLFilterImpl
SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
Specified by:
ignorableWhitespace in interface ContentHandler
Overrides:
ignorableWhitespace in class XMLFilterImpl
SAXException

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws SAXException
Specified by:
processingInstruction in interface ContentHandler
Overrides:
processingInstruction in class XMLFilterImpl
SAXException

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws SAXException
Specified by:
skippedEntity in interface ContentHandler
Overrides:
skippedEntity in class XMLFilterImpl
SAXException