| java.lang.Object org.apache.xpath.XPath
XPath | public class XPath implements Serializable,ExpressionOwner(Code) | | The XPath class wraps an expression object and provides general services
for execution of that expression.
|
Field Summary | |
final public static int | MATCH Represents a match type expression. | final public static double | MATCH_SCORE_NODETEST The match score if the pattern consists of just a NodeTest. | final public static double | MATCH_SCORE_NONE The match score if no match is made. | final public static double | MATCH_SCORE_NSWILD The match score if the pattern pattern has the form NCName:*. | final public static double | MATCH_SCORE_OTHER The match score if the pattern consists of something
other than just a NodeTest or just a qname. | final public static double | MATCH_SCORE_QNAME The match score if the pattern has the form
of a QName optionally preceded by an @ character. | final public static int | SELECT Represents a select type expression. | String | m_patternString The pattern string, mainly kept around for diagnostic purposes. | final static long | serialVersionUID |
Constructor Summary | |
public | XPath(String exprString, SourceLocator locator, PrefixResolver prefixResolver, int type, ErrorListener errorListener) Construct an XPath object. | public | XPath(String exprString, SourceLocator locator, PrefixResolver prefixResolver, int type, ErrorListener errorListener, FunctionTable aTable) Construct an XPath object. | public | XPath(String exprString, SourceLocator locator, PrefixResolver prefixResolver, int type) Construct an XPath object. | public | XPath(Expression expr) Construct an XPath object. |
Method Summary | |
public void | assertion(boolean b, String msg) Tell the user of an assertion error, and probably throw an
exception. | public boolean | bool(XPathContext xctxt, int contextNode, PrefixResolver namespaceContext) Given an expression and a context, evaluate the XPath
and return the result. | public void | callVisitors(ExpressionOwner owner, XPathVisitor visitor) This will traverse the heararchy, calling the visitor for
each member. | public void | error(XPathContext xctxt, int sourceNode, String msg, Object[] args) Tell the user of an error, and probably throw an
exception. | public XObject | execute(XPathContext xctxt, org.w3c.dom.Node contextNode, PrefixResolver namespaceContext) Given an expression and a context, evaluate the XPath
and return the result.
Parameters: xctxt - The execution context. Parameters: contextNode - The node that "." expresses. Parameters: namespaceContext - The context in which namespaces in theXPath are supposed to be expanded. | public XObject | execute(XPathContext xctxt, int contextNode, PrefixResolver namespaceContext) Given an expression and a context, evaluate the XPath
and return the 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.
Parameters: vars - List of QNames that correspond to variables. | public Expression | getExpression() Get the raw Expression object that this class wraps. | public SourceLocator | getLocator() Get the SourceLocator on the expression object. | public double | getMatchScore(XPathContext xctxt, int context) Get the match score of the given node.
Parameters: xctxt - XPath runtime context. Parameters: context - The current source tree context node. | public String | getPatternString() Return the XPath string associated with this object. | public void | setExpression(Expression exp) Set the raw expression object for this object. | public void | warn(XPathContext xctxt, int sourceNode, String msg, Object[] args) Warn the user of an problem. |
MATCH | final public static int MATCH(Code) | | Represents a match type expression.
|
MATCH_SCORE_NODETEST | final public static double MATCH_SCORE_NODETEST(Code) | | The match score if the pattern consists of just a NodeTest.
|
MATCH_SCORE_NONE | final public static double MATCH_SCORE_NONE(Code) | | The match score if no match is made.
|
MATCH_SCORE_NSWILD | final public static double MATCH_SCORE_NSWILD(Code) | | The match score if the pattern pattern has the form NCName:*.
|
MATCH_SCORE_OTHER | final public static double MATCH_SCORE_OTHER(Code) | | The match score if the pattern consists of something
other than just a NodeTest or just a qname.
|
MATCH_SCORE_QNAME | final public static double MATCH_SCORE_QNAME(Code) | | The match score if the pattern has the form
of a QName optionally preceded by an @ character.
|
SELECT | final public static int SELECT(Code) | | Represents a select type expression.
|
m_patternString | String m_patternString(Code) | | The pattern string, mainly kept around for diagnostic purposes.
|
serialVersionUID | final static long serialVersionUID(Code) | | |
assertion | public void assertion(boolean b, String msg)(Code) | | Tell the user of an assertion error, and probably throw an
exception.
Parameters: b - If false, a runtime exception will be thrown. Parameters: msg - The assertion message, which should be informative. throws: RuntimeException - if the b argument is false. |
callVisitors | public void callVisitors(ExpressionOwner owner, XPathVisitor visitor)(Code) | | This will traverse the heararchy, calling the visitor for
each member. If the called visitor method returns
false, the subtree should not be called.
Parameters: owner - The owner of the visitor, where that path may be rewritten if needed. Parameters: visitor - The visitor whose appropriate method will be called. |
fixupVariables | public void fixupVariables(java.util.Vector vars, int globalsSize)(Code) | | This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
Parameters: vars - List of QNames that correspond to variables. This list should be searched backwards for the first qualified name that corresponds to the variable reference qname. The position of the QName in the vector from the start of the vector will be its position in the stack frame (but variables above the globalsTop value will need to be offset to the current stack frame). |
getExpression | public Expression getExpression()(Code) | | Get the raw Expression object that this class wraps.
the raw Expression object, which should not normally be null. |
getLocator | public SourceLocator getLocator()(Code) | | Get the SourceLocator on the expression object.
the SourceLocator on the expression object, which may be null. |
getPatternString | public String getPatternString()(Code) | | Return the XPath string associated with this object.
the XPath string associated with this object. |
setExpression | public void setExpression(Expression exp)(Code) | | Set the raw expression object for this object.
Parameters: exp - the raw Expression object, which should not normally be null. |
|
|