Class XMLEncode
java.lang.Object
org.apache.maven.shared.utils.xml.XMLEncode
Collection of XML encoding/decoding helpers.
This is all about the special characters & and <, and for attributes " and '. These must be encoded/decoded from/to XML.
This is all about the special characters & and <, and for attributes " and '. These must be encoded/decoded from/to XML.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final char
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
needsEncoding
(String text) Checks if this text needs encoding in order to be represented in XML.(package private) static void
xmlEncodeText
(String text, Writer writer) private static String
Returns string as CDATA block if possible, otherwise null.(package private) static void
xmlEncodeTextAsPCDATA
(String text, boolean forAttribute, char quoteChar, Writer n)
-
Field Details
-
CDATA_BLOCK_THRESHOLD_LENGTH
private static final int CDATA_BLOCK_THRESHOLD_LENGTH- See Also:
-
DEFAULT_QUOTE_CHAR
private static final char DEFAULT_QUOTE_CHAR- See Also:
-
-
Constructor Details
-
XMLEncode
XMLEncode()
-
-
Method Details
-
xmlEncodeText
- Throws:
IOException
-
xmlEncodeTextAsPCDATA
static void xmlEncodeTextAsPCDATA(String text, boolean forAttribute, char quoteChar, Writer n) throws IOException - Throws:
IOException
-
xmlEncodeTextAsCDATABlock
Returns string as CDATA block if possible, otherwise null. -
needsEncoding
Checks if this text needs encoding in order to be represented in XML.
-