public class ConvertUtils extends Object
Constructor and Description |
---|
ConvertUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
doubleValue(Object o,
double defaultValue)
Converts o to a double.
|
static Locale |
getLocalFromToString(String sLocale)
Convert an Locale.toString() text to a Locale Object.
|
static Class<?> |
getPrimitiveType(String type)
Gets class for primitive type name (ie
Boolean for "boolean"). |
static int |
intValue(Object o,
int defaultValue)
Converts o to an int.
|
static boolean |
isEmpty(String s)
True if s is null or empty string (""); false otherwise.
|
static boolean |
isFalse(Object o)
True if o is Boolean.FALSE or "false" or "FALSE".
|
static boolean |
isPrimitiveType(String type)
True if type name is a primitive type (ie "boolean").
|
static boolean |
isTrue(Object o)
True if o is Boolean.TRUE or "true" or "TRUE".
|
static String |
toString(FacesContext context,
UIComponent component,
Object value)
Converts specified component value to a string, using component's converter.
|
static String |
toString(Object o)
Converts o to a string.
|
public static boolean isTrue(Object o)
public static boolean isFalse(Object o)
public static String toString(Object o)
public static String toString(FacesContext context, UIComponent component, Object value) throws ConverterException
context
- Current context.component
- Component for which to conver the value.value
- Value to convert.ConverterException
public static boolean isEmpty(String s)
public static int intValue(Object o, int defaultValue)
public static double doubleValue(Object o, double defaultValue)
public static boolean isPrimitiveType(String type)
public static Class<?> getPrimitiveType(String type)
Boolean
for "boolean").