public class WikiPageUtil extends Object
| Constructor and Description |
|---|
WikiPageUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
decodeHttpParams(String str)
Returns the decoded http string - all special symbols, replaced by
replaced by the %[HEX HEX] sequence, where [HEX HEX] is the hexadecimal
code of the escaped symbol will be restored to its original characters
(see RFC-2616 http://www.w3.org/Protocols/rfc2616/).
|
static String |
encodeHttpParams(String str)
Returns the encoded string - all special symbols will be replaced by
%[HEX HEX] sequence, where [HEX HEX] is the hexadecimal code of the
escaped symbol (see RFC-2616
http://www.w3.org/Protocols/rfc2616/rfc2616.html).
|
static String |
escapeXmlAttribute(String str)
Returns the escaped attribute string.
|
static String |
escapeXmlString(String str)
Returns the escaped string.
|
static String |
escapeXmlString(String str,
boolean escapeQuots)
Returns the escaped string.
|
static String |
getCDATA(String text) |
static boolean |
isValidXmlChar(int ch)
Returns
true if the given value is a valid XML character. |
static boolean |
isValidXmlName(String tagName,
boolean colonEnabled)
This method checks the given string and returns
true if it is a valid XML name |
static boolean |
isValidXmlNameChar(char ch,
boolean colonEnabled)
Returns
true if the given value is a valid XML name
character. |
static boolean |
isValidXmlNameStartChar(char ch,
boolean colonEnabled)
Returns
true if the given value is a valid first character
of an XML name. |
public static String decodeHttpParams(String str)
str - the string to decodepublic static String encodeHttpParams(String str)
str - the string to encodepublic static String escapeXmlAttribute(String str)
str - the string to escapepublic static String escapeXmlString(String str)
str - the string to escapepublic static String escapeXmlString(String str, boolean escapeQuots)
str - the string to escapeescapeQuots - if this flag is true then "'" and "\""
symbols also will be escapedpublic static String getCDATA(String text)
public static boolean isValidXmlChar(int ch)
true if the given value is a valid XML character.
See http://www.w3.org/TR/xml/#charsets
ch - the value to checktrue if the given value is a valid XML character.public static boolean isValidXmlName(String tagName, boolean colonEnabled)
true if it is a valid XML name
See http://www.w3.org/TR/xml/#NT-Name.
tagName - the name to checkcolonEnabled - if this flag is true then this method accepts the ':' symbol in the nametrue if the given string is a valid XML namepublic static boolean isValidXmlNameChar(char ch,
boolean colonEnabled)
true if the given value is a valid XML name
character.
See http://www.w3.org/TR/xml/#NT-NameChar.
ch - the character to checkcolonEnabled - if this flag is true then this method
accepts the ':' symbol.true if the given value is a valid XML name
characterpublic static boolean isValidXmlNameStartChar(char ch,
boolean colonEnabled)
true if the given value is a valid first character
of an XML name.
See http://www.w3.org/TR/xml/#NT-NameStartChar.
ch - the character to checkcolonEnabled - if this flag is true then this method
accepts the ':' symbol.true if the given value is a valid first character
for an XML nameCopyright © 2004–2016 XWiki. All rights reserved.