|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itextpdf.text.xml.XMLUtil
public class XMLUtil
Contains utility methods for XML.
| Constructor Summary | |
|---|---|
XMLUtil()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
escapeXML(java.lang.String s,
boolean onlyASCII)
Escapes a string with the appropriated XML codes. |
static int |
findInArray(char needle,
char[] haystack,
int start)
Looks for a character in a character array, starting from a certain position |
static java.lang.String |
getEncodingName(byte[] b4)
Returns the IANA encoding name that is auto-detected from the bytes specified, with the endian-ness of that encoding where appropriate. |
static boolean |
isValidCharacterValue(int c)
Checks if a character value should be escaped/unescaped. |
static boolean |
isValidCharacterValue(java.lang.String s)
Checks if a character value should be escaped/unescaped. |
static int |
unescape(java.lang.String s)
Unescapes 'lt', 'gt', 'apos', 'quote' and 'amp' to the corresponding character values. |
static java.lang.String |
unescapeXML(java.lang.String s)
Unescapes a String, replacing nn;, <, >, &, ", and &apos to the corresponding characters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLUtil()
| Method Detail |
|---|
public static java.lang.String escapeXML(java.lang.String s,
boolean onlyASCII)
s - the string to be escapedonlyASCII - codes above 127 will always be escaped with &#nn; if true
public static java.lang.String unescapeXML(java.lang.String s)
s - a String with entities
public static int unescape(java.lang.String s)
s - a string representing a character
public static boolean isValidCharacterValue(java.lang.String s)
s - the String representation of an integer
public static boolean isValidCharacterValue(int c)
c - a character value
public static int findInArray(char needle,
char[] haystack,
int start)
needle - the character you're looking forhaystack - the character arraystart - the start position
public static java.lang.String getEncodingName(byte[] b4)
b4 - The first four bytes of the input.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||