org.sblim.cimclient.internal.cimxml

Class CimXmlSerializer.XmlWriter

private static class CimXmlSerializer.XmlWriter extends Object

Class XmlWriter implements a writer on an output stream that escapes XML values according to the CIM-XML requirements.
Constructor Summary
XmlWriter(OutputStream pOut, String pCharsetName)
Ctor.
Method Summary
voidclose()
Closes the stream
voidflush()
Flushes the buffer to the stream
voidwrite(String pText)
Writes text to the stream
voidwriteValue(String pText)
Writes a XML value (either attribute or text node).

Constructor Detail

XmlWriter

public XmlWriter(OutputStream pOut, String pCharsetName)
Ctor.

Parameters: pOut The output stream the serialized document is written to pCharsetName The encoding the use for the output stream

Method Detail

close

public void close()
Closes the stream

Throws: IOException

flush

public void flush()
Flushes the buffer to the stream

Throws: IOException

write

public void write(String pText)
Writes text to the stream

Parameters: pText The text

Throws: IOException

writeValue

public void writeValue(String pText)
Writes a XML value (either attribute or text node). The value is escaped as follows:

char result
< space &#xnn;
> ~ unchanged (UTF-8)
space unchanged or &#x20;
(First leading, last trailing and every other space are escaped)
< &lt;
> &gt;
& &amp;
" &quot;
' &apos;
other unchanged

Parameters: pText The text

Throws: IOException

Copyright © 2005, 2009 IBM Corporation. All Rights Reserved.