Package org.apache.commons.jxpath.util

# Class JXPath11CompatibleTypeConverter

java.lang.Object
org.apache.commons.jxpath.util.BasicTypeConverter
org.apache.commons.jxpath.util.JXPath11CompatibleTypeConverter

All Implemented Interfaces:
  `TypeConverter`

public class JXPath11CompatibleTypeConverter extends BasicTypeConverter
TypeConverter implementation to circumvent automagic `NodeSet` decoding. Suggested by JIRA issue JXPATH-10.

Since:
  JXPath 1.3

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JXPath11CompatibleTypeConverter()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `canConvert(Object object, Class toType)`
  Tests whether this instance can convert the supplied object to the specified class.
  `Object`
  `convert(Object object, Class toType)`
  Converts the supplied object to the specified type.

  ### Methods inherited from class org.apache.commons.jxpath.util.BasicTypeConverter

  `allocateCollection, allocateNumber, canCreateCollection, convertNullToPrimitive, convertStringToPrimitive, unmodifiableCollection`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### JXPath11CompatibleTypeConverter

    public JXPath11CompatibleTypeConverter()
    Constructs a new instance.

- ## Method Details

  - ### canConvert

    public boolean canConvert(Object object, Class toType)
    Description copied from class: `BasicTypeConverter`
    Tests whether this instance can convert the supplied object to the specified class.
    Specified by:
      `canConvert` in interface `TypeConverter`
    Overrides:
      `canConvert` in class `BasicTypeConverter`
    Parameters:
      `object` - to check
      `toType` - prospective destination class
    Returns:
      boolean whether this instance can convert the supplied object to the specified class.

  - ### convert

    public Object convert(Object object, Class toType)
    Description copied from class: `BasicTypeConverter`
    Converts the supplied object to the specified type. Throws a runtime exception if the conversion is not possible.
    Specified by:
      `convert` in interface `TypeConverter`
    Overrides:
      `convert` in class `BasicTypeConverter`
    Parameters:
      `object` - to convert
      `toType` - destination class
    Returns:
      converted object