public class XmlUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
decode(String entity)
Converts an XML/HTML entity reference into a string with the literal character.
|
static String |
encode(char s)
Encodes a character into the corresponding XML/HTML entity.
|
static String |
encode(char[] text,
int start,
int length)
Converts a character array, encoding characters into the corresponding XML/HTML entities as
needed.
|
static String |
encode(String s)
Converts a string, encoding characters into the corresponding XML/HTML entities as needed.
|
static String |
prettyPrint(String input)
Formats an XML string with indented markup.
|
public static String prettyPrint(String input)
input
- The XML string to format.public static String decode(String entity)
entity
- The XML/HTML entity to decode.public static String encode(char s)
s
- The character to encode.public static String encode(String s)
s
- The string to encode.public static String encode(char[] text, int start, int length)
text
- The character array to encode.start
- The index to start at in the character array.length
- The maximum amount of characters to read from the array.