|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.resteasy.util.TypeConverter
public final class TypeConverter
A utility class that can convert a String value as a typed object.
| Method Summary | ||
|---|---|---|
static java.lang.Boolean |
getBooleanValue(java.lang.String source)
Returns a Boolean value from a String. |
|
static
|
getType(java.lang.Class<T> targetType,
java.lang.String source)
A generic method that returns the String as the specified Java type. |
|
static
|
getTypeViaValueOfMethod(java.lang.String source,
java.lang.Class<T> targetType)
|
|
static boolean |
isConvertable(java.lang.Class<?> targetType)
Tests if the class can safely be converted from a String to the specified type. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> T getType(java.lang.Class<T> targetType,
java.lang.String source)
String as the specified Java type.
T - the type to returnsource - the string value to converttargetType -
public static boolean isConvertable(java.lang.Class<?> targetType)
targetType - the type to convert to
public static java.lang.Boolean getBooleanValue(java.lang.String source)
Returns a Boolean value from a String. Unlike Boolean.#valueOf(String), this
method takes more String options. The following String values will return true:
While the following values will return false:
source -
public static <T> T getTypeViaValueOfMethod(java.lang.String source,
java.lang.Class<T> targetType)
throws java.lang.NoSuchMethodException
T - source - targetType -
java.lang.NoSuchMethodException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||