|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Writer
java.io.OutputStreamWriter
org.apache.xmlrpc.XmlWriter
class XmlWriter
A XML writer intended for single-thread usage. If you feed it a
ByteArrayInputStream, it may be necessary to call
writer.flush() before calling
buffer.toByteArray() to get the data written to
your byte buffer.
| Field Summary | |
|---|---|
protected static java.lang.String |
AMPERSAND_ENTITY
|
protected static org.apache.commons.codec.binary.Base64 |
base64Codec
|
protected static java.lang.String |
CLOSING_TAG_START
|
(package private) DateTool |
dateTool
Thread-safe wrapper for the DateFormat object used
to parse date/time values. |
protected static java.lang.String |
GREATER_THAN_ENTITY
|
(package private) boolean |
hasWrittenProlog
Whether the XML prolog has been written. |
(package private) static java.lang.String |
ISO8859_1
Java's name for the ISO-8859-1 encoding. |
protected static java.lang.String |
LESS_THAN_ENTITY
|
protected static java.lang.String |
PROLOG_END
|
protected static java.lang.String |
PROLOG_START
|
protected static java.lang.String |
SINGLE_TAG_END
|
protected static TypeDecoder |
typeDecoder
Class to delegate type decoding to. |
(package private) static java.lang.String |
UTF16
Java's name for the UTF-16 encoding. |
(package private) static java.lang.String |
UTF8
Java's name for the UTF-8 encoding. |
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
XmlWriter(java.io.OutputStream out,
java.lang.String enc)
Creates a new instance. |
|
| Method Summary | |
|---|---|
protected static java.lang.String |
canonicalizeEncoding(java.lang.String javaEncoding)
Deprecated. This method will not be visible in 2.0. |
protected void |
chardata(java.lang.String text)
Writes text as PCDATA. |
protected void |
emptyElement(java.lang.String elem)
|
protected void |
endElement(java.lang.String elem)
|
protected static void |
setTypeDecoder(TypeDecoder newTypeDecoder)
|
protected void |
startElement(java.lang.String elem)
|
protected void |
write(byte[] byteData)
This is used to write out the Base64 output... |
void |
write(char c)
A mostly pass-through implementation wrapping OutputStreamWriter.write() which assures that the
XML prolog is written before any other data. |
void |
write(char[] cbuf,
int off,
int len)
A mostly pass-through implementation wrapping OutputStreamWriter.write() which assures that the
XML prolog is written before any other data. |
void |
write(java.lang.String str,
int off,
int len)
A mostly pass-through implementation wrapping OutputStreamWriter.write() which assures that the
XML prolog is written before any other data. |
void |
writeObject(java.lang.Object obj)
Writes the XML representation of a supported Java object type. |
| Methods inherited from class java.io.OutputStreamWriter |
|---|
close, flush, getEncoding, write |
| Methods inherited from class java.io.Writer |
|---|
append, append, append, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String PROLOG_START
protected static final java.lang.String PROLOG_END
protected static final java.lang.String CLOSING_TAG_START
protected static final java.lang.String SINGLE_TAG_END
protected static final java.lang.String LESS_THAN_ENTITY
protected static final java.lang.String GREATER_THAN_ENTITY
protected static final java.lang.String AMPERSAND_ENTITY
static final java.lang.String ISO8859_1
static final java.lang.String UTF8
static final java.lang.String UTF16
protected static final org.apache.commons.codec.binary.Base64 base64Codec
protected static TypeDecoder typeDecoder
DateTool dateTool
DateFormat object used
to parse date/time values.
boolean hasWrittenProlog
| Constructor Detail |
|---|
public XmlWriter(java.io.OutputStream out,
java.lang.String enc)
throws java.io.UnsupportedEncodingException
out - The stream to write output to.enc - The encoding to using for outputing XML. Only UTF-8
and UTF-16 are supported. If another encoding is specified,
UTF-8 will be used instead for widest XML parser
interoperability.
java.io.UnsupportedEncodingException - Since unsupported
encodings are internally converted to UTF-8, this should only
be seen as the result of an internal error.| Method Detail |
|---|
protected static java.lang.String canonicalizeEncoding(java.lang.String javaEncoding)
javaEncoding - The name of the encoding as known by Java.
public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
OutputStreamWriter.write() which assures that the
XML prolog is written before any other data.
write in class java.io.OutputStreamWriterjava.io.IOExceptionjava.io.OutputStreamWriter.write(char[], int, int)
public void write(char c)
throws java.io.IOException
OutputStreamWriter.write() which assures that the
XML prolog is written before any other data.
java.io.IOExceptionjava.io.OutputStreamWriter.write(char)
public void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
OutputStreamWriter.write() which assures that the
XML prolog is written before any other data.
write in class java.io.OutputStreamWriterjava.io.IOExceptionjava.io.OutputStreamWriter.write(String, int, int)
public void writeObject(java.lang.Object obj)
throws XmlRpcException,
java.io.IOException
obj - The Object to write.
XmlRpcException - Unsupported character data found.
java.io.IOException - Problem writing data.
java.lang.IllegalArgumentException - If a null
parameter is passed to this method (not supported by the XML-RPC specification).
protected void write(byte[] byteData)
throws java.io.IOException
java.io.IOException
protected void startElement(java.lang.String elem)
throws java.io.IOException
elem -
java.io.IOException
protected void endElement(java.lang.String elem)
throws java.io.IOException
elem -
java.io.IOException
protected void emptyElement(java.lang.String elem)
throws java.io.IOException
elem -
java.io.IOException
protected void chardata(java.lang.String text)
throws XmlRpcException,
java.io.IOException
PCDATA.
text - The data to write.
XmlRpcException - Unsupported character data found.
java.io.IOException - Problem writing data.protected static void setTypeDecoder(TypeDecoder newTypeDecoder)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||