org.apache.commons.jxpath.util

Class TypeUtils


public class TypeUtils
extends java.lang.Object

Global type conversion utilities.
Version:
$Revision: 1.13 $ $Date: 2004/02/29 14:17:43 $
Author:
Dmitri Plotnikov

Method Summary

static boolean
canConvert(Object object, Class toType)
Returns true if the global converter can convert the supplied object to the specified type.
static Object
convert(Object object, Class toType)
Converts the supplied object to the specified type.
static TypeConverter
getTypeConverter()
Returns the current type converter.
static void
setTypeConverter(TypeConverter converter)
Install an alternative type converter.

Method Details

canConvert

public static boolean canConvert(Object object,
                                 Class toType)
Returns true if the global converter can convert the supplied object to the specified type.

convert

public static Object convert(Object object,
                             Class toType)
Converts the supplied object to the specified type. May throw a RuntimeException.

getTypeConverter

public static TypeConverter getTypeConverter()
Returns the current type converter.

setTypeConverter

public static void setTypeConverter(TypeConverter converter)
Install an alternative type converter.