|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.archive.util.TextUtils
public class TextUtils
Constructor Summary | |
---|---|
TextUtils()
|
Method Summary | |
---|---|
static java.lang.String |
escapeForHTML(java.lang.String s)
Minimally escapes a string so that it can be placed inside XML/HTML attribute. |
static java.lang.String |
escapeForHTMLJavascript(java.lang.String s)
Escapes a string so that it can be passed as an argument to a javscript in a JSP page. |
static java.lang.String |
escapeForMarkupAttribute(java.lang.String s)
Escapes a string so that it can be placed inside XML/HTML attribute. |
static java.lang.String |
exceptionToString(java.lang.String message,
java.lang.Throwable e)
|
static java.lang.String |
getFirstWord(java.lang.String s)
|
static java.util.regex.Matcher |
getMatcher(java.lang.String pattern,
java.lang.CharSequence input)
Get a matcher object for a precompiled regex pattern. |
static boolean |
matches(java.lang.String pattern,
java.lang.CharSequence input)
Utility method using a precompiled pattern instead of using the matches method of the String class. |
static void |
recycleMatcher(java.util.regex.Matcher m)
|
static java.lang.String |
replaceAll(java.lang.String pattern,
java.lang.CharSequence input,
java.lang.String replacement)
Utility method using a precompiled pattern instead of using the replaceAll method of the String class. |
static java.lang.String |
replaceFirst(java.lang.String pattern,
java.lang.CharSequence input,
java.lang.String replacement)
Utility method using a precompiled pattern instead of using the replaceFirst method of the String class. |
static java.lang.String[] |
split(java.lang.String pattern,
java.lang.CharSequence input)
Utility method using a precompiled pattern instead of using the split method of the String class. |
static java.lang.CharSequence |
unescapeHtml(java.lang.CharSequence cs)
Replaces HTML Entity Encodings. |
static void |
writeEscapedForHTML(java.lang.String s,
javax.servlet.jsp.JspWriter out)
Utility method for writing a (potentially large) String to a JspWriter, escaping it for HTML display, without constructing another large String of the whole content. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextUtils()
Method Detail |
---|
public static java.util.regex.Matcher getMatcher(java.lang.String pattern, java.lang.CharSequence input)
pattern
- the string pattern to useinput
- the character sequence the matcher should be using
public static void recycleMatcher(java.util.regex.Matcher m)
public static java.lang.String replaceAll(java.lang.String pattern, java.lang.CharSequence input, java.lang.String replacement)
pattern
- precompiled Pattern to match againstinput
- the character sequence to checkreplacement
- the String to substitute every match with
Pattern
public static java.lang.String replaceFirst(java.lang.String pattern, java.lang.CharSequence input, java.lang.String replacement)
pattern
- precompiled Pattern to match againstinput
- the character sequence to checkreplacement
- the String to substitute the first match with
Pattern
public static boolean matches(java.lang.String pattern, java.lang.CharSequence input)
pattern
- precompiled Pattern to match againstinput
- the character sequence to check
Pattern
public static java.lang.String[] split(java.lang.String pattern, java.lang.CharSequence input)
pattern
- precompiled Pattern to split byinput
- the character sequence to split
Pattern
public static java.lang.String getFirstWord(java.lang.String s)
s
- String to find first word in (Words are delimited by
whitespace).
public static java.lang.String escapeForHTMLJavascript(java.lang.String s)
s
- The string to escape
public static java.lang.String escapeForMarkupAttribute(java.lang.String s)
s
- The string to escape
public static java.lang.String escapeForHTML(java.lang.String s)
s
- The string to escape
public static void writeEscapedForHTML(java.lang.String s, javax.servlet.jsp.JspWriter out) throws java.io.IOException
s
- String to writeout
- destination JspWriter
java.io.IOException
public static java.lang.CharSequence unescapeHtml(java.lang.CharSequence cs)
cs
- The CharSequence to remove html codes from
public static java.lang.String exceptionToString(java.lang.String message, java.lang.Throwable e)
message
- Message to put at top of the string returned. May be
null.e
- Exception to write into a string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |