|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.util.Util
public class Util
Constructor Summary | |
---|---|
Util()
|
Method Summary | ||
---|---|---|
static String |
cleanValue(String value)
|
|
static boolean |
contains(String name,
String list,
String sep)
|
|
static String |
convertToAlphaNumeric(String text)
Removes all non alpha numerical characters from the passed text. |
|
static String |
decodeURI(String text,
XWikiContext context)
Decodes a application/x-www-form-urlencoded string, the reverse of
encodeURI(String, XWikiContext) . |
|
static String |
encodeURI(String text,
XWikiContext context)
Translates a string into application/x-www-form-urlencoded format, so that it can be safely used in
URIs, as a parameter value in a query string or as a segment in the URI path. |
|
static String |
escapeText(String text)
API to protect Text from Radeox transformation |
|
static String |
escapeURL(String url)
API to protect URLs from Radeox transformation |
|
List<String> |
getAllMatches(String content,
String spattern,
int group)
|
|
static javax.servlet.http.Cookie |
getCookie(String cookieName,
javax.servlet.http.HttpServletRequest request)
|
|
static javax.servlet.http.Cookie |
getCookie(String cookieName,
XWikiContext context)
|
|
Document |
getDOMDocument()
API to get a new DOM document |
|
Document |
getDOMForString(String str)
API to obtain a DOM document for the specified string |
|
static Date |
getFileLastModificationDate(String path)
|
|
static long |
getHash(String uid)
Get a likely unique 64bit hash representing the provided uid string. |
|
static String |
getHTMLExceptionMessage(XWikiException xe,
XWikiContext context)
|
|
org.apache.oro.text.regex.Perl5Matcher |
getMatcher()
|
|
static MonitorPlugin |
getMonitorPlugin(XWikiContext context)
|
|
static String |
getName(String name)
|
|
static String |
getName(String name,
XWikiContext context)
|
|
static Map<String,String[]> |
getObject(XWikiRequest request,
String prefix)
|
|
org.apache.oro.text.perl.Perl5Util |
getP5util()
|
|
static org.apache.oro.text.PatternCache |
getPatterns()
|
|
static InputStream |
getResourceAsStream(String resource)
Load resources from: 1. |
|
static
|
getSubMap(Map<String,T> map,
String prefix)
|
|
List<String> |
getUniqueMatches(String content,
String spattern,
int group)
|
|
static String |
getWeb(String fullname)
|
|
static boolean |
isAlphaNumeric(String text)
|
|
static boolean |
isValidXMLElementName(String elementName)
Validate a XML element name. |
|
static Hashtable<String,String> |
keyValueToHashtable(String mapString)
Create a Map from a string holding a space separated list of key=value pairs. |
|
boolean |
match(String pattern,
String text)
|
|
boolean |
matched()
|
|
static String |
noaccents(String text)
|
|
static String |
normalizeLanguage(String languageCode)
Normalize the given language code. |
|
static String |
restoreValue(String value)
|
|
Vector<String> |
split(String pattern,
String text)
|
|
String |
substitute(String pattern,
String text)
|
|
String |
substitute(String pattern,
String substitution,
String text)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Util()
Method Detail |
---|
public String substitute(String pattern, String text)
public boolean match(String pattern, String text)
public boolean matched()
public String substitute(String pattern, String substitution, String text)
public org.apache.oro.text.regex.Perl5Matcher getMatcher()
public org.apache.oro.text.perl.Perl5Util getP5util()
public List<String> getAllMatches(String content, String spattern, int group) throws org.apache.oro.text.regex.MalformedPatternException
org.apache.oro.text.regex.MalformedPatternException
public List<String> getUniqueMatches(String content, String spattern, int group) throws org.apache.oro.text.regex.MalformedPatternException
org.apache.oro.text.regex.MalformedPatternException
public static String cleanValue(String value)
public static String restoreValue(String value)
public static Hashtable<String,String> keyValueToHashtable(String mapString) throws IOException
"this key"="a larger value"
. To use a quote as part
of a key/value, use %_Q_%
.
mapString
- The string that must be parsed.
IOException
public static org.apache.oro.text.PatternCache getPatterns()
public static Map<String,String[]> getObject(XWikiRequest request, String prefix)
public static <T> Map<String,T> getSubMap(Map<String,T> map, String prefix)
public static String getWeb(String fullname)
public Vector<String> split(String pattern, String text)
public static boolean contains(String name, String list, String sep)
public static String noaccents(String text)
public static boolean isAlphaNumeric(String text)
public static String getName(String name)
public static String getName(String name, XWikiContext context)
public static javax.servlet.http.Cookie getCookie(String cookieName, XWikiContext context)
public static javax.servlet.http.Cookie getCookie(String cookieName, javax.servlet.http.HttpServletRequest request)
public static String getHTMLExceptionMessage(XWikiException xe, XWikiContext context)
public static MonitorPlugin getMonitorPlugin(XWikiContext context)
public Document getDOMForString(String str)
str
- The parsed text
public Document getDOMDocument()
public static String escapeText(String text)
text
-
public static String escapeURL(String url)
url
-
public static String encodeURI(String text, XWikiContext context)
application/x-www-form-urlencoded
format, so that it can be safely used in
URIs, as a parameter value in a query string or as a segment in the URI path. This uses the UTF-8 encoding, the
default encoding for URIs, as stated in RFC 3986.
text
- the non encoded textcontext
- the current context
decodeURI(String, XWikiContext)
public static String decodeURI(String text, XWikiContext context)
application/x-www-form-urlencoded
string, the reverse of
encodeURI(String, XWikiContext)
. This uses the UTF-8 encoding, the default encoding for URIs, as stated
in RFC 3986.
text
- the encoded textcontext
- the current context
encodeURI(String, XWikiContext)
public static String convertToAlphaNumeric(String text)
text
- the text to convert
public static Date getFileLastModificationDate(String path)
public static boolean isValidXMLElementName(String elementName)
elementName
- the XML element name to validate
public static InputStream getResourceAsStream(String resource)
resource
- resource path to load
public static String normalizeLanguage(String languageCode)
Util.normalizeLanguage(null) = null Util.normalizeLanguage("") = "" Util.normalizeLanguage(" ") = "" Util.normalizeLanguage("default") = "default" Util.normalizeLanguage("DeFault") = "default" Util.normalizeLanguage("invalid") = "default" Util.normalizeLanguage("en") = "en" Util.normalizeLanguage("DE_at") = "de_AT"
languageCode
- the language code to normalize
public static long getHash(String uid)
uid
- an uid string usually provided by
internal.reference.LocalUidStringEntityReferenceSerializer
or
internal.reference.UidStringEntityReferenceSerializer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |