public class ToXMLContentHandler extends ToTextContentHandler
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
inStartElement |
protected Map<String,String> |
namespaces |
| Constructor and Description |
|---|
ToXMLContentHandler() |
ToXMLContentHandler(OutputStream stream,
String encoding)
Creates an XML serializer that writes to the given byte stream
using the given character encoding.
|
ToXMLContentHandler(String encoding) |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length)
Writes the given characters to the given character stream.
|
void |
endElement(String uri,
String localName,
String qName) |
void |
startDocument()
Writes the XML prefix.
|
void |
startElement(String uri,
String localName,
String qName,
Attributes atts) |
void |
startPrefixMapping(String prefix,
String uri) |
protected void |
write(char ch)
Writes the given character as-is.
|
protected void |
write(String string)
Writes the given string of character as-is.
|
endDocument, ignorableWhitespace, toStringendPrefixMapping, error, fatalError, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, unparsedEntityDecl, warningpublic ToXMLContentHandler(OutputStream stream, String encoding) throws UnsupportedEncodingException
stream - output streamencoding - output encodingUnsupportedEncodingException - if the encoding is unsupportedpublic ToXMLContentHandler(String encoding)
public ToXMLContentHandler()
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class DefaultHandlerSAXExceptionpublic void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class DefaultHandlerSAXExceptionpublic void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
startElement in interface ContentHandlerstartElement in class ToTextContentHandlerSAXExceptionpublic void endElement(String uri, String localName, String qName) throws SAXException
endElement in interface ContentHandlerendElement in class ToTextContentHandlerSAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
ToTextContentHandlercharacters in interface ContentHandlercharacters in class ToTextContentHandlerSAXExceptionprotected void write(char ch)
throws SAXException
ch - character to be writtenSAXException - if the character could not be writtenprotected void write(String string) throws SAXException
string - string of character to be writtenSAXException - if the character string could not be writtenCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.