Methods Summary |
---|
public short | acceptNode(int n)This method needs to override AxesWalker.acceptNode because FilterExprWalkers
don't need to, and shouldn't, do a node test.
try
{
if (getPredicateCount() > 0)
{
countProximityPosition(0);
if (!executePredicates(n, m_lpi.getXPathContext()))
return DTMIterator.FILTER_SKIP;
}
return DTMIterator.FILTER_ACCEPT;
}
catch (javax.xml.transform.TransformerException se)
{
throw new RuntimeException(se.getMessage());
}
|
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 java.lang.Object | clone()Get a cloned FilterExprWalker.
FilterExprWalker clone = (FilterExprWalker) super.clone();
// clone.m_expr = (Expression)((Expression)m_expr).clone();
if (null != m_exprObj)
clone.m_exprObj = (XNodeSet) m_exprObj.clone();
return clone;
|
public boolean | deepEquals(com.sun.org.apache.xpath.internal.Expression expr)
if (!super.deepEquals(expr))
return false;
FilterExprWalker walker = (FilterExprWalker)expr;
if(!m_expr.deepEquals(walker.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.
super.detach();
if (m_canDetachNodeset)
{
m_exprObj.detach();
}
m_exprObj = null;
|
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.
return m_exprObj.getAxis();
|
public com.sun.org.apache.xpath.internal.Expression | getInnerExpression()Get the inner contained expression of this filter.
return m_expr;
|
public int | getLastPos(com.sun.org.apache.xpath.internal.XPathContext xctxt)Get the index of the last node that can be itterated to.
return m_exprObj.getLength();
|
public int | getNextNode()Moves the TreeWalker to the next visible node in document
order relative to the current node, and returns the new node. If the
current node has no next node, or if the search for nextNode attempts
to step upward from the TreeWalker's root node, returns
null , and retains the current node.
if (null != m_exprObj)
{
int next = m_exprObj.nextNode();
return next;
}
else
return DTM.NULL;
|
public void | init(com.sun.org.apache.xpath.internal.compiler.Compiler compiler, int opPos, int stepType)Init a FilterExprWalker.
super.init(compiler, opPos, stepType);
// Smooth over an anomily in the opcode map...
switch (stepType)
{
case OpCodes.OP_FUNCTION :
case OpCodes.OP_EXTFUNCTION :
m_mustHardReset = true;
case OpCodes.OP_GROUP :
case OpCodes.OP_VARIABLE :
m_expr = compiler.compile(opPos);
m_expr.exprSetParent(this);
//if((OpCodes.OP_FUNCTION == stepType) && (m_expr instanceof com.sun.org.apache.xalan.internal.templates.FuncKey))
if(m_expr instanceof com.sun.org.apache.xpath.internal.operations.Variable)
{
// hack/temp workaround
m_canDetachNodeset = false;
}
break;
default :
m_expr = compiler.compile(opPos + 2);
m_expr.exprSetParent(this);
}
// if(m_expr instanceof WalkingIterator)
// {
// WalkingIterator wi = (WalkingIterator)m_expr;
// if(wi.getFirstWalker() instanceof FilterExprWalker)
// {
// FilterExprWalker fw = (FilterExprWalker)wi.getFirstWalker();
// if(null == fw.getNextWalker())
// {
// m_expr = fw.m_expr;
// m_expr.exprSetParent(this);
// }
// }
//
// }
|
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 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 root)Set the root node of the TreeWalker.
super.setRoot(root);
m_exprObj = FilterExprIteratorSimple.executeFilterExpr(root,
m_lpi.getXPathContext(), m_lpi.getPrefixResolver(),
m_lpi.getIsTopLevel(), m_lpi.m_stackFrame, m_expr);
|