|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.base.apps.util.Util
public class Util
General utility methods.
| Method Summary | ||
|---|---|---|
static String |
concat(Object... objs)
Concatenates the specified parameters into a single string. |
|
static String |
format(String msg,
Object... tkns)
Formats the given parameters via MessageFormat.format(String, Object...),
passing back the parameters as a concatenated string if formatting fails. |
|
static String |
formatDate(Date dt)
Formats the given date with the pattern: "MM/dd/yyyy". |
|
static String |
formatDate(Date dt,
String pattern)
Formats the given date with the specified pattern. |
|
static Class<?> |
getClass(String type)
Attempts to fetch a class by name and, if unsuccessful, will manipulate the given type to determine if it's an inner class (which will subsequently be fetched instead). |
|
static String |
join(String delim,
Object... objs)
Concatenates the specified parameters, inserting the given delimiter between each parameter. |
|
static Date |
parseDate(String str,
String... patterns)
Attempts to parse the given text with one of the specified patterns. |
|
static
|
valueOf(Class<T> enumClass,
CharSequence expr)
Invokes null-safe version of the
Enum.valueOf(Class, String) method. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String formatDate(Date dt)
dt - The date to format
null.
public static String formatDate(Date dt,
String pattern)
dt - The date to formatpattern - The pattern with which to format the date
null.
public static Date parseDate(String str,
String... patterns)
If no patterns are specified, the pattern "MM/dd/yyyy" will be applied.
str - The text to parsepatterns - Zero or more patterns with which to parse the given text.
null, if parsing was unsuccessful.public static String concat(Object... objs)
objs - The parameters to concatenate.
StringUtils.join(Object[])
public static String format(String msg,
Object... tkns)
MessageFormat.format(String, Object...),
passing back the parameters as a concatenated string if formatting fails.
msg - The formatted messagetkns - The tokens to insert in the message
public static Class<?> getClass(String type)
type - The class type
null
RuntimeException - if the given type does not match any known class
public static String join(String delim,
Object... objs)
delim - A delimiter inserted between parameters.objs - The parameters to join.
public static <T extends Enum<T>> T valueOf(Class<T> enumClass,
CharSequence expr)
null-safe version of the
Enum.valueOf(Class, String) method.
T - The generic type of the enum.enumClass - The class of the enum.expr - The name of the enum as a sequence of characters.
null.
|
Please visit Base Apps, hosted on Sourceforge.net. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||