Package com.sun.msv.writer
Class ContentHandlerAdaptor
- java.lang.Object
-
- com.sun.msv.writer.ContentHandlerAdaptor
-
- All Implemented Interfaces:
DocumentHandler
public class ContentHandlerAdaptor extends Object implements 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
Constructors Constructor Description ContentHandlerAdaptor(ContentHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Adapt a SAX1 characters event.voidendDocument()Adapt a SAX1 end document event.voidendElement(String qName)Adapt a SAX1 end element event.voidignorableWhitespace(char[] ch, int start, int length)Adapt a SAX1 ignorable whitespace event.voidprocessingInstruction(String target, String data)Adapt a SAX1 processing instruction event.voidsetDocumentLocator(Locator locator)Adapt a SAX1 document locator event.voidstartDocument()Adapt a SAX1 start document event.voidstartElement(String qName, AttributeList qAtts)Adapt a SAX1 startElement event.
-
-
-
Constructor Detail
-
ContentHandlerAdaptor
public ContentHandlerAdaptor(ContentHandler handler)
-
-
Method Detail
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
Adapt a SAX1 document locator event.- Specified by:
setDocumentLocatorin interfaceDocumentHandler- Parameters:
locator- A document locator.- See Also:
ContentHandler.setDocumentLocator(org.xml.sax.Locator)
-
startDocument
public void startDocument() throws SAXExceptionAdapt a SAX1 start document event.- Specified by:
startDocumentin interfaceDocumentHandler- Throws:
SAXException- The client may raise a processing exception.- See Also:
DocumentHandler.startDocument()
-
endDocument
public void endDocument() throws SAXExceptionAdapt a SAX1 end document event.- Specified by:
endDocumentin interfaceDocumentHandler- Throws:
SAXException- The client may raise a processing exception.- See Also:
DocumentHandler.endDocument()
-
startElement
public void startElement(String qName, AttributeList qAtts) throws SAXException
Adapt a SAX1 startElement event.If necessary, perform Namespace processing.
- Specified by:
startElementin interfaceDocumentHandler- Parameters:
qName- The qualified (prefixed) name.qAtts- The XML 1.0 attribute list (with qnames).- Throws:
SAXException
-
endElement
public void endElement(String qName) throws SAXException
Adapt a SAX1 end element event.- Specified by:
endElementin interfaceDocumentHandler- Parameters:
qName- The qualified (prefixed) name.- Throws:
SAXException- The client may raise a processing exception.- See Also:
DocumentHandler.endElement(java.lang.String)
-
characters
public void characters(char[] ch, int start, int length) throws SAXExceptionAdapt a SAX1 characters event.- Specified by:
charactersin interfaceDocumentHandler- Parameters:
ch- An array of characters.start- The starting position in the array.length- The number of characters to use.- Throws:
SAXException- The client may raise a processing exception.- See Also:
DocumentHandler.characters(char[], int, int)
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXExceptionAdapt a SAX1 ignorable whitespace event.- Specified by:
ignorableWhitespacein interfaceDocumentHandler- Parameters:
ch- An array of characters.start- The starting position in the array.length- The number of characters to use.- Throws:
SAXException- The client may raise a processing exception.- See Also:
DocumentHandler.ignorableWhitespace(char[], int, int)
-
processingInstruction
public void processingInstruction(String target, String data) throws SAXException
Adapt a SAX1 processing instruction event.- Specified by:
processingInstructionin interfaceDocumentHandler- Parameters:
target- The processing instruction target.data- The remainder of the processing instruction- Throws:
SAXException- The client may raise a processing exception.- See Also:
DocumentHandler.processingInstruction(java.lang.String, java.lang.String)
-
-