|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.topologi.diffx.xml.esc.XMLEscapeWriterBase
com.topologi.diffx.xml.esc.XMLEscapeWriterUTF8
A utility class for escaping XML data using the UTF-8 encoding.
| Constructor Summary | |
XMLEscapeWriterUTF8(Writer w)
Creates a new XML escape writer using the utf-8 encoding. |
|
| Method Summary | |
String |
getEncoding()
Returns the encoding for this writer. |
void |
writeAttValue(char[] ch,
int off,
int len)
Replaces '<', '&', '"' and '\'' as well an any character that is not part of the standard unicode range. |
void |
writeAttValue(String value)
Default implementation calling the XMLEscapeWriter.writeAttValue(char[], int, int). |
void |
writeText(char c)
Replace characters which are invalid in element values, by the corresponding entity in a given String. |
void |
writeText(char[] ch,
int off,
int len)
Replace characters which are invalid in element values, by the corresponding entity. |
void |
writeText(String value)
Default implementation calling the XMLEscapeWriter.writeAttValue(char[], int, int). |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.topologi.diffx.xml.esc.XMLEscapeWriter |
getEncoding, writeAttValue, writeText, writeText |
| Constructor Detail |
public XMLEscapeWriterUTF8(Writer w)
throws NullPointerException
w - The writer to wrap.
NullPointerException - if the writer is null.| Method Detail |
public void writeAttValue(char[] ch,
int off,
int len)
throws IOException
Char ::= #x9 | #xA | #xD |
[#x20-#xD7FF] |
[#xE000-#xFFFD] |
[#x10000-#x10FFFF]
writeAttValue in interface XMLEscapeWriterch - The value that needs to be attribute-escaped.off - The start (offset) of the characters.len - The length of characters to.
IOException - If thrown by the underlying writer.XMLEscapeWriter.writeAttValue(char[], int, int)
public void writeText(char c)
throws IOException
String.
these characters are:
Note: this function assumes that there are no entities in the given String. If there are existing entities, then the ampersand character will be escaped by the ampersand entity.
writeText in interface XMLEscapeWriterc - The character that needs to be text-escaped.
IOException - If thrown by the underlying writer.XMLEscapeWriter.writeText(char)
public final void writeAttValue(String value)
throws IOException
XMLEscapeWriter.writeAttValue(char[], int, int).
writeAttValue in interface XMLEscapeWritervalue - The value that needs to be attribute-escaped.
IOException - If thrown by the underlying writer.XMLEscapeWriter.writeAttValue(String)
public final void writeText(String value)
throws IOException
XMLEscapeWriter.writeAttValue(char[], int, int).
writeText in interface XMLEscapeWritervalue - The text that needs to be text-escaped.
IOException - If thrown by the underlying writer.XMLEscapeWriter.writeAttValue(String)
public void writeText(char[] ch,
int off,
int len)
throws IOException
This method calls XMLEscapeWriter.writeText(char) for each character.
writeText in interface XMLEscapeWriterch - The value that needs to be attribute-escaped.off - The start (offset) of the characters.len - The length of characters to.
IOException - If thrown by the underlying writer.XMLEscapeWriter.writeText(char[], int, int)public final String getEncoding()
getEncoding in interface XMLEscapeWriterXMLEscapeWriter.getEncoding()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||