org.apache.commons.jxpath.util
Class TypeUtils

java.lang.Object
  extended byorg.apache.commons.jxpath.util.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

Field Summary
private static TypeConverter typeConverter
           
 
Constructor Summary
TypeUtils()
           
 
Method Summary
static boolean canConvert(java.lang.Object object, java.lang.Class toType)
          Returns true if the global converter can convert the supplied object to the specified type.
static java.lang.Object convert(java.lang.Object object, java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

typeConverter

private static TypeConverter typeConverter
Constructor Detail

TypeUtils

public TypeUtils()
Method Detail

setTypeConverter

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


getTypeConverter

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


canConvert

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


convert

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