org.apache.xpath.objects

Class XRTreeFrag

public class XRTreeFrag extends XObject implements Cloneable

This class represents an XPath result tree fragment object, and is capable of converting the RTF to other types, such as a string.

UNKNOWN: general

Constructor Summary
XRTreeFrag(int root, XPathContext xctxt, ExpressionNode parent)
Create an XRTreeFrag Object.
XRTreeFrag(int root, XPathContext xctxt)
Create an XRTreeFrag Object.
XRTreeFrag(Expression expr)
Create an XRTreeFrag Object.
Method Summary
voidallowDetachToRelease(boolean allowRelease)
Specify if it's OK for detach to release the iterator for reuse.
voidappendToFsb(FastStringBuffer fsb)
Cast result object to a string.
DTMIteratorasNodeIterator()
Cast result object to a DTMIterator. dml - modified to return an RTFIterator for benefit of EXSLT object-type function in ExsltCommon.
booleanbool()
Cast result object to a boolean.
NodeListconvertToNodeset()
Cast result object to a nodelist. (special function).
voiddetach()
Detaches the DTMIterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.
booleanequals(XObject obj2)
Tell if two objects are functionally equal.
intgetType()
Tell what kind of class this is.
StringgetTypeString()
Given a request type, return the equivalent string.
doublenum()
Cast result object to a number.
Objectobject()
Return a java object that's closest to the representation that should be handed to an extension.
intrtf()
Cast result object to a result tree fragment.
Stringstr()
Cast result object to a string.
XMLStringxstr()
Cast result object to an XMLString.

Constructor Detail

XRTreeFrag

public XRTreeFrag(int root, XPathContext xctxt, ExpressionNode parent)
Create an XRTreeFrag Object.

XRTreeFrag

public XRTreeFrag(int root, XPathContext xctxt)
Create an XRTreeFrag Object.

XRTreeFrag

public XRTreeFrag(Expression expr)
Create an XRTreeFrag Object.

Method Detail

allowDetachToRelease

public void allowDetachToRelease(boolean allowRelease)
Specify if it's OK for detach to release the iterator for reuse.

Parameters: allowRelease true if it is OK for detach to release this iterator for pooling.

appendToFsb

public void appendToFsb(FastStringBuffer fsb)
Cast result object to a string.

Returns: The string this wraps or the empty string if null

asNodeIterator

public DTMIterator asNodeIterator()
Cast result object to a DTMIterator. dml - modified to return an RTFIterator for benefit of EXSLT object-type function in ExsltCommon.

Returns: The document fragment as a DTMIterator

bool

public boolean bool()
Cast result object to a boolean. This always returns true for a RTreeFrag because it is treated like a node-set with a single root node.

Returns: true

convertToNodeset

public NodeList convertToNodeset()
Cast result object to a nodelist. (special function).

Returns: The document fragment as a nodelist

detach

public void detach()
Detaches the DTMIterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state. After detach has been invoked, calls to nextNode or previousNode will raise a runtime exception. In general, detach should only be called once on the object.

equals

public boolean equals(XObject obj2)
Tell if two objects are functionally equal.

Parameters: obj2 Object to compare this to

Returns: True if the two objects are equal

Throws: javax.xml.transform.TransformerException

getType

public int getType()
Tell what kind of class this is.

Returns: type CLASS_RTREEFRAG

getTypeString

public String getTypeString()
Given a request type, return the equivalent string. For diagnostic purposes.

Returns: type string "#RTREEFRAG"

num

public double num()
Cast result object to a number.

Returns: The result tree fragment as a number or NaN

object

public Object object()
Return a java object that's closest to the representation that should be handed to an extension.

Returns: The object that this class wraps

rtf

public int rtf()
Cast result object to a result tree fragment.

Returns: The document fragment this wraps

str

public String str()
Cast result object to a string.

Returns: The document fragment node data or the empty string.

xstr

public XMLString xstr()
Cast result object to an XMLString.

Returns: The document fragment node data or the empty string.

Copyright B) 2006 Apache XML Project. All Rights Reserved.