|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.aliasi.xml.SimpleElementHandler
com.aliasi.xml.SAXFilterHandler
com.aliasi.xml.SAXWriterFilter
@Deprecated public class SAXWriterFilter
A SAXWriterFilter handles SAX events and writes a
character-based representation to a specified output stream in the
specified character encoding and also passes them to a contained
handler. The methods provided are exactly the same as those for
a SAXWriter.
All events are passed to the contained handler, and this
contained handler may be specified at construction time or through
the filter method SAXFilterHandler.setHandler(DefaultHandler).
Note that a DTD specified by setDTDString(String) is
not passed to the contained handler, but is only written to the
output stream.
| Field Summary |
|---|
| Fields inherited from class com.aliasi.xml.SAXFilterHandler |
|---|
mHandler |
| Fields inherited from class com.aliasi.xml.SimpleElementHandler |
|---|
CDATA_ATTS_TYPE, EMPTY_ATTS, NO_OP_DEFAULT_HANDLER |
| Constructor Summary | |
|---|---|
SAXWriterFilter()
Deprecated. Construct a SAX writer that does not have an output stream, character set, or contained handler specified. |
|
SAXWriterFilter(OutputStream out,
String charsetName,
DefaultHandler handler)
Deprecated. Construct a SAX writer that writes to the specified output stream using the specified character set. |
|
| Method Summary | |
|---|---|
void |
characters(char[] ch,
int start,
int length)
Deprecated. Prints the characters in the specified range. |
void |
endDocument()
Deprecated. Flushes the underlying character writers output to the output stream, trapping all exceptions. |
void |
endElement(String namespaceURI,
String localName,
String qName)
Deprecated. Prints the end element, using the qualified name. |
void |
endPrefixMapping(String prefix)
Deprecated. Handles the declaration of a namespace mapping from a specified URI to its identifying prefix. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Deprecated. Does not print ignorable whitespace, nor does it send the event to the contained handler. |
void |
processingInstruction(String target,
String data)
Deprecated. Print a representation of the proecssing instruction. |
void |
setDTDString(String dtdString)
Deprecated. Sets the DTD to be written by this writer to the specified value. |
void |
setOutputStream(OutputStream out,
String charsetName)
Deprecated. Sets the output stream to which the XML is written, and the character set which is used to encode characters. |
void |
startDocument()
Deprecated. Prints the XML declaration, and DTD declaration if any. |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
Deprecated. Prints the start element, using the qualified name, and sorting the attributes using the underlying string ordering. |
void |
startPrefixMapping(String prefix,
String uri)
Deprecated. Handles the declaration of a namespace mapping from a specified URI to its identifying prefix. |
| Methods inherited from class com.aliasi.xml.SAXFilterHandler |
|---|
error, fatalError, notationDecl, resolveEntity, setDocumentLocator, setHandler, skippedEntity, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SAXWriterFilter(OutputStream out,
String charsetName,
DefaultHandler handler)
throws UnsupportedEncodingException
setOutputStream(OutputStream,String) for details on the
management of the output stream and character set.
out - Output stream to which bytes are written.charsetName - Name of character encoding used to write output.handler - Contained handler for this filter.
UnsupportedEncodingException - If the character set is not supported.public SAXWriterFilter()
setOutputStream(OutputStream,String) or an
illegal state exception will be thrown. The contained handler
will default to a no-op handler, but may be set by SAXFilterHandler.setHandler(DefaultHandler).
| Method Detail |
|---|
public void setDTDString(String dtdString)
dtdString - String to write after the XML declaration as
the DTD declaration.
public final void setOutputStream(OutputStream out,
String charsetName)
throws UnsupportedEncodingException
out - Output stream to which encoded characters are written.charsetName - Character set to use for encoding characters.
UnsupportedEncodingException - If the character set is
not supported by the Java runtime.
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class SAXFilterHandlerSAXException - if the contained hanlder throws a SAX
exception.
public void startPrefixMapping(String prefix,
String uri)
throws SAXException
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class SAXFilterHandlerprefix - The namespace prefix being declared..uri - The namespace URI mapped to prefix.
SAXException - If the contained handler throws an
exception on the specified prefix mapping.
public void endPrefixMapping(String prefix)
throws SAXException
endPrefixMapping in interface ContentHandlerendPrefixMapping in class SAXFilterHandlerprefix - The namespace prefix being declared..
SAXException - If the contained handler throws an exception
on the specified prefix.
public void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class SAXFilterHandlerSAXException - if the contained hanlder throws a SAX
exception.
public void startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException
null.
startElement in interface ContentHandlerstartElement in class SAXFilterHandlernamespaceURI - The URI of the namespace for this element.localName - The local name (without prefix) for this
element.qName - The qualified name (with prefix, if any) for this
element.atts - The attributes for this element.
SAXException - if the contained hanlder throws a SAX
exception.
public void endElement(String namespaceURI,
String localName,
String qName)
throws SAXException
null
endElement in interface ContentHandlerendElement in class SAXFilterHandlernamespaceURI - The URI of the namespace for this element.localName - The local name (without prefix) for this
element.qName - The qualified name (with prefix, if any) for this
element.
SAXException - if the contained hanlder throws a SAX
exception.
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class SAXFilterHandlerch - Character array from which to draw characters.start - Index of first character to print.length - Number of characters to print.
SAXException - if the contained hanlder throws a SAX
exception.
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerignorableWhitespace in class SAXFilterHandlerch - Character array from which to draw characters.start - Index of first character to print.length - Number of characters to print.
SAXException - if the contained hanlder throws a SAX
exception.
public void processingInstruction(String target,
String data)
throws SAXException
⟨?Target⟩ if there is
no data, or * <?Target
Data> if there is data.
processingInstruction in interface ContentHandlerprocessingInstruction in class SAXFilterHandlertarget - Target of the instruction.data - Value of the instruction, or null.
SAXException - if the contained hanlder throws a SAX
exception.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||