|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.confluence.util.HtmlUtil
public final class HtmlUtil
| Field Summary | |
|---|---|
static com.google.common.base.Function<java.lang.String,java.lang.String> |
HTML_ENCODE_FUNCTION
Function to apply htmlEncode(String). |
| Constructor Summary | |
|---|---|
HtmlUtil()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
completeUrlEncode(java.lang.String url)
Encodes the given url for protocols which the CompleteURLEncoder supports. |
static java.lang.String |
htmlEncode(java.lang.String text)
Encodes the given text to be HTML safe using entity escapes. |
static java.lang.String |
htmlEncodeAndReplaceSpaces(java.lang.String text)
Encodes the given text to be HTML safe using entity escapes, and embedding non-breaking spaces in place of spaces. |
static java.lang.String |
reencodeURL(java.lang.String originalUrl)
Attempts to handle common encoding errors in hand-edited URLs, such as failing to URL encode quotes. |
static boolean |
shouldUrlDecode(java.lang.String text)
Checks if the given text should contains any percent encoded characters that should be decoded. |
static java.lang.String |
urlDecode(java.lang.String url)
Decodes URL percent encoded characters, using the character encoding as per GeneralUtil.getCharacterEncoding(). |
static java.lang.String |
urlDecode(java.lang.String url,
java.lang.String encoding)
Decodes URL percent encoded characters. |
static java.lang.String |
urlEncode(java.lang.String text)
Encodes HTTP form parameter/values, using the character encoding as per GeneralUtil.getCharacterEncoding(). |
static java.lang.String |
urlEncode(java.lang.String text,
java.lang.String encoding)
Encodes HTTP form parameter/values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final com.google.common.base.Function<java.lang.String,java.lang.String> HTML_ENCODE_FUNCTION
htmlEncode(String).
| Constructor Detail |
|---|
public HtmlUtil()
| Method Detail |
|---|
public static java.lang.String htmlEncode(java.lang.String text)
text - the text to encode.
public static java.lang.String htmlEncodeAndReplaceSpaces(java.lang.String text)
text - the text to encode.
public static java.lang.String completeUrlEncode(java.lang.String url)
CompleteURLEncoder supports. To only encode HTTP form parameter/values
or fragments, use urlEncode(String) instead. Uses the character encoding as per GeneralUtil.getCharacterEncoding().
url - the entire URL to encode
public static java.lang.String urlEncode(java.lang.String text)
GeneralUtil.getCharacterEncoding().
To encode entire URLs, use completeUrlEncode(java.lang.String) instead.
text - part of the url to encode
public static java.lang.String urlEncode(java.lang.String text,
java.lang.String encoding)
completeUrlEncode(java.lang.String) instead.
text - part of the url to encodeencoding - the character encoding to use
public static java.lang.String urlDecode(java.lang.String url)
GeneralUtil.getCharacterEncoding().
url - the URL to decode
public static java.lang.String urlDecode(java.lang.String url,
java.lang.String encoding)
throws java.io.UnsupportedEncodingException
url - the URL to decodeencoding - the character encoding to use while decoding
java.io.UnsupportedEncodingExceptionpublic static boolean shouldUrlDecode(java.lang.String text)
text - the text to check
public static java.lang.String reencodeURL(java.lang.String originalUrl)
originalUrl - the url to re-encode.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||