|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ws4d.java.util.StringUtil
public final class StringUtil
| Field Summary | |
|---|---|
static java.lang.String[] |
day
|
static java.lang.String[] |
month
|
static java.lang.String[][] |
zone
|
| Constructor Summary | |
|---|---|
StringUtil()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
arrayToStringByte(byte[] array)
Creates a String from an array of byte. |
static java.lang.String |
arrayToStringInt(int[] array)
Creates a String from an array of int. |
static java.lang.String |
arrayToStringLong(long[] array)
Creates a String form a array of long. |
static java.lang.String |
chomp(java.lang.String inStr)
Deletes the Line Feed (10) and Carriage Return (13) fields of the given String. |
static java.lang.String |
decodeURL(java.lang.String url)
Decodes a String in application/x-www-form-urlencoded format
as specified in
Chapter Forms of the HTML 4.01 Specification. |
static java.lang.String |
decodeURL(java.lang.String url,
java.lang.String encoding)
Decodes a String in application/x-www-form-urlencoded format
as specified in
Chapter Forms of the HTML 4.01 Specification. |
static java.lang.String |
encodeURL(java.lang.String url)
Encodes an given URL. |
static boolean |
equalsIgnoreCase(java.lang.String s1,
java.lang.String s2)
|
static java.lang.String |
formatClassName(java.lang.Class clazz)
Depending on the value of USE_LONG_CLASS_NAMES returns either
the fully qualified class name of clazz or the result of
calling simpleClassName(Class) on it. |
static java.lang.String |
formatClassName(java.lang.String qualifiedClassName)
Depending on the value of USE_LONG_CLASS_NAMES returns either
the same String given in argument qualifiedClassName or the
result of calling simpleClassName(String) on it. |
static java.lang.String |
getHTTPDate(long date)
|
static long |
getHTTPDateAsLong(java.lang.String httpDate)
|
static java.lang.String |
getStringEncoding()
|
static int |
lastIndexOf(java.lang.String what,
java.lang.String within)
|
static HashMap |
parseStringOptions(java.lang.String args)
Parses options from a String. |
static HashMap |
parseStringProperties(java.lang.String args)
Parses properties from a String. |
static void |
printStream(java.io.InputStream in)
Prints a stream to System.out. |
static java.lang.String |
simpleClassName(java.lang.Class clazz)
Returns only the substring after the last dot character ("e;. |
static java.lang.String |
simpleClassName(java.lang.String qualifiedClassName)
Given a fully qualified class name (like java.lang.Object),
returns only the substring after the last dot character
("e;. |
static java.lang.String[] |
split(java.lang.String s,
char c)
Splits a string at a given separator char in substrings and returns these elements in a string array. |
static java.lang.String[] |
split(java.lang.String s,
java.lang.String separator)
Splits a string at a given separator char in substrings and returns these elements in a string array. |
static java.lang.String[] |
splitAtWhitespace(java.lang.String s)
|
static java.util.Vector |
stringToVector(java.lang.String s,
java.lang.String separator)
Converts text with spaces into Vector. |
static java.lang.String[] |
toStringArray(java.util.Vector strings)
Converts the given Vector to String array |
static java.lang.String |
vectorToString(java.util.Vector v,
java.lang.String separator)
Concats the elements of a vector to a string (calls toString of each element) separated by given string. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String[] day
public static final java.lang.String[] month
public static final java.lang.String[][] zone
| Constructor Detail |
|---|
public StringUtil()
| Method Detail |
|---|
public static boolean equalsIgnoreCase(java.lang.String s1,
java.lang.String s2)
public static int lastIndexOf(java.lang.String what,
java.lang.String within)
public static final java.lang.String getStringEncoding()
public static java.lang.String[] split(java.lang.String s,
char c)
s - The string to split.c - The separator char.
public static java.lang.String[] split(java.lang.String s,
java.lang.String separator)
s - The string to split.separator - The separator char.
public static java.lang.String[] splitAtWhitespace(java.lang.String s)
public static java.util.Vector stringToVector(java.lang.String s,
java.lang.String separator)
Vector.
s - The text to convert.
Vector containing the text parts.
public static java.lang.String vectorToString(java.util.Vector v,
java.lang.String separator)
v - Vector to work on.separator - The string which should be used as separator.
public static java.lang.String encodeURL(java.lang.String url)
url - the URL to encode.
public static java.lang.String decodeURL(java.lang.String url)
application/x-www-form-urlencoded format
as specified in
Chapter Forms of the HTML 4.01 Specification. Uses default character
encoding.
url - String to decode.
java.io.UnsupportedEncodingException
public static java.lang.String decodeURL(java.lang.String url,
java.lang.String encoding)
throws java.io.UnsupportedEncodingException
application/x-www-form-urlencoded format
as specified in
Chapter Forms of the HTML 4.01 Specification.
url - String to decode.encoding - Encoding.
java.io.UnsupportedEncodingExceptionpublic static java.lang.String formatClassName(java.lang.Class clazz)
USE_LONG_CLASS_NAMES returns either
the fully qualified class name of clazz or the result of
calling simpleClassName(Class) on it.
clazz - the class to return a formatted name of
clazzUSE_LONG_CLASS_NAMES,
simpleClassName(Class)public static java.lang.String formatClassName(java.lang.String qualifiedClassName)
USE_LONG_CLASS_NAMES returns either
the same String given in argument qualifiedClassName or the
result of calling simpleClassName(String) on it.
qualifiedClassName - a fully qualified Java class name
qualifiedClassName or the
simple class nameUSE_LONG_CLASS_NAMES,
simpleClassName(String)public static java.lang.String simpleClassName(java.lang.Class clazz)
clazz, i.e.
Object instead of java.lang.Object.
clazz - the class to return the simple name of
public static java.lang.String simpleClassName(java.lang.String qualifiedClassName)
java.lang.Object),
returns only the substring after the last dot character
("e;."e;), i.e. Object instead of
java.lang.Object.
qualifiedClassName - a fully qualified Java class name
public static java.lang.String[] toStringArray(java.util.Vector strings)
strings - The Vector to convert.
public static java.lang.String chomp(java.lang.String inStr)
inStr - The String to work on.
public static HashMap parseStringOptions(java.lang.String args)
String. The options are defined as
"-name
args - the String to parse the options from.
Map containing the options properties.public static HashMap parseStringProperties(java.lang.String args)
String. The properties are defined
as "name=value" pairs divided by a blank.
args - the String to parse the properties from.
Map containing the properties.public static void printStream(java.io.InputStream in)
in - the stream to print.public static java.lang.String arrayToStringInt(int[] array)
array - the array to show.
public static java.lang.String arrayToStringByte(byte[] array)
array - the array to show.
public static java.lang.String arrayToStringLong(long[] array)
array - the array to show.
public static long getHTTPDateAsLong(java.lang.String httpDate)
public static java.lang.String getHTTPDate(long date)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||