Package com.icl.saxon.expr
Class ObjectValue
- java.lang.Object
-
- com.icl.saxon.expr.Expression
-
- com.icl.saxon.expr.Value
-
- com.icl.saxon.expr.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.Expression
staticContext
-
-
Constructor Summary
Constructors Constructor Description ObjectValue(Object object)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanasBoolean()Convert the value to a booleandoubleasNumber()Get the value as a numberStringasString()Get the value as a StringintconversionPreference(Class required)Get conversion preference for this value to a Java class.ObjectconvertToJava(Class target)Convert to Java object (for passing to external functions)voiddisplay(int level)Diagnostic print of expression structurebooleanequals(ObjectValue other)Determine if two ObjectValues are equalintgetDataType()Determine the data type of the expressionObjectgetObject()Get the encapsulated object-
Methods inherited from class com.icl.saxon.expr.Value
compare, equals, evaluate, getDependencies, inverse, notEquals, numericCompare, reduce, simplify, stringToNumber
-
Methods inherited from class com.icl.saxon.expr.Expression
containsReferences, enumerate, evaluateAsBoolean, evaluateAsNodeSet, evaluateAsNumber, evaluateAsString, getStaticContext, indent, isContextDocumentNodeSet, make, outputStringValue, setStaticContext, usesCurrent
-
-
-
-
Constructor Detail
-
ObjectValue
public ObjectValue(Object object)
Constructor
-
-
Method Detail
-
asString
public String asString()
Get the value as a String
-
asNumber
public double asNumber()
Get the value as a number
-
asBoolean
public boolean asBoolean()
Convert the value to a boolean
-
getDataType
public int getDataType()
Determine the data type of the expression- Specified by:
getDataTypein classExpression- Returns:
- Value.OBJECT
-
getObject
public Object getObject()
Get the encapsulated object
-
equals
public boolean equals(ObjectValue other)
Determine if two ObjectValues are equal
-
conversionPreference
public int conversionPreference(Class required)
Get conversion preference for this value to a Java class. A low result indicates higher preference.- Specified by:
conversionPreferencein classValue
-
convertToJava
public Object convertToJava(Class target) throws XPathException
Convert to Java object (for passing to external functions)- Specified by:
convertToJavain classValue- Parameters:
target- The class required by the external function- Returns:
- an object of the target class
- Throws:
XPathException
-
display
public void display(int level)
Diagnostic print of expression structure- Specified by:
displayin classExpression
-
-