|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectnet.sf.saxon.expr.Expression
net.sf.saxon.expr.SimpleMappingExpression
public final class SimpleMappingExpression
A simple mapping expression is an expression A/B where B has a static type that is an atomic type. For example, * / name().
| Field Summary |
|---|
| Fields inherited from class net.sf.saxon.expr.Expression |
|---|
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
| Constructor Summary | |
|---|---|
SimpleMappingExpression(Expression start,
Expression step,
boolean isHybrid)
Constructor |
|
| Method Summary | |
|---|---|
int |
computeCardinality()
Determine the static cardinality of the expression |
int |
computeDependencies()
Determine which aspects of the context the expression depends on. |
int |
computeSpecialProperties()
Get the static properties of this expression (other than its type). |
Expression |
copy()
Copy an expression. |
boolean |
equals(Object other)
Is this expression the same as another expression? |
void |
explain(ExpressionPresenter destination)
Diagnostic print of expression structure. |
ItemType |
getItemType(TypeHierarchy th)
Determine the data type of the items returned by this exprssion |
Expression |
getStartExpression()
Get the start expression (the left-hand operand) |
Expression |
getStepExpression()
Get the step expression (the right-hand operand) |
int |
hashCode()
get HashCode for comparing two expressions |
boolean |
hasLoopingSubexpression(Expression child)
Given an expression that is an immediate child of this expression, test whether the evaluation of the parent expression causes the child expression to be evaluated repeatedly |
boolean |
isHybrid()
Determine whether this expression is capable (as far as static analysis is concerned) of returning a mixture of nodes and atomic values. |
SequenceIterator |
iterate(XPathContext context)
Iterate the path-expression in a given context |
Iterator |
iterateSubExpressions()
Get the immediate subexpressions of this expression |
SequenceIterator |
map(XPathContext context)
Mapping function, from a node returned by the start iteration, to a sequence returned by the child. |
Expression |
optimize(ExpressionVisitor visitor,
ItemType contextItemType)
Perform optimisation of an expression and its subexpressions. |
Expression |
promote(PromotionOffer offer)
Promote this expression if possible |
boolean |
replaceSubExpression(Expression original,
Expression replacement)
Replace one subexpression by a replacement subexpression |
Expression |
typeCheck(ExpressionVisitor visitor,
ItemType contextItemType)
Type-check the expression |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleMappingExpression(Expression start,
Expression step,
boolean isHybrid)
start - A node-set expression denoting the absolute or relative set of nodes from which the
navigation path should start.step - The step to be followed from each node in the start expression to yield a new
node-setisHybrid - if true, indicates that we don't know statically whether the step expression will
return nodes or atomic values. If false, we know it will return atomic values.| Method Detail |
|---|
public Expression getStartExpression()
public Expression getStepExpression()
public boolean isHybrid()
public final ItemType getItemType(TypeHierarchy th)
getItemType in class Expressionth - the type hierarchy cache
public Expression typeCheck(ExpressionVisitor visitor,
ItemType contextItemType)
typeCheck in class Expressionvisitor - an expression visitorcontextItemType - the static type of "." at the point where this expression is invoked.
The parameter is set to null if it is known statically that the context item will be undefined.
If the type of the context item is not known statically, the argument is set to
Type.ITEM_TYPE
public Expression optimize(ExpressionVisitor visitor,
ItemType contextItemType)
throws XPathException
ExpressionThis method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.
optimize in class Expressionvisitor - an expression visitorcontextItemType - the static type of "." at the point where this expression is invoked.
The parameter is set to null if it is known statically that the context item will be undefined.
If the type of the context item is not known statically, the argument is set to
Type.ITEM_TYPE
XPathException - if an error is discovered during this phase
(typically a type error)
public Expression promote(PromotionOffer offer)
throws XPathException
promote in class Expressionoffer - 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 Iterator iterateSubExpressions()
iterateSubExpressions in class Expressionpublic boolean hasLoopingSubexpression(Expression child)
hasLoopingSubexpression in class Expressionchild - the immediate subexpression
public boolean replaceSubExpression(Expression original,
Expression replacement)
replaceSubExpression in class Expressionoriginal - the original subexpressionreplacement - the replacement subexpression
public int computeDependencies()
computeDependencies in class Expressionpublic Expression copy()
copy in class Expressionpublic int computeSpecialProperties()
public int computeCardinality()
StaticProperty.ALLOWS_ZERO_OR_ONE,
StaticProperty.EXACTLY_ONE, StaticProperty.ALLOWS_ONE_OR_MORE,
StaticProperty.ALLOWS_ZERO_OR_MOREpublic boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Object
public SequenceIterator iterate(XPathContext context)
throws XPathException
iterate in interface SequenceIterableiterate in class Expressioncontext - the evaluation context
XPathException - if any dynamic error occurs evaluating the
expression
public SequenceIterator map(XPathContext context)
throws XPathException
map in interface ContextMappingFunctioncontext - The processing context. The item to be mapped is the context item identified
from this context: the values of position() and last() also relate to the set of items being mapped
XPathExceptionpublic void explain(ExpressionPresenter destination)
explain in class Expressiondestination - the expression presenter used to display the structure
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||