| java.lang.Object org.jibx.runtime.impl.XMLWriterNamespaceBase org.jibx.runtime.impl.XMLWriterBase org.jibx.runtime.impl.StreamWriterBase
All known Subclasses: org.jibx.runtime.impl.ISO88591StreamWriter, org.jibx.runtime.impl.UTF8StreamWriter,
StreamWriterBase | abstract public class StreamWriterBase extends XMLWriterBase (Code) | | Base handler for marshalling text document to an output stream. This is
designed for use with character encodings that use standard one-byte values
for Unicode characters in the 0x20-0x7F range, which includes the most
widely used encodings for XML documents. It needs to be subclassed with
implementation methods specific to the encoding used.
author: Dennis M. Sosnoski version: 1.0 |
Method Summary | |
public void | close() Close document output. | public void | flush() Flush document output. | public void | indent(int bias) Request output indent. | public void | indent() Request output indent. | protected void | makeSpace(int length) Make at least the requested number of bytes available in the output
buffer. | public void | popExtensionNamespaces() Remove extension namespace URIs. | public void | pushExtensionNamespaces(String[] uris) Append extension namespace URIs to those in mapping. | public void | reset() Reset to initial state for reuse. | public void | setIndentSpaces(int count, String newline, char indent) Set nesting indentation. | public void | setOutput(OutputStream outs) Set output stream. | protected void | undefineNamespace(int index) Report that namespace has been undefined. | protected int | writeEntity(byte[] bytes, int offset) Write entity bytes to output. | protected void | writePrefix(int index) Write namespace prefix to output. |
AMP_ENTITY | final protected static byte[] AMP_ENTITY(Code) | | |
GT_ENTITY | final protected static byte[] GT_ENTITY(Code) | | |
LT_CDATAEND | final protected static byte[] LT_CDATAEND(Code) | | |
LT_CDATASTART | final protected static byte[] LT_CDATASTART(Code) | | |
LT_ENTITY | final protected static byte[] LT_ENTITY(Code) | | |
QUOT_ENTITY | final protected static byte[] QUOT_ENTITY(Code) | | |
m_buffer | protected byte[] m_buffer(Code) | | Buffer for accumulating output bytes.
|
m_extensionBytes | protected byte[][][] m_extensionBytes(Code) | | Byte sequences for prefixes of extension namespaces in scope.
|
m_fillOffset | protected int m_fillOffset(Code) | | Current offset in filling buffer.
|
m_prefixBytes | protected byte[][] m_prefixBytes(Code) | | Byte sequences for prefixes of namespaces in scope.
|
StreamWriterBase | public StreamWriterBase(String enc, String[] uris)(Code) | | Constructor.
Parameters: enc - character encoding used for output to streams Parameters: uris - ordered array of URIs for namespaces used in document (mustbe constant; the value in position 0 must always be the empty string "",and the value in position 1 must always be the XML namespace"http://www.w3.org/XML/1998/namespace") |
StreamWriterBase | public StreamWriterBase(StreamWriterBase base, String[] uris)(Code) | | Copy constructor. This takes the stream and encoding information from a
supplied instance, while setting a new array of namespace URIs. It's
intended for use when invoking one binding from within another binding.
Parameters: base - instance to be used as base for writer Parameters: uris - ordered array of URIs for namespaces used in document(see StreamWriterBase.StreamWriterBase(String,String[])) |
close | public void close() throws IOException(Code) | | Close document output. Completes writing of document output, including
closing the output medium.
throws: IOException - on error writing to document |
flush | public void flush() throws IOException(Code) | | Flush document output. Forces out all output generated to this point.
throws: IOException - on error writing to document |
indent | public void indent(int bias) throws IOException(Code) | | Request output indent. Output the line end sequence followed by the
appropriate number of indent characters.
Parameters: bias - indent depth difference (positive or negative) from currentelement nesting depth throws: IOException - on error writing to document |
indent | public void indent() throws IOException(Code) | | Request output indent. Output the line end sequence followed by the
appropriate number of indent characters for the current nesting level.
throws: IOException - on error writing to document |
makeSpace | protected void makeSpace(int length) throws IOException(Code) | | Make at least the requested number of bytes available in the output
buffer. If necessary, the output buffer will be replaced by a larger
buffer.
Parameters: length - number of bytes space to be made available throws: IOException - if error writing to document |
pushExtensionNamespaces | public void pushExtensionNamespaces(String[] uris)(Code) | | Append extension namespace URIs to those in mapping.
Parameters: uris - namespace URIs to extend those in mapping |
reset | public void reset()(Code) | | Reset to initial state for reuse. This override of the base class
method handles clearing the internal buffer when starting a new
document.
|
setIndentSpaces | public void setIndentSpaces(int count, String newline, char indent)(Code) | | Set nesting indentation. This is advisory only, and implementations of
this interface are free to ignore it. The intent is to indicate that the
generated output should use indenting to illustrate element nesting.
Parameters: count - number of character to indent per level, or disableindentation if negative (zero means new line only) Parameters: newline - sequence of characters used for a line ending(null means use the single character '\n') Parameters: indent - whitespace character used for indentation |
setOutput | public void setOutput(OutputStream outs)(Code) | | Set output stream. If an output stream is currently open when this is
called the existing stream is flushed and closed, with any errors
ignored.
Parameters: outs - stream for document data output |
undefineNamespace | protected void undefineNamespace(int index)(Code) | | Report that namespace has been undefined.
Parameters: index - namespace URI index number |
writeEntity | protected int writeEntity(byte[] bytes, int offset)(Code) | | Write entity bytes to output.
Parameters: bytes - actual bytes to be written Parameters: offset - starting offset in buffer offset for next data byte in buffer |
writePrefix | protected void writePrefix(int index) throws IOException(Code) | | Write namespace prefix to output. This internal method is used to throw
an exception when an undeclared prefix is used.
Parameters: index - namespace URI index number throws: IOException - if error writing to document |
Methods inherited from org.jibx.runtime.impl.XMLWriterBase | public void addAttribute(int index, String name, String value) throws IOException(Code)(Java Doc) abstract public void close() throws IOException(Code)(Java Doc) public void closeEmptyTag() throws IOException(Code)(Java Doc) public void closeStartTag() throws IOException(Code)(Java Doc) abstract public IXMLWriter createChildWriter(String[] uris)(Code)(Java Doc) public void endTag(int index, String name) throws IOException(Code)(Java Doc) final protected void flagContent() throws IOException(Code)(Java Doc) final protected void flagTextContent() throws IOException(Code)(Java Doc) abstract public void flush() throws IOException(Code)(Java Doc) abstract protected void indent(int bias) throws IOException(Code)(Java Doc) public void reset()(Code)(Java Doc) public void startTagClosed(int index, String name) throws IOException(Code)(Java Doc) public void startTagNamespaces(int index, String name, int[] nums, String[] prefs) throws IOException(Code)(Java Doc) public void startTagOpen(int index, String name) throws IOException(Code)(Java Doc) abstract protected void writeAttributeText(String text) throws IOException(Code)(Java Doc) public void writeComment(String text) throws IOException(Code)(Java Doc) public void writeDocType(String name, String sys, String pub, String subset) throws IOException(Code)(Java Doc) public void writeEntityRef(String name) throws IOException(Code)(Java Doc) abstract protected void writeMarkup(String text) throws IOException(Code)(Java Doc) abstract protected void writeMarkup(char chr) throws IOException(Code)(Java Doc) public void writePI(String target, String data) throws IOException(Code)(Java Doc) abstract protected void writePrefix(int index) throws IOException(Code)(Java Doc) public void writeXMLDecl(String version, String encoding, String standalone) throws IOException(Code)(Java Doc)
|
|
|