|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.savarese.unicorn.util.Types
public final class Types
A singleton class storing convenience methods for converting from and to string representations of objects.
| Method Summary | |
|---|---|
static java.lang.String |
arrayToString(java.lang.Object[] values)
Converts an arrray of values to a string representation used by Commons BeanUtils. |
static java.lang.String |
convert(java.lang.Object value)
Converts a value to a string representation, converting arrays with arrayToString(java.lang.Object[]) and other objects with Commons
BeanUtils. |
static java.lang.Object |
convert(java.lang.String value,
java.lang.Class type)
Converts a string representation of a value to an object of a specified type. |
static java.lang.Class |
getClass(java.lang.String name)
Returns the class object corresponding to the given type name. |
static java.lang.String[] |
stringToStringArray(java.lang.String values)
Convert a string representation of a string array to an array of strings. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final java.lang.Class getClass(java.lang.String name)
throws java.lang.ClassNotFoundException
name - The name of the type to retrieve.
java.lang.ClassNotFoundException - If a class corresponding to the
name cannot be found.public static final java.lang.String arrayToString(java.lang.Object[] values)
{ "value1", "value2", "value3" }
values - The array of values to convert.
public static final java.lang.String[] stringToStringArray(java.lang.String values)
values - The string representation to convert.
public static java.lang.String convert(java.lang.Object value)
arrayToString(java.lang.Object[]) and other objects with Commons
BeanUtils.
value - The value to convert.
public static java.lang.Object convert(java.lang.String value,
java.lang.Class type)
throws java.lang.Exception
value - The string value to convert.type - The type of the object to convert to.
java.lang.Exception - If there is a problem converting the value.
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||