Methods Summary |
---|
public void | callPredicateVisitors(com.sun.org.apache.xpath.internal.XPathVisitor visitor)This will traverse the heararchy, calling the visitor for
each member. If the called visitor method returns
false, the subtree should not be called.
m_expr.callVisitors(new filterExprOwner(), visitor);
super.callPredicateVisitors(visitor);
|
public boolean | deepEquals(com.sun.org.apache.xpath.internal.Expression expr)
if (!super.deepEquals(expr))
return false;
FilterExprIteratorSimple fet = (FilterExprIteratorSimple) expr;
if (!m_expr.deepEquals(fet.m_expr))
return false;
return true;
|
public void | detach()Detaches the walker from the set which it iterated over, releasing
any computational resources and placing the iterator in the INVALID
state.
if(m_allowDetach)
{
super.detach();
m_exprObj.detach();
m_exprObj = null;
}
|
public static com.sun.org.apache.xpath.internal.objects.XNodeSet | executeFilterExpr(int context, com.sun.org.apache.xpath.internal.XPathContext xctxt, com.sun.org.apache.xml.internal.utils.PrefixResolver prefixResolver, boolean isTopLevel, int stackFrame, com.sun.org.apache.xpath.internal.Expression expr)Execute the expression. Meant for reuse by other FilterExpr iterators
that are not derived from this object.
PrefixResolver savedResolver = xctxt.getNamespaceContext();
XNodeSet result = null;
try
{
xctxt.pushCurrentNode(context);
xctxt.setNamespaceContext(prefixResolver);
// The setRoot operation can take place with a reset operation,
// and so we may not be in the context of LocPathIterator#nextNode,
// so we have to set up the variable context, execute the expression,
// and then restore the variable context.
if (isTopLevel)
{
// System.out.println("calling m_expr.execute(getXPathContext())");
VariableStack vars = xctxt.getVarStack();
// These three statements need to be combined into one operation.
int savedStart = vars.getStackFrame();
vars.setStackFrame(stackFrame);
result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
result.setShouldCacheNodes(true);
// These two statements need to be combined into one operation.
vars.setStackFrame(savedStart);
}
else
result = (com.sun.org.apache.xpath.internal.objects.XNodeSet) expr.execute(xctxt);
}
catch (javax.xml.transform.TransformerException se)
{
// TODO: Fix...
throw new com.sun.org.apache.xml.internal.utils.WrappedRuntimeException(se);
}
finally
{
xctxt.popCurrentNode();
xctxt.setNamespaceContext(savedResolver);
}
return result;
|
public void | fixupVariables(java.util.Vector vars, int globalsSize)This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
super.fixupVariables(vars, globalsSize);
m_expr.fixupVariables(vars, globalsSize);
|
public int | getAnalysisBits()Get the analysis bits for this walker, as defined in the WalkerFactory.
if (null != m_expr && m_expr instanceof PathComponent)
{
return ((PathComponent) m_expr).getAnalysisBits();
}
return WalkerFactory.BIT_FILTER;
|
public int | getAxis()Returns the axis being iterated, if it is known.
if(null != m_exprObj)
return m_exprObj.getAxis();
else
return Axis.FILTEREDLIST;
|
public com.sun.org.apache.xpath.internal.Expression | getInnerExpression()Get the inner contained expression of this filter.
return m_expr;
|
public boolean | isDocOrdered()Returns true if all the nodes in the iteration well be returned in document
order.
Warning: This can only be called after setRoot has been called!
return m_exprObj.isDocOrdered();
|
public int | nextNode()Returns the next node in the set and advances the position of the
iterator in the set. After a NodeIterator is created, the first call
to nextNode() returns the first node in the set.
if(m_foundLast)
return DTM.NULL;
int next;
if (null != m_exprObj)
{
m_lastFetched = next = m_exprObj.nextNode();
}
else
m_lastFetched = next = DTM.NULL;
// m_lastFetched = next;
if (DTM.NULL != next)
{
m_pos++;
return next;
}
else
{
m_foundLast = true;
return DTM.NULL;
}
|
public void | setInnerExpression(com.sun.org.apache.xpath.internal.Expression expr)Set the inner contained expression of this filter.
expr.exprSetParent(this);
m_expr = expr;
|
public void | setRoot(int context, java.lang.Object environment)Initialize the context values for this expression
after it is cloned.
super.setRoot(context, environment);
m_exprObj = executeFilterExpr(context, m_execContext, getPrefixResolver(),
getIsTopLevel(), m_stackFrame, m_expr);
|