org.sixdml.xindice
Class xiSixdmlXpathObject

java.lang.Object
  |
  +--org.sixdml.xindice.xiSixdmlXpathObject
All Implemented Interfaces:
SixdmlXpathObject

public class xiSixdmlXpathObject
extends Object
implements SixdmlXpathObject

  
 xiSixdmlXpathObject.java

 Represents an object returned from an XPath query. 
 

Version:
1.0

Field Summary
private  org.apache.xpath.objects.XObject xpathObj
          The Xalan XObject instance that this object acts as a wrapper for.
 
Fields inherited from interface org.sixdml.query.SixdmlXpathObject
BOOLEAN, NODESET, NUMBER, STRING, TREE_FRAGMENT, UNKNOWN
 
Constructor Summary
private xiSixdmlXpathObject()
          Default constructor private because an instance of this class must always be instantiated with an underlying eXcelon DXE XPathValue object.
(package private) xiSixdmlXpathObject(org.apache.xpath.objects.XObject xpathVal)
          Initializes this class with an XObject instance.
 
Method Summary
 String getNodeSetAsXML()
          Returns the contents of the object as an XML string if it is a nodeset or null otherwise.
 boolean getObjectAsBoolean()
          Returns the object as a boolean.
 NodeList getObjectAsNodeSet()
          Returns the object as a DOM node list.
 double getObjectAsNumber()
          Returns the object as a double.
 String getObjectAsString()
          Returns the object as a string.
 SixdmlXpathObjectType getType()
          Get the type of this object as a SixdmlXpathObjectType.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

xpathObj

private org.apache.xpath.objects.XObject xpathObj
The Xalan XObject instance that this object acts as a wrapper for.
Constructor Detail

xiSixdmlXpathObject

private xiSixdmlXpathObject()
Default constructor private because an instance of this class must always be instantiated with an underlying eXcelon DXE XPathValue object.

xiSixdmlXpathObject

xiSixdmlXpathObject(org.apache.xpath.objects.XObject xpathVal)
Initializes this class with an XObject instance.
Parameters:
xpathVal - the XObject instance.
Method Detail

getType

public SixdmlXpathObjectType getType()
Get the type of this object as a SixdmlXpathObjectType.
Specified by:
getType in interface SixdmlXpathObject
Returns:
the type of this object.

getObjectAsBoolean

public boolean getObjectAsBoolean()
Returns the object as a boolean.
Specified by:
getObjectAsBoolean in interface SixdmlXpathObject
Returns:
the object as a boolean.

getObjectAsString

public String getObjectAsString()
Returns the object as a string. For a nodeset the text form of the first element in the set is returned to be compatible with the XPath spec. For retrieval of the entire XML from a nodeset the getNodeSetAsXML() method should be used.
Specified by:
getObjectAsString in interface SixdmlXpathObject
Returns:
the object as a string.
See Also:
getNodeSetAsXML()

getObjectAsNumber

public double getObjectAsNumber()
Returns the object as a double.
Specified by:
getObjectAsNumber in interface SixdmlXpathObject
Returns:
the object as a double.

getObjectAsNodeSet

public NodeList getObjectAsNodeSet()
Returns the object as a DOM node list.
Specified by:
getObjectAsNodeSet in interface SixdmlXpathObject
Returns:
the object as a DOM node list.

getNodeSetAsXML

public String getNodeSetAsXML()
Returns the contents of the object as an XML string if it is a nodeset or null otherwise.
Specified by:
getNodeSetAsXML in interface SixdmlXpathObject
Returns:
the entire contents of the object as a string if it is a nodeset or null otherwise.