com.sun.msv.writer
Class ContentHandlerAdaptor

java.lang.Object
  extended bycom.sun.msv.writer.ContentHandlerAdaptor
All Implemented Interfaces:
org.xml.sax.DocumentHandler

public class ContentHandlerAdaptor
extends java.lang.Object
implements org.xml.sax.DocumentHandler

Adapt SAX2 ContentHandler as a SAX1 DocumentHandler. This class wraps a ContentHandler and makes it act as a DocumentHandler.

Author:
David Megginson, sax@megginson.com

Constructor Summary
ContentHandlerAdaptor(org.xml.sax.ContentHandler handler)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
          Adapt a SAX1 characters event.
 void endDocument()
          Adapt a SAX1 end document event.
 void endElement(java.lang.String qName)
          Adapt a SAX1 end element event.
 void ignorableWhitespace(char[] ch, int start, int length)
          Adapt a SAX1 ignorable whitespace event.
 void processingInstruction(java.lang.String target, java.lang.String data)
          Adapt a SAX1 processing instruction event.
 void setDocumentLocator(org.xml.sax.Locator locator)
          Adapt a SAX1 document locator event.
 void startDocument()
          Adapt a SAX1 start document event.
 void startElement(java.lang.String qName, org.xml.sax.AttributeList qAtts)
          Adapt a SAX1 startElement event.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentHandlerAdaptor

public ContentHandlerAdaptor(org.xml.sax.ContentHandler handler)
Method Detail

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Adapt a SAX1 characters event.

Specified by:
characters in interface org.xml.sax.DocumentHandler
Parameters:
ch - An array of characters.
start - The starting position in the array.
length - The number of characters to use.
Throws:
org.xml.sax.SAXException - The client may raise a processing exception.
See Also:
DocumentHandler.characters(char[], int, int)

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Adapt a SAX1 end document event.

Specified by:
endDocument in interface org.xml.sax.DocumentHandler
Throws:
org.xml.sax.SAXException - The client may raise a processing exception.
See Also:
DocumentHandler.endDocument()

endElement

public void endElement(java.lang.String qName)
                throws org.xml.sax.SAXException
Adapt a SAX1 end element event.

Specified by:
endElement in interface org.xml.sax.DocumentHandler
Parameters:
qName - The qualified (prefixed) name.
Throws:
org.xml.sax.SAXException - The client may raise a processing exception.
See Also:
DocumentHandler.endElement(java.lang.String)

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
Adapt a SAX1 ignorable whitespace event.

Specified by:
ignorableWhitespace in interface org.xml.sax.DocumentHandler
Parameters:
ch - An array of characters.
start - The starting position in the array.
length - The number of characters to use.
Throws:
org.xml.sax.SAXException - The client may raise a processing exception.
See Also:
DocumentHandler.ignorableWhitespace(char[], int, int)

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Adapt a SAX1 processing instruction event.

Specified by:
processingInstruction in interface org.xml.sax.DocumentHandler
Parameters:
target - The processing instruction target.
data - The remainder of the processing instruction
Throws:
org.xml.sax.SAXException - The client may raise a processing exception.
See Also:
DocumentHandler.processingInstruction(java.lang.String, java.lang.String)

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Adapt a SAX1 document locator event.

Specified by:
setDocumentLocator in interface org.xml.sax.DocumentHandler
Parameters:
locator - A document locator.
See Also:
ContentHandler.setDocumentLocator(org.xml.sax.Locator)

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Adapt a SAX1 start document event.

Specified by:
startDocument in interface org.xml.sax.DocumentHandler
Throws:
org.xml.sax.SAXException - The client may raise a processing exception.
See Also:
DocumentHandler.startDocument()

startElement

public void startElement(java.lang.String qName,
                         org.xml.sax.AttributeList qAtts)
                  throws org.xml.sax.SAXException
Adapt a SAX1 startElement event.

If necessary, perform Namespace processing.

Specified by:
startElement in interface org.xml.sax.DocumentHandler
Parameters:
qName - The qualified (prefixed) name.
qAtts - The XML 1.0 attribute list (with qnames).
Throws:
org.xml.sax.SAXException


Copyright © 2001-2003 Sun Microsystems, Inc. Documenation generated April 26 2005.