|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.stringer.util.XMLKit
Static XML helper methods.
| Field Summary | |
private static java.lang.String |
EMPTY_STRING
|
private static char |
TAG_END
A tag end marker. |
private static char |
TAG_START
A tag start marker. |
private static java.lang.String |
UTF8
The string "UTF-8". |
private static java.lang.String[][] |
XML_ESCAPES
Mapping between XML chars prohibited in some contexts and their escaped equivalents. |
private static java.lang.String |
XML_PI_START
The start of an XML processing instruction. |
private static java.util.HashMap |
xmlEscapes
The actual Map used to store escaped-to-prohibited mappings. |
private static java.util.HashMap |
xmlProhibited
The actual Map used to store prohibited-to-escaped mappings. |
| Constructor Summary | |
private |
XMLKit()
This class has a private constructor to prevent it from being instantiated. |
| Method Summary | |
static java.lang.String |
convertXMLUnicodeEntities(java.lang.String input)
Converts XML Unicode character entities into their character equivalents within a given string. |
static java.lang.String |
encodeLink(java.lang.String link)
|
static java.lang.String |
escapeXMLChars(java.lang.String input)
Replaces the following characters with their "escaped" equivalents:
& with &
< with <
> with >
' with '
" with "
|
private static java.lang.String |
filterXML(java.lang.String input)
Removes all characters that are not considered XML characters from the input. |
static java.lang.String |
removeMarkup(java.lang.String input)
Removes all tags from a string (retains character content of tags, however). |
static java.lang.String |
unescapeXMLChars(java.lang.String input)
Replaces common escape sequences found in an html/xml file with their character equivalents. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final char TAG_START
private static final java.lang.String EMPTY_STRING
private static final char TAG_END
private static final java.lang.String[][] XML_ESCAPES
private static java.util.HashMap xmlProhibited
private static java.util.HashMap xmlEscapes
private static final java.lang.String UTF8
private static final java.lang.String XML_PI_START
| Constructor Detail |
private XMLKit()
| Method Detail |
public static java.lang.String unescapeXMLChars(java.lang.String input)
Replaces common escape sequences found in an html/xml file with their character equivalents.
- & with &
- < with <
- > with >
- ' with '
- " with "
input - the string on which to perform the replacement
public static java.lang.String escapeXMLChars(java.lang.String input)
- & with &
- < with <
- > with >
- ' with '
- " with "
input - the string on which to perform the replacement
private static java.lang.String filterXML(java.lang.String input)
input - the input to filter
public static java.lang.String convertXMLUnicodeEntities(java.lang.String input)
Converts XML Unicode character entities into their character equivalents within a given string.
This will handle entities in the form &#xxxx;
(decimal character code, where xxxx is a valid character code),
or &#xxxxx (hexadecimal character code, where
xxxx is a valid character code).
input - the string to process
public static java.lang.String removeMarkup(java.lang.String input)
input - the string from which to remove markup
public static java.lang.String encodeLink(java.lang.String link)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||