|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface supported by an XPath expression. This includes both compile-time and run-time methods.
Method Summary | |
Expression |
analyze(StaticContext env)
Perform static analysis of an expression and its subexpressions. |
void |
display(int level,
NamePool pool)
Diagnostic print of expression structure. |
boolean |
effectiveBooleanValue(XPathContext context)
Get the effective boolean value of the expression. |
String |
evaluateAsString(XPathContext context)
Evaluate an expression as a String. |
Item |
evaluateItem(XPathContext context)
Evaluate an expression as a single item. |
int |
getCardinality()
Determine the static cardinality of the expression. |
int |
getDependencies()
Determine which aspects of the context the expression depends on. |
ItemType |
getItemType()
Determine the data type of the expression, if possible. |
int |
getSpecialProperties()
Get the static properties of this expression (other than its type). |
Expression[] |
getSubExpressions()
Get the immediate sub-expressions of this expression. |
SequenceIterator |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence. |
Expression |
promote(PromotionOffer offer)
Offer promotion for this subexpression. |
Expression |
simplify()
Simplify an expression. |
Method Detail |
public Expression simplify() throws XPathException
XPathException
- if an error is discovered during expression
rewritingpublic Expression analyze(StaticContext env) throws XPathException
This checks statically that the operands of the expression have the correct type; if necessary it generates code to do run-time type checking or type conversion. A static type error is reported only if execution cannot possibly succeed, that is, if a run-time type error is inevitable. The call may return a modified form of the expression.
This method is called after all references to functions and variables have been resolved to the declaration of the function or variable. However, the types of such functions and variables will only be accurately known if they have been explicitly declared.
env
- the static context of the expression
XPathException
- if an error is discovered during this phase
(typically a type error)public Expression promote(PromotionOffer offer) throws XPathException
offer
- details of the offer, for example the offer to move
expressions that don't depend on the context to an outer level in
the containing expression
XPathException
- if any error is detectedpublic int getSpecialProperties()
public int getCardinality()
Determine the static cardinality of the expression. This establishes how many items there will be in the result of the expression, at compile time (i.e., without actually evaluating the result.
This method should always return a result, though it may be the best approximation that is available at the time.
public ItemType getItemType()
This method should always return a result, though it may be the best approximation that is available at the time.
public int getDependencies()
public Expression[] getSubExpressions()
public Item evaluateItem(XPathContext context) throws XPathException
context
- The context in which the expression is to be evaluated
XPathException
- if any dynamic error occurs evaluating the
expressionpublic SequenceIterator iterate(XPathContext context) throws XPathException
context
- supplies the context for evaluation
XPathException
- if any dynamic error occurs evaluating the
expressionpublic boolean effectiveBooleanValue(XPathContext context) throws XPathException
context
- The context in which the expression is to be evaluated
XPathException
- if any dynamic error occurs evaluating the
expressionpublic String evaluateAsString(XPathContext context) throws XPathException
context
- The context in which the expression is to be evaluated
XPathException
- if any dynamic error occurs evaluating the
expression
ClassCastException
- if the result type of the
expression is not xs:string?public void display(int level, NamePool pool)
level
- indentation level for this expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |