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 intprivate static final char -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanneedsEncoding(String text) Checks if this text needs encoding in order to be represented in XML.(package private) static voidxmlEncodeText(String text, Writer writer) private static StringReturns string as CDATA block if possible, otherwise null.(package private) static voidxmlEncodeTextAsPCDATA(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.
-