/** * Read the object from a serialization stream. * * @param stream Input stream to read from * * @throws java.io.IOException * @throws javax.xml.transform.TransformerException */ private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
/** * Detaches the iterator from the set which it iterated over, releasing * any computational resources and placing the iterator in the INVALID * state. After<code>detach</code> has been invoked, calls to * <code>nextNode</code> or<code>previousNode</code> will raise the * exception INVALID_STATE_ERR. */ public void detach() { if(m_allowDetach) { // sb: allow reusing of cached nodes when possible? // m_cachedNodes = null; m_execContext = null; // m_prefixResolver = null; sb: Why would this ever want to be null? m_cdtm = null; m_length = -1; m_pos = 0; m_lastFetched = DTM.NULL; m_context = DTM.NULL; m_currentContextNode = DTM.NULL; m_clones.freeInstance(this); } }
/** * Given an select expression and a context, evaluate the XPath * and return the resulting iterator. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * @throws TransformerException thrown if the active ProblemListener decides * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public DTMIterator asIterator( XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(contextNode, xctxt); return iter; }
/** * Get a cloned Iterator that is reset to the beginning * of the query. * * @return A cloned NodeIterator set of the start of the query. * * @throws CloneNotSupportedException */ public DTMIterator cloneWithReset() throws CloneNotSupportedException { LocPathIterator clone; // clone = (LocPathIterator) clone(); clone = (LocPathIterator)m_clones.getInstanceOrThrow(); clone.m_execContext = m_execContext; clone.m_cdtm = m_cdtm; clone.m_context = m_context; clone.m_currentContextNode = m_currentContextNode; clone.m_stackFrame = m_stackFrame; // clone.reset(); return clone; }
/** * Get a cloned Iterator that is reset to the beginning * of the query. * * @return A cloned NodeIterator set of the start of the query. * * @throws CloneNotSupportedException */ public DTMIterator cloneWithReset() throws CloneNotSupportedException { LocPathIterator clone; // clone = (LocPathIterator) clone(); clone = (LocPathIterator)m_clones.getInstanceOrThrow(); clone.m_execContext = m_execContext; clone.m_cdtm = m_cdtm; clone.m_context = m_context; clone.m_currentContextNode = m_currentContextNode; clone.m_stackFrame = m_stackFrame; // clone.reset(); return clone; }
/** * Given an select expression and a context, evaluate the XPath * and return the resulting iterator. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * @throws TransformerException thrown if the active ProblemListener decides * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public DTMIterator asIterator( XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(contextNode, xctxt); return iter; }
/** * Read the object from a serialization stream. * * @param stream Input stream to read from * * @throws java.io.IOException * @throws javax.xml.transform.TransformerException */ private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
/** * Get a cloned Iterator that is reset to the beginning * of the query. * * @return A cloned NodeIterator set of the start of the query. * * @throws CloneNotSupportedException */ public DTMIterator cloneWithReset() throws CloneNotSupportedException { LocPathIterator clone; // clone = (LocPathIterator) clone(); clone = (LocPathIterator)m_clones.getInstanceOrThrow(); clone.m_execContext = m_execContext; clone.m_cdtm = m_cdtm; clone.m_context = m_context; clone.m_currentContextNode = m_currentContextNode; clone.m_stackFrame = m_stackFrame; // clone.reset(); return clone; }
/** * Detaches the iterator from the set which it iterated over, releasing * any computational resources and placing the iterator in the INVALID * state. After<code>detach</code> has been invoked, calls to * <code>nextNode</code> or<code>previousNode</code> will raise the * exception INVALID_STATE_ERR. */ public void detach() { if(m_allowDetach) { // sb: allow reusing of cached nodes when possible? // m_cachedNodes = null; m_execContext = null; // m_prefixResolver = null; sb: Why would this ever want to be null? m_cdtm = null; m_length = -1; m_pos = 0; m_lastFetched = DTM.NULL; m_context = DTM.NULL; m_currentContextNode = DTM.NULL; m_clones.freeInstance(this); } }
/** * Execute this iterator, meaning create a clone that can * store state, and initialize it for fast execution from * the current runtime state. When this is called, no actual * query from the current context node is performed. * * @param xctxt The XPath execution context. * * @return An XNodeSet reference that holds this iterator. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(xctxt.getCurrentNode(), xctxt); return iter; }
/** * Read the object from a serialization stream. * * @param stream Input stream to read from * * @throws java.io.IOException * @throws javax.xml.transform.TransformerException */ private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
/** * Get a cloned Iterator that is reset to the beginning * of the query. * * @return A cloned NodeIterator set of the start of the query. * * @throws CloneNotSupportedException */ public DTMIterator cloneWithReset() throws CloneNotSupportedException { LocPathIterator clone; // clone = (LocPathIterator) clone(); clone = (LocPathIterator)m_clones.getInstanceOrThrow(); clone.m_execContext = m_execContext; clone.m_cdtm = m_cdtm; clone.m_context = m_context; clone.m_currentContextNode = m_currentContextNode; clone.m_stackFrame = m_stackFrame; // clone.reset(); return clone; }
/** * Detaches the iterator from the set which it iterated over, releasing * any computational resources and placing the iterator in the INVALID * state. After<code>detach</code> has been invoked, calls to * <code>nextNode</code> or<code>previousNode</code> will raise the * exception INVALID_STATE_ERR. */ public void detach() { if(m_allowDetach) { // sb: allow reusing of cached nodes when possible? // m_cachedNodes = null; m_execContext = null; // m_prefixResolver = null; sb: Why would this ever want to be null? m_cdtm = null; m_length = -1; m_pos = 0; m_lastFetched = DTM.NULL; m_context = DTM.NULL; m_currentContextNode = DTM.NULL; m_clones.freeInstance(this); } }
/** * Execute this iterator, meaning create a clone that can * store state, and initialize it for fast execution from * the current runtime state. When this is called, no actual * query from the current context node is performed. * * @param xctxt The XPath execution context. * * @return An XNodeSet reference that holds this iterator. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(xctxt.getCurrentNode(), xctxt); return iter; }
/** * Read the object from a serialization stream. * * @param stream Input stream to read from * * @throws java.io.IOException * @throws javax.xml.transform.TransformerException */ private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
/** * Get a cloned Iterator that is reset to the beginning * of the query. * * @return A cloned NodeIterator set of the start of the query. * * @throws CloneNotSupportedException */ public DTMIterator cloneWithReset() throws CloneNotSupportedException { LocPathIterator clone; // clone = (LocPathIterator) clone(); clone = (LocPathIterator)m_clones.getInstanceOrThrow(); clone.m_execContext = m_execContext; clone.m_cdtm = m_cdtm; clone.m_context = m_context; clone.m_currentContextNode = m_currentContextNode; clone.m_stackFrame = m_stackFrame; // clone.reset(); return clone; }
/** * Detaches the iterator from the set which it iterated over, releasing * any computational resources and placing the iterator in the INVALID * state. After<code>detach</code> has been invoked, calls to * <code>nextNode</code> or<code>previousNode</code> will raise the * exception INVALID_STATE_ERR. */ public void detach() { if(m_allowDetach) { // sb: allow reusing of cached nodes when possible? // m_cachedNodes = null; m_execContext = null; // m_prefixResolver = null; sb: Why would this ever want to be null? m_cdtm = null; m_length = -1; m_pos = 0; m_lastFetched = DTM.NULL; m_context = DTM.NULL; m_currentContextNode = DTM.NULL; m_clones.freeInstance(this); } }
/** * Return the first node out of the nodeset, if this expression is * a nodeset expression. This is the default implementation for * nodesets. Derived classes should try and override this and return a * value without having to do a clone operation. * @param xctxt The XPath runtime context. * @return the first node out of the nodeset, or DTM.NULL. */ public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { DTMIterator iter = (DTMIterator)m_clones.getInstance(); int current = xctxt.getCurrentNode(); iter.setRoot(current, xctxt); int next = iter.nextNode(); // m_clones.freeInstance(iter); iter.detach(); return next; }
/** * Read the object from a serialization stream. * * @param stream Input stream to read from * * @throws java.io.IOException * @throws javax.xml.transform.TransformerException */ private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
/** * Get a cloned Iterator that is reset to the beginning * of the query. * * @return A cloned NodeIterator set of the start of the query. * * @throws CloneNotSupportedException */ public DTMIterator cloneWithReset() throws CloneNotSupportedException { LocPathIterator clone; // clone = (LocPathIterator) clone(); clone = (LocPathIterator)m_clones.getInstanceOrThrow(); clone.m_execContext = m_execContext; clone.m_cdtm = m_cdtm; clone.m_context = m_context; clone.m_currentContextNode = m_currentContextNode; clone.m_stackFrame = m_stackFrame; // clone.reset(); return clone; }