net.sf.saxon.s9api

## Class XdmExternalObject

- java.lang.Object
- - net.sf.saxon.s9api.XdmValue
  - - net.sf.saxon.s9api.XdmItem
    - - net.sf.saxon.s9api.XdmExternalObject

- All Implemented Interfaces:
    Iterable<XdmItem>

      public class XdmExternalObject
      extends XdmItem

  The class XdmExternalObject represents an XDM item that wraps an external (Java or .NET) object. As such, it is outside the scope of the XDM specification (but permitted as an extension).

  In releases prior to 9.5, external objects in Saxon were represented as atomic values. From 9.5 they are represented as a fourth kind of item, alongside nodes, atomic values, and functions.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `XdmExternalObject(Object value)`
    `` | `XdmExternalObject(String lexicalForm, ItemType type)` Construct an atomic value given its lexical representation and the name of the required built-in atomic type.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getExternalObject()` Get the wrapped Java object
    `String` | `toString()` Get the result of converting the external value to a string.

    - ### Methods inherited from class net.sf.saxon.s9api.XdmItem

      `getStringValue, isAtomicValue, newAtomicValue, size, wrapItem`

    - ### Methods inherited from class net.sf.saxon.s9api.XdmValue

      `append, getUnderlyingValue, itemAt, iterator, setValue, wrap`

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

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

- - ### Constructor Detail

    - #### XdmExternalObject

          protected XdmExternalObject(Object value)

    - #### XdmExternalObject

          public XdmExternalObject(String lexicalForm,
                           ItemType type)
                            throws SaxonApiException

      Construct an atomic value given its lexical representation and the name of the required built-in atomic type.

      This method cannot be used to construct values that are namespace-sensitive (QNames and Notations)

      Parameters:
        `lexicalForm` - the value in the lexical space of the target data type. More strictly, the input value before the actions of the whitespace facet for the target data type are applied.
        `type` - the required atomic type. This must either be one of the built-in atomic types defined in XML Schema, or a user-defined type whose definition appears in a schema that is known to the Processor. It must not be an abstract type.
      Throws:
        `SaxonApiException` - if the type is unknown, or is not atomic, or is namespace-sensitive; or if the value supplied in `lexicalForm` is not in the lexical space of the specified atomic type.

  - ### Method Detail

    - #### getExternalObject

          public Object getExternalObject()

      Get the wrapped Java object
      Returns:
        the wrapped object

    - #### toString

          public String toString()

      Get the result of converting the external value to a string.
      Overrides:
        `toString` in class `Object`

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.