|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.utils.StringUtils
public class StringUtils
INTERNAL: Class that contains useful string operation methods.
Field Summary | |
---|---|
static java.lang.String |
VERY_UNLIKELY_STRING
INTERNAL: A string used internally for various control flow purposes. |
Constructor Summary | |
---|---|
StringUtils()
|
Method Summary | |
---|---|
static int |
compare(java.lang.String s1,
java.lang.String s2)
INTERNAL: Compare two string values lexically. |
static int |
compareToIgnoreCase(java.lang.String s1,
java.lang.String s2)
INTERNAL: Compare two string values lexically ignoring case. |
static void |
downCaseAscii(char[] ch,
int start,
int length)
INTERNAL: Convert the A-Z characters in the array region to a-z. |
static java.lang.String |
escapeHTMLEntities(java.lang.String value)
INTERNAL: Filters the specified string for characters that are senstive to HTML interpreters, returning the string with these characters replaced by the corresponding character entities. |
static void |
escapeHTMLEntities(java.lang.String value,
java.io.Writer out)
INTERNAL: Filters the specified string for characters that are senstive to HTML interpreters, writing the string with these characters replaced by the corresponding character entities to the given writer. |
static boolean |
isInteger(java.lang.String candidate)
INTERNAL: Returns true if the string is a valid integer. |
static java.lang.String |
join(boolean[] vals,
java.lang.String separator)
INTERNAL: Joins the booleans in an array (turned into strings by toString) with a separator string. |
static java.lang.String |
join(byte[] vals,
java.lang.String separator)
INTERNAL: Joins the bytes in an array (turned into strings by toString) with a separator string. |
static java.lang.String |
join(char[] vals,
java.lang.String separator)
INTERNAL: Joins the characters in an array (turned into strings by toString) with a separator string. |
static java.lang.String |
join(java.util.Collection objects,
java.lang.String separator)
INTERNAL: Joins the objects in a collection (turned into strings by toString) with a separator string. |
static void |
join(java.util.Collection objects,
java.lang.String separator,
java.lang.StringBuffer sb)
INTERNAL: Joins the objects in a collection (turned into strings by toString) with a separator string. |
static java.lang.String |
join(java.util.Collection objects,
java.lang.String separator,
StringifierIF stringifier)
INTERNAL: Joins the objects in a collection (turned into strings by the stringifier) with a separator string. |
static java.lang.String |
join(int[] vals,
java.lang.String separator)
INTERNAL: Joins the ints in an array (turned into strings by toString) with a separator string. |
static java.lang.String |
join(long[] vals,
java.lang.String separator)
INTERNAL: Joins the longs in an array (turned into strings by toString) with a separator string. |
static java.lang.String |
join(java.lang.Object[] objects,
char separator)
INTERNAL: Joins the objects in an array (turned into strings by toString) with a separator string. |
static java.lang.String |
join(java.lang.Object[] objects,
java.lang.String separator)
INTERNAL: Joins the objects in an array (turned into strings by toString) with a separator string. |
static java.lang.String |
join(java.lang.Object[] objects,
java.lang.String separator,
boolean remove_nulls)
INTERNAL: Joins the non-null objects in an array (turned into strings by toString) with a separator string. |
static void |
join(java.lang.Object[] objects,
java.lang.String separator,
java.lang.StringBuffer sb)
INTERNAL: Joins the objects in an array (turned into strings by toString) with a separator string. |
static java.lang.String |
makeRandomId(int length)
INTERNAL: Make a random ID-like string of the given number of characters. |
static java.lang.String |
md5_32(java.lang.String value)
INTERNAL: Returns a 32 character long hex encoded MD5 digest of the given string. |
static java.lang.String |
normalizeId(java.lang.String name)
INTERNAL: Creates a candidate ID from an input string. |
static java.lang.String |
normalizeIsWhitespace(java.lang.String source)
INTERNAL: Replaces sequences of one or more characters that report as whitespace through Character.isWhitespace(char) by a single space, returning the new string. |
static java.lang.String |
normalizeWhitespace(java.lang.String source)
INTERNAL: Replaces sequences of one or more ' ', \t, \n, \r by a single space, returning the new string. |
static java.lang.String |
pad(int number,
char ch,
int length)
INTERNAL: Pad characters to the given length. |
static java.lang.String |
pad(java.lang.String str,
char ch,
int length)
INTERNAL: Pad with filler characters in front of a base string to get the given length. |
static boolean |
regionEquals(java.lang.String str,
char[] ch,
int start,
int length)
INTERNAL: Test whether the string is equal to the given region of the character array. |
static java.lang.String |
replace(java.lang.String str,
char oldvalue,
java.lang.String newvalue)
INTERNAL: Replaces occurrences of a char within a string, returning a new string where the substitutions have been performed. |
static java.lang.String |
replace(java.lang.String str,
java.lang.String oldvalue,
java.lang.String newvalue)
INTERNAL: Replaces occurrences of a string within a string, returning a new string where the substitutions have been performed. |
static java.lang.String[] |
split(java.lang.String str)
INTERNAL: Splits a string on occurrences of a given substring. |
static java.lang.String[] |
split(java.lang.String str,
java.lang.String separator)
INTERNAL: Splits a string on occurrences of a given substring. |
static java.lang.String[] |
tokenize(java.lang.String str,
java.lang.String delimiters)
INTERNAL: Tokenizes a string on occurrences of a delimiters. |
static java.lang.String |
transcode(java.lang.String original,
java.lang.String encoding)
INTERNAL: Transcode a string mistakenly interpreted as ISO 8859-1 to one interpreted as something else. |
static java.lang.String |
transcodeUTF8(java.lang.String original)
INTERNAL: Transcode a string mistakenly interpreted as ISO 8859-1 to one interpreted as UTF-8. |
static java.lang.String[] |
trim(java.lang.String[] str)
INTERNAL: Trims each individual string in the array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERY_UNLIKELY_STRING
Constructor Detail |
---|
public StringUtils()
Method Detail |
---|
public static java.lang.String replace(java.lang.String str, java.lang.String oldvalue, java.lang.String newvalue)
public static java.lang.String replace(java.lang.String str, char oldvalue, java.lang.String newvalue)
public static java.lang.String[] split(java.lang.String str)
public static java.lang.String[] split(java.lang.String str, java.lang.String separator)
public static java.lang.String[] tokenize(java.lang.String str, java.lang.String delimiters)
public static java.lang.String[] trim(java.lang.String[] str)
public static java.lang.String join(java.util.Collection objects, java.lang.String separator)
public static java.lang.String join(java.util.Collection objects, java.lang.String separator, StringifierIF stringifier)
public static java.lang.String join(java.lang.Object[] objects, java.lang.String separator)
public static java.lang.String join(java.lang.Object[] objects, char separator)
public static java.lang.String join(int[] vals, java.lang.String separator)
public static java.lang.String join(long[] vals, java.lang.String separator)
public static java.lang.String join(boolean[] vals, java.lang.String separator)
public static java.lang.String join(byte[] vals, java.lang.String separator)
public static java.lang.String join(char[] vals, java.lang.String separator)
public static void join(java.util.Collection objects, java.lang.String separator, java.lang.StringBuffer sb)
public static void join(java.lang.Object[] objects, java.lang.String separator, java.lang.StringBuffer sb)
public static java.lang.String join(java.lang.Object[] objects, java.lang.String separator, boolean remove_nulls)
public static int compare(java.lang.String s1, java.lang.String s2)
public static int compareToIgnoreCase(java.lang.String s1, java.lang.String s2)
public static java.lang.String normalizeWhitespace(java.lang.String source)
public static java.lang.String normalizeIsWhitespace(java.lang.String source)
public static boolean regionEquals(java.lang.String str, char[] ch, int start, int length)
public static void downCaseAscii(char[] ch, int start, int length)
public static java.lang.String transcodeUTF8(java.lang.String original)
public static java.lang.String transcode(java.lang.String original, java.lang.String encoding) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static java.lang.String escapeHTMLEntities(java.lang.String value)
value
- The string to be filtered and returnedpublic static void escapeHTMLEntities(java.lang.String value, java.io.Writer out) throws java.io.IOException
value
- The string to be filtered and written.
java.io.IOException
public static java.lang.String makeRandomId(int length)
public static java.lang.String pad(int number, char ch, int length)
public static java.lang.String pad(java.lang.String str, char ch, int length)
public static java.lang.String md5_32(java.lang.String value)
public static boolean isInteger(java.lang.String candidate)
public static java.lang.String normalizeId(java.lang.String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |