## net.sf.saxon.xqj
Interface ObjectConverter

All Known Implementing Classes:
  StandardObjectConverter

    public interface ObjectConverter

This interface is based on the "CommonHandler" concept defined in early drafts of XQJ. It defines the data conversion routines used by the Saxon XQJ implementation to convert between native Java objects and XDM values. Most applications will use the Saxon-supplied implementation `StandardObjectConverter`, but it is possible to supply an alternative implementation using the method `SaxonXQDataFactory.setObjectConverter(net.sf.saxon.xqj.ObjectConverter)`

Method Summary
`Item` `convertToItem(java.lang.Object value)` Convert a Java object to an Item, when no information is available about the required type
`Item` `convertToItem(java.lang.Object value, javax.xml.xquery.XQItemType type)` Convert a Java object to an Item, when a required type has been specified.
`java.lang.Object` `toObject(javax.xml.xquery.XQItemAccessor xqItemAccessor)` Convert an Item to a Java object

Method Detail

### toObject

    java.lang.Object toObject(javax.xml.xquery.XQItemAccessor xqItemAccessor)
                              throws javax.xml.xquery.XQException

  Convert an Item to a Java object

  Parameters:
    `xqItemAccessor` - the XQJ object representing the item to be converted
  Returns:
    the Java object that results from the conversion
  Throws:
    `javax.xml.xquery.XQException`

### convertToItem

    Item convertToItem(java.lang.Object value)
                       throws javax.xml.xquery.XQException

  Convert a Java object to an Item, when no information is available about the required type

  Parameters:
    `value` - the supplied Java object
  Returns:
    the Item that results from the conversion
  Throws:
    `javax.xml.xquery.XQException` - if the Java object cannot be converted to an XQItem

### convertToItem

    Item convertToItem(java.lang.Object value,
                       javax.xml.xquery.XQItemType type)
                       throws javax.xml.xquery.XQException

  Convert a Java object to an Item, when a required type has been specified. Note that Saxon only calls this method when none of the standard conversions defined in the XQJ specification is able to handle the object.

  Parameters:
    `value` - the supplied Java object
    `type` - the required XPath data type
  Returns:
    the Item that results from the conversion
  Throws:
    `javax.xml.xquery.XQException` - if the Java object cannot be converted to an XQItem

Copyright (c) Saxonica Limited. All rights reserved.