|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.topologi.diffx.xml.esc.XMLEscapeBase
com.topologi.diffx.xml.esc.XMLEscapeUTF8
A utility class for escaping XML data when using the UTF-8 encoding.
| Field Summary | |
static XMLEscape |
UTF8_ESCAPE
A static instance of the UTF8 escape class. |
| Method Summary | |
String |
getEncoding()
Returns the encoding used. |
String |
toAttributeValue(char[] ch,
int off,
int len)
Replaces '<', '&', '"' and '\'' as well an any character that is not part of the standard unicode range. |
String |
toAttributeValue(String value)
Default implementation calling the XMLEscape.toAttributeValue(char[], int, int). |
String |
toElementText(char[] ch,
int off,
int len)
Replace characters which are invalid in element values, by the corresponding entity in a given String. |
String |
toElementText(String value)
Default implementation calling the XMLEscape.toAttributeValue(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.XMLEscape |
getEncoding, toAttributeValue, toElementText |
| Field Detail |
public static final XMLEscape UTF8_ESCAPE
| Method Detail |
public String toAttributeValue(char[] ch,
int off,
int len)
Char ::= #x9 | #xA | #xD |
[#x20-#xD7FF] |
[#xE000-#xFFFD] |
[#x10000-#x10FFFF]
toAttributeValue in interface XMLEscapech - The value that needs to be attribute-escaped.off - The start (offset) of the characters.len - The length of characters to.
XMLEscape.toAttributeValue(char[], int, int)
public String toElementText(char[] ch,
int off,
int len)
String.
these characters are:
Empty strings or null return respectively
"" and null.
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.
toElementText in interface XMLEscapech - The value that needs to be attribute-escaped.off - The start (offset) of the characters.len - The length of characters to.
XMLEscape.toElementText(char[], int, int)public final String toAttributeValue(String value)
XMLEscape.toAttributeValue(char[], int, int).
toAttributeValue in interface XMLEscapevalue - The value that needs to be attribute-escaped.
XMLEscape.toAttributeValue(String)public final String toElementText(String value)
XMLEscape.toAttributeValue(char[], int, int).
toElementText in interface XMLEscapevalue - The value that needs to be text-escaped.
XMLEscape.toAttributeValue(String)public final String getEncoding()
getEncoding in interface XMLEscapeXMLEscape.getEncoding()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||