net.sf.saxon.value

Class ObjectValue

public class ObjectValue extends AtomicValue

An XPath value that encapsulates a Java object. Such a value can only be obtained by calling an extension function that returns it.
Constructor Summary
ObjectValue()
Default constructor for use in subclasses
ObjectValue(Object object)
Constructor
Method Summary
AtomicValueconvertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type
ObjectconvertToJava(Class target, XPathContext context)
Convert to Java object (for passing to external functions)
booleaneffectiveBooleanValue(XPathContext context)
Get the effective boolean value of the value
booleanequals(Object other)
Determine if two ObjectValues are equal
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the expression
ObjectgetObject()
Get the encapsulated object
StringgetStringValue()
Get the value as a String
inthashCode()
voidsetValue(Object value)
Set the value in this object value

Constructor Detail

ObjectValue

public ObjectValue()
Default constructor for use in subclasses

ObjectValue

public ObjectValue(Object object)
Constructor

Parameters: object the object to be encapsulated

Method Detail

convertPrimitive

public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type

convertToJava

public Object convertToJava(Class target, XPathContext context)
Convert to Java object (for passing to external functions)

effectiveBooleanValue

public boolean effectiveBooleanValue(XPathContext context)
Get the effective boolean value of the value

Parameters: context the evaluation context (not used in this implementation)

Returns: true, unless the value is boolean false, numeric zero, or zero-length string

equals

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

Throws: ClassCastException if they are not comparable

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the data type of the expression

Parameters: th

Returns: Type.OBJECT

getObject

public Object getObject()
Get the encapsulated object

getStringValue

public String getStringValue()
Get the value as a String

Returns: a String representation of the value

hashCode

public int hashCode()

setValue

public void setValue(Object value)
Set the value in this object value