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

XNodeSetForDOM

public class XNodeSetForDOM extends XNodeSet
This class overrides the XNodeSet#object() method to provide the original Node object, NodeList object, or NodeIterator.

Fields Summary
Object
m_origObj
Constructors Summary
public XNodeSetForDOM(Node node, DTMManager dtmMgr)

    m_dtmMgr = dtmMgr;
    m_origObj = node;
    int dtmHandle = dtmMgr.getDTMHandleFromNode(node);
    m_obj = new NodeSetDTM(dtmMgr);
    ((NodeSetDTM) m_obj).addNode(dtmHandle);
  
public XNodeSetForDOM(XNodeSet val)
Construct a XNodeSet object.

param
val Value of the XNodeSet object

  	super(val);
  	if(val instanceof XNodeSetForDOM)
    	m_origObj = ((XNodeSetForDOM)val).m_origObj;
  
public XNodeSetForDOM(NodeList nodeList, XPathContext xctxt)

    m_dtmMgr = xctxt.getDTMManager();
    m_origObj = nodeList;

    // JKESS 20020514: Longer-term solution is to force
    // folks to request length through an accessor, so we can defer this
    // retrieval... but that requires an API change.
    // m_obj=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
    com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeList, xctxt);
    m_last=nsdtm.getLength();
    m_obj = nsdtm;   
  
public XNodeSetForDOM(NodeIterator nodeIter, XPathContext xctxt)

    m_dtmMgr = xctxt.getDTMManager();
    m_origObj = nodeIter;

    // JKESS 20020514: Longer-term solution is to force
    // folks to request length through an accessor, so we can defer this
    // retrieval... but that requires an API change.
    // m_obj = new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeIter, xctxt);
    com.sun.org.apache.xpath.internal.NodeSetDTM nsdtm=new com.sun.org.apache.xpath.internal.NodeSetDTM(nodeIter, xctxt);
    m_last=nsdtm.getLength();
    m_obj = nsdtm;   
  
Methods Summary
public org.w3c.dom.NodeListnodelist()
Cast result object to a nodelist. Always issues an error.

return
null
throws
javax.xml.transform.TransformerException

    return (m_origObj instanceof NodeList) 
                   ? (NodeList)m_origObj : super.nodelist();      
  
public org.w3c.dom.traversal.NodeIteratornodeset()
Cast result object to a nodelist. Always issues an error.

return
null
throws
javax.xml.transform.TransformerException

    return (m_origObj instanceof NodeIterator) 
                   ? (NodeIterator)m_origObj : super.nodeset();      
  
public java.lang.Objectobject()
Return the original DOM object that the user passed in. For use primarily by the extension mechanism.

return
The object that this class wraps

    return m_origObj;