|
||||||||||
| 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 Boolean |
getBooleanValue(String source)
Returns a Boolean value from a String. |
|
static
|
getType(Class<T> targetType,
String source)
A generic method that returns the String as the specified Java type. |
|
static
|
getTypeViaValueOfMethod(String source,
Class<T> targetType)
|
|
static boolean |
isConvertable(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(Class<T> targetType,
String source)
String as the specified Java type.
T - the type to returnsource - the string value to converttargetType -
public static boolean isConvertable(Class<?> targetType)
targetType - the type to convert to
public static Boolean getBooleanValue(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(String source,
Class<T> targetType)
throws NoSuchMethodException
T - source - targetType -
NoSuchMethodException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||