org.apache.xpath.patterns

Class UnionPattern

Implemented Interfaces:
java.io.Serializable, ExpressionNode, SourceLocator, XPathVisitable

public class UnionPattern
extends Expression

This class represents a union pattern, which can have multiple individual StepPattern patterns.
See Also:
Serialized Form

Method Summary

void
callVisitors(ExpressionOwner owner, XPathVisitor visitor)
boolean
canTraverseOutsideSubtree()
Tell if this expression or it's subexpressions can traverse outside the current subtree.
boolean
deepEquals(Expression expr)
XObject
execute(XPathContext xctxt)
Test a node to see if it matches any of the patterns in the union.
void
fixupVariables(java.util.Vector vars, int globalsSize)
No arguments to process, so this does nothing.
StepPattern[]
getPatterns()
Get the contained step patterns to be tested.
void
setPatterns(StepPattern[] patterns)
Set the contained step patterns to be tested.

Methods inherited from class org.apache.xpath.Expression

asIterator, asIteratorRaw, asNode, assertion, bool, canTraverseOutsideSubtree, deepEquals, error, execute, execute, execute, execute, executeCharsToContentHandler, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, fixupVariables, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isNodesetExpr, isStableNumber, num, warn, xstr

Method Details

callVisitors

public void callVisitors(ExpressionOwner owner,
                         XPathVisitor visitor)
Specified by:
callVisitors in interface XPathVisitable

canTraverseOutsideSubtree

public boolean canTraverseOutsideSubtree()
Tell if this expression or it's subexpressions can traverse outside the current subtree.
Overrides:
canTraverseOutsideSubtree in interface Expression
Returns:
true if traversal outside the context node's subtree can occur.

deepEquals

public boolean deepEquals(Expression expr)
Overrides:
deepEquals in interface Expression

execute

public XObject execute(XPathContext xctxt)
            throws javax.xml.transform.TransformerException
Test a node to see if it matches any of the patterns in the union.
Overrides:
execute in interface Expression
Parameters:
xctxt - XPath runtime context.

fixupVariables

public void fixupVariables(java.util.Vector vars,
                           int globalsSize)
No arguments to process, so this does nothing.
Overrides:
fixupVariables in interface Expression

getPatterns

public StepPattern[] getPatterns()
Get the contained step patterns to be tested.
Returns:
an array of the contained step patterns to be tested.

setPatterns

public void setPatterns(StepPattern[] patterns)
Set the contained step patterns to be tested.
Parameters:
patterns - the contained step patterns to be tested.

Copyright B) 2005 Apache XML Project. All Rights Reserved.