public abstract class XmlStreamWriter<S> extends XmlWriter<XMLStreamWriter,S>
XmlWriter
class for XMLStreamWriter
Modifier and Type | Field and Description |
---|---|
private Map<String,String> |
prefixes |
private XMLStreamWriter |
w |
indent, out, XML_FRAGMENT, XML_VERSION
Constructor and Description |
---|
XmlStreamWriter() |
Modifier and Type | Method and Description |
---|---|
protected void |
attr(QName name,
String value)
Write attribute to stream
|
protected void |
attr(String name,
String value)
Write attribute to stream
|
protected void |
attr(String namespace,
String localName,
String value)
Write attribute to stream
|
protected void |
chars(String chars)
Write characters to stream
|
protected void |
chars(String chars,
boolean escape)
Write characters to stream
|
protected void |
empty(QName name)
Write an empty element to stream
|
protected void |
end()
Write the document end to stream
|
protected void |
end(QName name)
Write the end element to new line
|
protected void |
endInline(QName name)
Write end element to the same line
|
protected void |
finish()
Finish the stream writing, flush and close
|
protected void |
flush()
Flush written elements
|
protected XMLStreamWriter |
getXmlWriter()
Get the XML writer
|
protected void |
init(OutputStream out,
String encoding,
EncodingValues encodingValues)
Initialize this XML stream writer
|
protected void |
namespace(String prefix,
String namespace)
Write namespace to stream
|
protected void |
start(boolean embedded)
Write document start to stream with or without
|
protected void |
start(QName name)
Write start element to stream
|
addXlinkHrefAttr, addXlinkTitleAttr, getOutputStream, getReplacement, getXmlOutputFactory, init, init, init, rawText, schemaLocation, time, time, write, write, write, write, writeIndent, writeNewLine, writeXmlObject
private XMLStreamWriter w
protected void init(OutputStream out, String encoding, EncodingValues encodingValues) throws XMLStreamException
XmlWriter
init
in class XmlWriter<XMLStreamWriter,S>
out
- OutputStream to write the encoded elementencoding
- Encoding, e.g. UTF-8encodingValues
- EncodingValues
with additional informationXMLStreamException
- If an error occurs when initializing the writerprotected XMLStreamWriter getXmlWriter()
XmlWriter
getXmlWriter
in class XmlWriter<XMLStreamWriter,S>
protected void attr(QName name, String value) throws XMLStreamException
XmlWriter
attr
in class XmlWriter<XMLStreamWriter,S>
name
- Attribute namevalue
- Attribute valueXMLStreamException
- If an error occurs when writing to OutputStream
protected void attr(String name, String value) throws XMLStreamException
XmlWriter
attr
in class XmlWriter<XMLStreamWriter,S>
name
- Attribute namevalue
- Attribute valueXMLStreamException
- If an error occurs when writing to OutputStream
protected void attr(String namespace, String localName, String value) throws XMLStreamException
XmlWriter
attr
in class XmlWriter<XMLStreamWriter,S>
namespace
- Namespace of the attribute namelocalName
- LocalName of the attribute namevalue
- Attribute valueXMLStreamException
- If an error occurs when writing to OutputStream
protected void namespace(String prefix, String namespace) throws XMLStreamException
XmlWriter
namespace
in class XmlWriter<XMLStreamWriter,S>
prefix
- Namespace prefixnamespace
- Namespace URIXMLStreamException
- If an error occurs when writing to OutputStream
protected void start(QName name) throws XMLStreamException
XmlWriter
start
in class XmlWriter<XMLStreamWriter,S>
name
- Element nameXMLStreamException
- If an error occurs when writing to OutputStream
protected void start(boolean embedded) throws XMLStreamException
XmlWriter
start
in class XmlWriter<XMLStreamWriter,S>
embedded
- if false
, XML version and encoding written to
streamXMLStreamException
- If an error occurs when writing to OutputStream
protected void empty(QName name) throws XMLStreamException
XmlWriter
empty
in class XmlWriter<XMLStreamWriter,S>
name
- Element nameXMLStreamException
- If an error occurs when writing to OutputStream
protected void chars(String chars) throws XMLStreamException
XmlWriter
chars
in class XmlWriter<XMLStreamWriter,S>
chars
- Characters to writeXMLStreamException
- If an error occurs when writing to OutputStream
protected void chars(String chars, boolean escape) throws XMLStreamException
XmlWriter
chars
in class XmlWriter<XMLStreamWriter,S>
chars
- Characters to writeescape
- if the chars should be XML escapedXMLStreamException
- If an error occurs when writing to OutputStream
protected void end(QName name) throws XMLStreamException
XmlWriter
end
in class XmlWriter<XMLStreamWriter,S>
name
- Element nameXMLStreamException
- If an error occurs when writing to OutputStream
protected void endInline(QName name) throws XMLStreamException
XmlWriter
endInline
in class XmlWriter<XMLStreamWriter,S>
name
- Element nameXMLStreamException
- If an error occurs when writing to OutputStream
protected void end() throws XMLStreamException
XmlWriter
end
in class XmlWriter<XMLStreamWriter,S>
XMLStreamException
- If an error occurs when writing to OutputStream
protected void finish() throws XMLStreamException
XmlWriter
finish
in class XmlWriter<XMLStreamWriter,S>
XMLStreamException
- If an error occurs when writing to OutputStream
protected void flush() throws XMLStreamException
XmlWriter
flush
in class XmlWriter<XMLStreamWriter,S>
XMLStreamException
- If an error occurs when writing to OutputStream
Copyright © 2012-2015 52north.org. All Rights Reserved.