|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.itextpdf.text.xml.XMLUtil
public class XMLUtil
Contains utility methods for XML.
Constructor Summary | |
---|---|
XMLUtil()
|
Method Summary | |
---|---|
static String |
escapeXML(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 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(String s)
Checks if a character value should be escaped/unescaped. |
static int |
unescape(String s)
Unescapes 'lt', 'gt', 'apos', 'quote' and 'amp' to the corresponding character values. |
static String |
unescapeXML(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 String escapeXML(String s, boolean onlyASCII)
s
- the string to be escapedonlyASCII
- codes above 127 will always be escaped with &#nn; if true
public static String unescapeXML(String s)
s
- a String with entities
public static int unescape(String s)
s
- a string representing a character
public static boolean isValidCharacterValue(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 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 |