org.apache.commons.jxpath.util

Interface TypeConverter

Known Implementing Classes:
BasicTypeConverter

public interface TypeConverter

A type converter can be installed on TypeUtils to introduce additional type conversions for JXPath. Most of the time BasicTypeConverter should be used as the superclass.
Version:
$Revision: 1.4 $ $Date: 2004/02/29 14:17:43 $
Author:
Dmitri Plotnikov
See Also:
TypeUtils.setTypeConverter(TypeConverter)

Method Summary

boolean
canConvert(Object object, Class toType)
Returns true if it can convert the supplied object to the specified class.
Object
convert(Object object, Class toType)
Converts the supplied object to the specified type.

Method Details

canConvert

public boolean canConvert(Object object,
                          Class toType)
Returns true if it can convert the supplied object to the specified class.

convert

public Object convert(Object object,
                      Class toType)
Converts the supplied object to the specified type. Throws a runtime exception if the conversion is not possible.