com.icl.saxon.expr

Class ObjectValue


public class ObjectValue
extends Value

An XPath value that encapsulates a Java object. Such a value can only be obtained by calling an extension function that returns it.

Field Summary

Fields inherited from class com.icl.saxon.expr.Value

ANY, BOOLEAN, NODESET, NUMBER, OBJECT, STRING

Fields inherited from class com.icl.saxon.expr.Expression

staticContext

Constructor Summary

ObjectValue(Object object)
Constructor

Method Summary

boolean
asBoolean()
Convert the value to a boolean
double
asNumber()
Get the value as a number
String
asString()
Get the value as a String
int
conversionPreference(Class required)
Get conversion preference for this value to a Java class.
Object
convertToJava(Class target)
Convert to Java object (for passing to external functions)
void
display(int level)
Diagnostic print of expression structure
boolean
equals(ObjectValue other)
Determine if two ObjectValues are equal
int
getDataType()
Determine the data type of the expression
Object
getObject()
Get the encapsulated object

Methods inherited from class com.icl.saxon.expr.Value

asBoolean, asNumber, asString, compare, conversionPreference, convertToJava, equals, evaluate, getDependencies, inverse, notEquals, numericCompare, reduce, simplify, stringToNumber

Methods inherited from class com.icl.saxon.expr.Expression

containsReferences, display, enumerate, evaluate, evaluateAsBoolean, evaluateAsNodeSet, evaluateAsNumber, evaluateAsString, getDataType, getDependencies, getStaticContext, indent, isContextDocumentNodeSet, make, outputStringValue, reduce, setStaticContext, simplify, usesCurrent

Constructor Details

ObjectValue

public ObjectValue(Object object)
Constructor

Method Details

asBoolean

public boolean asBoolean()
Convert the value to a boolean
Overrides:
asBoolean in interface Value

Returns:
the boolean value


asNumber

public double asNumber()
Get the value as a number
Overrides:
asNumber in interface Value

Returns:
the numeric value


asString

public String asString()
Get the value as a String
Overrides:
asString in interface Value

Returns:
a String representation of the value


conversionPreference

public int conversionPreference(Class required)
Get conversion preference for this value to a Java class. A low result indicates higher preference.
Overrides:
conversionPreference in interface Value


convertToJava

public Object convertToJava(Class target)
            throws XPathException
Convert to Java object (for passing to external functions)
Overrides:
convertToJava in interface Value


display

public void display(int level)
Diagnostic print of expression structure
Overrides:
display in interface Expression


equals

public boolean equals(ObjectValue other)
Determine if two ObjectValues are equal


getDataType

public int getDataType()
Determine the data type of the expression
Overrides:
getDataType in interface Expression

Returns:
Value.OBJECT


getObject

public Object getObject()
Get the encapsulated object