public class XmlUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decode(java.lang.String entity)
Converts an XML/HTML entity reference into a string with the literal character.
|
static java.lang.String |
encode(char s)
Encodes a character into the corresponding XML/HTML entity.
|
static java.lang.String |
encode(char[] text,
int start,
int length)
Converts a character array, encoding characters into the corresponding XML/HTML entities as
needed.
|
static java.lang.String |
encode(java.lang.String s)
Converts a string, encoding characters into the corresponding XML/HTML entities as needed.
|
static java.lang.String |
prettyPrint(java.lang.String input)
Formats an XML string with indented markup.
|
public static java.lang.String prettyPrint(java.lang.String input)
input
- The XML string to format.public static java.lang.String decode(java.lang.String entity)
entity
- The XML/HTML entity to decode.public static java.lang.String encode(char s)
s
- The character to encode.public static java.lang.String encode(java.lang.String s)
s
- The string to encode.public static java.lang.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.