jd.xml.xslt.extension
Class XExternalObject

java.lang.Object
  extended byjd.xml.xpath.object.XObject
      extended byjd.xml.xslt.extension.XExternalObject

public class XExternalObject
extends XObject

A XExternalObject represents result objects returned from an extension function.


Field Summary
 
Fields inherited from class jd.xml.xpath.object.XObject
TYPE_BOOLEAN, TYPE_NODESET, TYPE_NUMBER, TYPE_STRING, TYPE_VARIABLE, TYPES
 
Constructor Summary
XExternalObject(Object value)
          Create a XExternalObject.
 
Method Summary
 int canConvertTo(Class javaClass)
          Test if the XObject can be converted to an object with the given class.
 boolean compare(Equality equality, String s)
          Return the double value of the string value of this object.
 int getType()
          Return XObject.TYPE_OTHER
 boolean toBooleanValue()
          Throws an exception since there is no standard way to convert an external object to a boolean.
 double toNumberValue()
          Return the double value of the string value of this object.
 String toStringValue()
          Return the string value of the object or an empty string if the value is null.
 Object toValue()
          Return the objects value as a object.
 Object toValue(Class javaClass)
          Convert the objects value to an object of the given class.
 
Methods inherited from class jd.xml.xpath.object.XObject
compare, compare, compare, compare, compare, equals, getTypeName, getTypeName, hashCode, toNodeSet, toString, toXObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XExternalObject

public XExternalObject(Object value)
Create a XExternalObject.

Parameters:
value - the value or null if his XExternalObject represents a null.
Method Detail

getType

public int getType()
Return XObject.TYPE_OTHER

Specified by:
getType in class XObject

toValue

public Object toValue()
Return the objects value as a object.

Specified by:
toValue in class XObject

toValue

public Object toValue(Class javaClass)
Convert the objects value to an object of the given class. If the conversion is not possible return null.

Specified by:
toValue in class XObject

canConvertTo

public int canConvertTo(Class javaClass)
Test if the XObject can be converted to an object with the given class.

Specified by:
canConvertTo in class XObject
Returns:
a positive integer if conversion is possible. The value indicates the conversion preference. A zero value indicates that conversion is not possible.

toBooleanValue

public boolean toBooleanValue()
                       throws XsltException
Throws an exception since there is no standard way to convert an external object to a boolean.

Specified by:
toBooleanValue in class XObject
Throws:
XsltException

toNumberValue

public double toNumberValue()
Return the double value of the string value of this object.

Specified by:
toNumberValue in class XObject

toStringValue

public String toStringValue()
Return the string value of the object or an empty string if the value is null.

Specified by:
toStringValue in class XObject

compare

public boolean compare(Equality equality,
                       String s)
Return the double value of the string value of this object.

Specified by:
compare in class XObject