Typical escaping writers replace characters like '<' and '&', as well as some additional characters depending on context. Custom implementations may choose to escape additional characters, for example to make it easier to manually view or edit resulting serialized XML document.
Note about implementing escaping writers: writers need to obey normal
Writer semantics, and specifically they should pass calls to
flush() and close() to the underlying
Writer.
| Modifier and Type | Method and Description |
|---|---|
| public Writer | createEscapingWriterFor(Writer
Underlying writer that the encoding writer should
output w, String Encoding to use, as specified by the stream writer
(based on information application has passed) enc)Method called to create an instance of escaping writer that will output content using specified writer, and escaping necessary characters (depending on both type [attr, element text] and encoding). |
| public Writer | createEscapingWriterFor(OutputStream
Underlying stream that the encoding writer should
output using out, String Encoding to use, as specified by the stream writer
(based on information application has passed) enc)Method called to create an instance of escaping writer that will output to the specified stream, using the specified encoding, and escaping necessary characters (depending on both type [attr, element text] and encoding). |
| createEscapingWriterFor | back to summary |
|---|---|
| public Writer createEscapingWriterFor(Writer w, String enc) throws UnsupportedEncodingException Method called to create an instance of escaping writer that will output content using specified writer, and escaping necessary characters (depending on both type [attr, element text] and encoding). | |
| createEscapingWriterFor | back to summary |
|---|---|
| public Writer createEscapingWriterFor(OutputStream out, String enc) throws UnsupportedEncodingException Method called to create an instance of escaping writer that will output to the specified stream, using the specified encoding, and escaping necessary characters (depending on both type [attr, element text] and encoding).
| |