Package org.apache.commons.jxpath.util
Interface TypeConverter
-
- All Known Implementing Classes:
BasicTypeConverter
,JXPath11CompatibleTypeConverter
public interface TypeConverter
A type converter can be installed onTypeUtils
to introduce additional type conversions for JXPath. Most of the timeBasicTypeConverter
should be used as the superclass.- Version:
- $Revision: 652845 $ $Date: 2008-05-02 12:46:46 -0500 (Fri, 02 May 2008) $
- Author:
- Dmitri Plotnikov
- See Also:
TypeUtils.setTypeConverter(org.apache.commons.jxpath.util.TypeConverter)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canConvert(java.lang.Object object, java.lang.Class toType)
Returns true if it can convert the supplied object to the specified class.java.lang.Object
convert(java.lang.Object object, java.lang.Class toType)
Converts the supplied object to the specified type.
-
-
-
Method Detail
-
canConvert
boolean canConvert(java.lang.Object object, java.lang.Class toType)
Returns true if it can convert the supplied object to the specified class.- Parameters:
object
- object to testtoType
- target class- Returns:
- boolean
-
convert
java.lang.Object convert(java.lang.Object object, java.lang.Class toType)
Converts the supplied object to the specified type. Throws a runtime exception if the conversion is not possible.- Parameters:
object
- object to converttoType
- target class- Returns:
- resulting Object
-
-