FileDocCategorySizeDatePackage
XRTreeFragSelectWrapper.javaAPI DocJava SE 5 API4614Fri Aug 26 14:56:10 BST 2005com.sun.org.apache.xpath.internal.objects

XRTreeFragSelectWrapper

public class XRTreeFragSelectWrapper extends XRTreeFrag implements Cloneable
This class makes an select statement act like an result tree fragment.

Fields Summary
XObject
m_selected
Constructors Summary
public XRTreeFragSelectWrapper(Expression expr)

    super(expr);
  
Methods Summary
public com.sun.org.apache.xml.internal.dtm.DTMIteratorasNodeIterator()
Cast result object to a DTMIterator.

return
The document fragment as a DTMIterator

    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"asNodeIterator() not supported by XRTreeFragSelectWrapper!");
  
public voiddetach()
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.

    if(m_allowRelease)
    {
      m_selected.detach();
      m_selected = null;
    }
    
    super.detach();
  
public com.sun.org.apache.xpath.internal.objects.XObjectexecute(com.sun.org.apache.xpath.internal.XPathContext xctxt)
For support of literal objects in xpaths.

param
xctxt The XPath execution context.
return
the result of executing the select expression
throws
javax.xml.transform.TransformerException

     m_selected = ((Expression)m_obj).execute(xctxt);
     m_selected.allowDetachToRelease(m_allowRelease);
     if (m_selected.getType() == CLASS_STRING)
       return m_selected;
     else
       return new XString(m_selected.str());
  
public voidfixupVariables(java.util.Vector vars, int globalsSize)
This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.

param
vars List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corresponds to the variable reference qname. The position of the QName in the vector from the start of the vector will be its position in the stack frame (but variables above the globalsTop value will need to be offset to the current stack frame).

    ((Expression)m_obj).fixupVariables(vars, globalsSize);
  
public intgetType()
Tell what kind of class this is.

return
the string type

    return CLASS_STRING;
  
public doublenum()
Cast result object to a number.

return
The result tree fragment as a number or NaN


    return m_selected.num();
  
public intrtf()
Cast result object to a result tree fragment.

return
The document fragment this wraps

    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"rtf() not supported by XRTreeFragSelectWrapper!");
  
public java.lang.Stringstr()
Cast result object to a string.

return
The document fragment node data or the empty string.

    return m_selected.str();
  
public com.sun.org.apache.xml.internal.utils.XMLStringxstr()
Cast result object to an XMLString.

return
The document fragment node data or the empty string.

    return m_selected.xstr();