public abstract class Expression extends Object implements IdentityComparable
Two expressions are considered equal if they return the same result when evaluated in the same context.
Expressions manage their own subexpressions but must observe certain conventions when doing so. Every expression must implement the methods operands() and getOperand(N) to access the operands of the expression; here N is an integer identifier for the subexpression which is unique among the subexpressions and whose allocation is a matter for each expression to determined. So a subexpression of an expression can change (during optimization rewrite, for example), then (a) the expression must implement the method setOperandExpression(N, expr) to effect the change, and (b) calling this method must cause a call on adoptChildExpression(N, expr) which is implemented in the expression class itself, and takes responsibility for maintaining the consistency of the tree, e.g. by invalidating cached information.
The default implementations of methods such as operands() work for expressions that have no subexpressions.
Modifier and Type | Field and Description |
---|---|
static int |
EFFECTIVE_BOOLEAN_VALUE |
static int |
EVALUATE_METHOD |
static int |
ITEM_FEED_METHOD |
static int |
ITERATE_METHOD |
static IntegerValue |
MAX_SEQUENCE_LENGTH |
static IntegerValue |
MAX_STRING_LENGTH |
static int |
PROCESS_METHOD |
protected int |
staticProperties |
static IntegerValue |
UNBOUNDED_LOWER |
static IntegerValue |
UNBOUNDED_UPPER |
static int |
UPDATE_METHOD |
static int |
WATCH_METHOD |
Constructor and Description |
---|
Expression() |
Modifier and Type | Method and Description |
---|---|
PathMap.PathMapNodeSet |
addToPathMap(PathMap pathMap,
PathMap.PathMapNodeSet pathMapNodeSet)
Add a representation of this expression to a PathMap.
|
void |
adoptChildExpression(Expression child)
Set up a parent-child relationship between this expression and a given child expression.
|
Iterable<Operand> |
checkedOperands()
Get the immediate sub-expressions of this expression, verifying that the parent pointers
in the child expressions are correct.
|
void |
checkForUpdatingSubexpressions()
Check to ensure that this expression does not contain any inappropriate updating subexpressions.
|
void |
checkPermittedContents(SchemaType parentType,
boolean whole)
Check that any elements and attributes constructed or returned by this expression are acceptable
in the content model of a given complex type.
|
void |
clearStreamabilityData() |
protected abstract int |
computeCardinality()
Compute the static cardinality of this expression
|
int |
computeDependencies()
Compute the dependencies of an expression, as the union of the
dependencies of its subexpressions.
|
protected int |
computeSpecialProperties()
Compute the special properties of this expression.
|
void |
computeStaticProperties()
Compute the static properties.
|
abstract Expression |
copy()
Copy an expression.
|
Expression |
doPromotion(Expression subexpression,
PromotionOffer offer)
Promote a subexpression if possible, and if the expression was changed, carry out housekeeping
to reset the static properties and correct the parent pointers in the tree
|
protected void |
dynamicError(String message,
String code,
XPathContext context)
Method used in subclasses to signal a dynamic error
|
boolean |
effectiveBooleanValue(XPathContext context)
Get the effective boolean value of the expression.
|
CharSequence |
evaluateAsString(XPathContext context)
Evaluate an expression as a String.
|
Item |
evaluateItem(XPathContext context)
Evaluate an expression as a single item.
|
void |
evaluatePendingUpdates(XPathContext context,
PendingUpdateList pul)
Evaluate an updating expression, adding the results to a Pending Update List.
|
void |
explain(Logger out)
Diagnostic print of expression structure.
|
abstract void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
int |
getCardinality()
Determine the static cardinality of the expression.
|
Configuration |
getConfiguration()
Get the configuration containing this expression
|
int |
getConstructType()
Get the type of this expression for use in tracing and diagnostics
|
int |
getCost()
Return the estimated cost of evaluating an expression.
|
int |
getDependencies()
Determine which aspects of the context the expression depends on.
|
int |
getEvaluationMethod() |
ExpressionCompiler |
getExpressionCompiler()
Return the compiler relating to a particular expression
|
String |
getExpressionName()
Get a name identifying the kind of expression, in terms meaningful to a user.
|
int |
getHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container
|
abstract int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
IntegerValue[] |
getIntegerBounds()
For an expression that returns an integer or a sequence of integers, get
a lower and upper bound on the values of the integers that may be returned, from
static analysis.
|
int |
getIntrinsicDependencies()
Determine the intrinsic dependencies of an expression, that is, those which are not derived
from the dependencies of its subexpressions.
|
abstract ItemType |
getItemType()
Determine the data type of the expression, if possible.
|
Location |
getLocation()
Get the location of the expression
|
protected int |
getNetCost()
Return the net cost of evaluating this expression, excluding the cost of evaluating
its operands.
|
StructuredQName |
getObjectName() |
PackageData |
getPackageData()
Get information about the containing package
|
Expression |
getParentExpression()
Get the parent expression of this expression in the expression tree.
|
Posture |
getPosture() |
PostureAndSweep |
getPostureAndSweepIfKnown()
Get the posture and sweep of the expression if these have already been computed
|
Iterator<String> |
getProperties()
Get an iterator over all the properties available.
|
Object |
getProperty(String name) |
RetainedStaticContext |
getRetainedStaticContext()
Get the retained static context of the expression
|
int[] |
getSlotsUsed()
Get the local variables (identified by their slot numbers) on which this expression depends.
|
int |
getSpecialProperties()
Get the static properties of this expression (other than its type).
|
URI |
getStaticBaseURI()
Get the saved static base URI as a URI
|
String |
getStaticBaseURIString()
Get the saved static base URI as a string
|
PostureAndSweep |
getStreamability(boolean allowExtensions,
ContextItemStaticInfo contextInfo,
List<String> reasons)
Get the posture and sweep of this expression as defined in the W3C streamability specifications.
|
protected StreamingAdjunct |
getStreamingAdjunct()
Get an object that supports streamed evaluation of this expression
|
Sweep |
getSweep() |
String |
getSystemId() |
boolean |
hasVariableBinding(Binding binding)
Ask whether this expression is, or contains, the binding of a given variable
|
int |
identityHashCode()
Get a hashCode that offers the guarantee that if A.isIdentical(B), then A.identityHashCode() == B.identityHashCode()
|
boolean |
implementsStaticTypeCheck()
Determine whether this expression implements its own method for static type checking
|
boolean |
isCallOn(Class<? extends SystemFunction> function)
Ask whether this expression is a call on a particular function
|
boolean |
isCallOnSystemFunction(String localName) |
boolean |
isIdentical(IdentityComparable other)
Determine whether two IdentityComparable objects are identical.
|
boolean |
isSubtreeExpression()
Determine whether the expression can be evaluated without reference to the part of the context
document outside the subtree rooted at the context node.
|
boolean |
isUpdatingExpression()
Determine whether this is an updating expression as defined in the XQuery update specification
|
boolean |
isVacuousExpression()
Determine whether this is a vacuous expression as defined in the XQuery update specification
|
SequenceIterator |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence.
|
EventIterator |
iterateEvents(XPathContext context)
Deliver the result of the expression as a sequence of events.
|
static StreamingAdjunct |
makeStreamingAdjunct(Configuration config,
Expression exp)
Make a streaming adjunct for a particular expression.
|
int |
markTailFunctionCalls(StructuredQName qName,
int arity)
Mark tail-recursive calls on stylesheet functions.
|
protected List<Operand> |
operandList(Operand... a)
Helper method for subclasses to build a list of operands
|
Iterable<Operand> |
operands()
Get the immediate sub-expressions of this expression, with information about the relationship
of each expression to its parent expression.
|
protected List<Operand> |
operandSparseList(Operand... a)
Helper method for subclasses to build a list of operands
|
Expression |
optimize(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Perform optimisation of an expression and its subexpressions.
|
protected void |
optimizeChildren(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Perform optimization of the children of this expression (and their children, recursively)
This method is provided as a helper for implementations of the
optimize(net.sf.saxon.expr.parser.ExpressionVisitor, net.sf.saxon.expr.parser.ContextItemStaticInfo)
method, since optimizing the children is an inevitable part of optimizing the expression itself |
Expression |
optimizeForType(ExpressionVisitor visitor,
ContextItemStaticInfo contextItemType) |
void |
process(XPathContext context)
Process the instruction, without returning any tail calls
|
Expression |
promote(PromotionOffer offer)
Offer promotion for this subexpression.
|
protected void |
promoteChildren(PromotionOffer offer)
Helper method for implementations of
promote(net.sf.saxon.expr.parser.PromotionOffer)
to apply the requested promotion to all subexpressions |
void |
resetLocalStaticProperties()
Reset the static properties of the expression to -1, so that they have to be recomputed
next time they are used.
|
void |
restoreParentPointers()
Restore parent pointers for the subtree rooted at this expression
|
void |
setEvaluationMethod(int method) |
void |
setFiltered(boolean filtered)
Mark an expression as filtered: that is, it appears as the base expression in a filter expression.
|
void |
setFlattened(boolean flattened)
Mark an expression as being "flattened".
|
void |
setLocation(Location id)
Set the location on an expression.
|
void |
setParentExpression(Expression parent)
Set the parent expression of this expression in the expression tree.
|
void |
setPostureAndSweep(PostureAndSweep ps) |
void |
setRetainedStaticContext(RetainedStaticContext rsc)
Set the retained static context
|
void |
setRetainedStaticContextLocally(RetainedStaticContext rsc)
Set the parts of the static context that might be needed by the function, without
passing them on to subexpressions.
|
void |
setStaticProperty(int prop)
Set a static property on an expression.
|
Expression |
simplify()
Simplify an expression.
|
protected void |
simplifyChildren()
Simplify an expression.
|
Expression |
staticTypeCheck(SequenceType req,
boolean backwardsCompatible,
RoleDiagnostic role,
ExpressionVisitor visitor)
Static type checking of some expressions is delegated to the expression itself, by calling
this method.
|
void |
suppressValidation(int parentValidationMode)
Suppress validation on contained element constructors, on the grounds that the parent element
is already performing validation.
|
Pattern |
toPattern(Configuration config,
boolean is30)
Convert this expression to an equivalent XSLT pattern
|
String |
toShortString()
Produce a short string identifying the expression for use in error messages
|
Pattern |
toStreamingPattern(Configuration config)
Convert this expression to a streaming pattern (a pattern used internally to match nodes during
push processing of an event stream)
|
String |
toString()
The toString() method for an expression attempts to give a representation of the expression
in an XPath-like form.
|
Expression |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Perform type checking of an expression and its subexpressions.
|
protected void |
typeCheckChildren(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Perform type checking of the children of this expression (and their children, recursively)
This method is provided as a helper for implementations of the
typeCheck(net.sf.saxon.expr.parser.ExpressionVisitor, net.sf.saxon.expr.parser.ContextItemStaticInfo)
method, since checking the children is an inevitable part of checking the expression itse.f |
protected void |
typeError(String message,
String errorCode,
XPathContext context)
Method used in subclasses to signal a runtime type error
|
Expression |
unordered(boolean retainAllNodes,
boolean forStreaming)
Replace this expression by a simpler expression that delivers the results without regard
to order.
|
public static final int EVALUATE_METHOD
public static final int ITERATE_METHOD
public static final int PROCESS_METHOD
public static final int WATCH_METHOD
public static final int ITEM_FEED_METHOD
public static final int EFFECTIVE_BOOLEAN_VALUE
public static final int UPDATE_METHOD
protected int staticProperties
public static final IntegerValue UNBOUNDED_LOWER
public static final IntegerValue UNBOUNDED_UPPER
public static final IntegerValue MAX_STRING_LENGTH
public static final IntegerValue MAX_SEQUENCE_LENGTH
public String getExpressionName()
public Iterable<Operand> operands()
If the expression is a Callable, then it is required that the order of the operands returned by this function is the same as the order of arguments supplied to the corresponding call() method.
public final Iterable<Operand> checkedOperands()
operands()
method,
but with additional checkingprotected List<Operand> operandList(Operand... a)
a
- the sequence of operands (which must all be non-null)protected List<Operand> operandSparseList(Operand... a)
a
- the sequence of operands; any null values in the list are ignoredpublic Expression getParentExpression()
public String getSystemId()
public void setParentExpression(Expression parent)
parent
- the parent expressionpublic void restoreParentPointers()
public abstract int getImplementationMethod()
ITERATE_METHOD
or EVALUATE_METHOD
or
PROCESS_METHOD
public boolean implementsStaticTypeCheck()
public boolean hasVariableBinding(Binding binding)
binding
- the variable bindingpublic Expression simplify() throws XPathException
XPathException
- if an error is discovered during expression
rewritingprotected final void simplifyChildren() throws XPathException
XPathException
- if an error is discovered during expression
rewritingpublic void setRetainedStaticContext(RetainedStaticContext rsc)
rsc
- the static context to be retainedpublic void setRetainedStaticContextLocally(RetainedStaticContext rsc)
public final RetainedStaticContext getRetainedStaticContext()
public String getStaticBaseURIString()
public URI getStaticBaseURI() throws XPathException
XPathException
public boolean isCallOn(Class<? extends SystemFunction> function)
function
- the implementation class of the function in questionpublic boolean isCallOnSystemFunction(String localName)
public Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) 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 may not be accurately known if they have not been explicitly declared.
visitor
- an expression visitorcontextInfo
- Information available statically about the context item: whether it is (possibly)
absent; its static type; its streaming posture.XPathException
- if an error is discovered during this phase
(typically a type error)protected final void typeCheckChildren(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
typeCheck(net.sf.saxon.expr.parser.ExpressionVisitor, net.sf.saxon.expr.parser.ContextItemStaticInfo)
method, since checking the children is an inevitable part of checking the expression itse.fvisitor
- an expression visitorcontextInfo
- Information available statically about the context item: whether it is (possibly)
absent; its static type; its streaming posture.XPathException
- if an error is discovered during this phase
(typically a type error)public Expression staticTypeCheck(SequenceType req, boolean backwardsCompatible, RoleDiagnostic role, ExpressionVisitor visitor) throws XPathException
req
- the required typebackwardsCompatible
- true if backwards compatibility mode appliesrole
- the role of the expression in relation to the required typevisitor
- an expression visitorXPathException
- if failures occur, for example if the static type of one branch of the conditional
is incompatible with the required typepublic Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
This 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.
visitor
- an expression visitorcontextInfo
- 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)protected final void optimizeChildren(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
optimize(net.sf.saxon.expr.parser.ExpressionVisitor, net.sf.saxon.expr.parser.ContextItemStaticInfo)
method, since optimizing the children is an inevitable part of optimizing the expression itselfvisitor
- an expression visitorcontextInfo
- Information available statically about the context item: whether it is (possibly)
absent; its static type; its streaming posture.XPathException
- if an error is discovered during this phase
(typically a type error)public int getCost()
protected int getNetCost()
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 expressionXPathException
- if any error is detectedprotected void promoteChildren(PromotionOffer offer) throws XPathException
promote(net.sf.saxon.expr.parser.PromotionOffer)
to apply the requested promotion to all subexpressionsoffer
- the promotion offerXPathException
- if any failure occurspublic final Expression doPromotion(Expression subexpression, PromotionOffer offer) throws XPathException
subexpression
- the subexpression that is a candidate for promotionoffer
- details of the promotion being considered @return the result of the promotion. This will be the current expression if no promotion
actions have taken placeXPathException
- if an error occurspublic Expression unordered(boolean retainAllNodes, boolean forStreaming) throws XPathException
retainAllNodes
- set to true if the result must contain exactly the same nodes as the
original; set to false if the result can eliminate (or introduce) duplicates.forStreaming
- set to true if the result is to be optimized for streamingXPathException
- if the rewrite failspublic final int getSpecialProperties()
public int getCardinality()
public abstract 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 IntegerValue[] getIntegerBounds()
public void setFlattened(boolean flattened)
flattened
- set to true if the result of the expression is atomized or otherwise turned into
an atomic valuepublic void setFiltered(boolean filtered)
filtered
- if true, marks this expression as the base of a filter expressionpublic Item evaluateItem(XPathContext context) throws XPathException
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionpublic SequenceIterator iterate(XPathContext context) throws XPathException
context
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionpublic EventIterator iterateEvents(XPathContext context) throws XPathException
The events (of class PullEvent
) are either complete
items, or one of startElement, endElement, startDocument, or endDocument, known
as semi-nodes. The stream of events may also include a nested EventIterator.
If a start-end pair exists in the sequence, then the events between
this pair represent the content of the document or element. The content sequence will
have been processed to the extent that any attribute and namespace nodes in the
content sequence will have been merged into the startElement event. Namespace fixup
will have been performed: that is, unique prefixes will have been allocated to element
and attribute nodes, and all namespaces will be declared by means of a namespace node
in the startElement event or in an outer startElement forming part of the sequence.
However, duplicate namespaces may appear in the sequence.
The content of an element or document may include adjacent or zero-length text nodes, atomic values, and nodes represented as nodes rather than broken down into events.
context
- The dynamic evaluation contextXPathException
- if a dynamic error occurs during expression evaluationpublic boolean effectiveBooleanValue(XPathContext context) throws XPathException
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionpublic CharSequence evaluateAsString(XPathContext context) throws XPathException
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionClassCastException
- if the result type of the
expression is not xs:string?, xs:untypedAtomic?, or xs:anyURI?public void process(XPathContext context) throws XPathException
context
- The dynamic context, giving access to the current node,
the current variables, etc.XPathException
- if a dynamic error occurspublic void evaluatePendingUpdates(XPathContext context, PendingUpdateList pul) throws XPathException
context
- the XPath dynamic evaluation contextpul
- the pending update list to which the results should be writtenXPathException
- if evaluation failsUnsupportedOperationException
- if the expression is not an updating expressionpublic String toString()
The toString() method for an expression attempts to give a representation of the expression in an XPath-like form.
For subclasses of Expression that represent XPath expressions, the result should always be a string that parses as an XPath 3.0 expression. The expression produced should be equivalent to the original making certain assumptions about the static context. In general the expansion will make no assumptions about namespace bindings, except that (a) the prefix "xs" is used to refer to the XML Schema namespace, and (b) the default function namespace is assumed to be the "fn" namespace.
In the case of XSLT instructions and XQuery expressions, the toString() method gives an abstracted view of the syntax that is not designed in general to be parseable.
public String toShortString()
public abstract void export(ExpressionPresenter out)
out
- the expression presenter used to display the structurepublic final void explain(Logger out)
out
- the expression presenter used to display the structurepublic void checkPermittedContents(SchemaType parentType, boolean whole) throws XPathException
parentType
- the "given complex type": the method is checking that the nodes returned by this
expression are acceptable members of the content model of this typewhole
- if true, we want to check that the value of this expression satisfies the content model
as a whole; if false we want to check that the value of the expression is acceptable as one part
of the contentXPathException
- if the value delivered by this expression cannot be part of the content model
of the given typepublic void adoptChildExpression(Expression child)
child
- the child expressionpublic void setLocation(Location id)
id
- the locationpublic final Location getLocation()
public Configuration getConfiguration()
public PackageData getPackageData()
public final void computeStaticProperties()
public void resetLocalStaticProperties()
protected abstract int computeCardinality()
StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
protected int computeSpecialProperties()
StaticProperty
. The "special" properties are properties
other than cardinality and dependencies, and most of them relate to properties of node sequences, for
example whether the nodes are in document order.public int computeDependencies()
public int getIntrinsicDependencies()
public void setStaticProperty(int prop)
prop
- the property to be setpublic void checkForUpdatingSubexpressions() throws XPathException
XPathException
- if the expression has a non-permitted updating subexpressionpublic boolean isUpdatingExpression()
public boolean isVacuousExpression()
public abstract Expression copy()
public void suppressValidation(int parentValidationMode)
parentValidationMode
- the kind of validation being performed on the parent expressionpublic int markTailFunctionCalls(StructuredQName qName, int arity)
qName
- the name of the functionarity
- the arity (number of parameters) of the functionUserFunctionCall.NOT_TAIL_CALL
if no tail call was found;
UserFunctionCall.FOREIGN_TAIL_CALL
if a tail call on a different function was found;public Pattern toPattern(Configuration config, boolean is30) throws XPathException
config
- the Saxon configurationis30
- true if this is XSLT 3.0XPathException
- if conversion is not possiblepublic Pattern toStreamingPattern(Configuration config)
config
- the Saxon configurationpublic final int[] getSlotsUsed()
protected void dynamicError(String message, String code, XPathContext context) throws XPathException
message
- the error messagecode
- the error codecontext
- the XPath dynamic contextXPathException
- always thrown, to signal a dynamic errorprotected void typeError(String message, String errorCode, XPathContext context) throws XPathException
message
- the error messageerrorCode
- the error codecontext
- the XPath dynamic contextXPathException
- always thrown, to signal a dynamic errorpublic int getConstructType()
LocationKind
public StructuredQName getObjectName()
public Iterator<String> getProperties()
public int getHostLanguage()
Configuration.XSLT
or Configuration.XQUERY
public PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
The default implementation of this method assumes that an expression does no navigation other than the navigation done by evaluating its subexpressions, and that the subexpressions are evaluated in the same context as the containing expression. The method must be overridden for any expression where these assumptions do not hold. For example, implementations exist for AxisExpression, ParentExpression, and RootExpression (because they perform navigation), and for the doc(), document(), and collection() functions because they create a new navigation root. Implementations also exist for PathExpression and FilterExpression because they have subexpressions that are evaluated in a different context from the calling expression.
pathMap
- the PathMap to which the expression should be addedpathMapNodeSet
- the PathMapNodeSet to which the paths embodied in this expression should be addedpublic boolean isSubtreeExpression()
public void setEvaluationMethod(int method)
public int getEvaluationMethod()
public boolean isIdentical(IdentityComparable other)
isIdentical
in interface IdentityComparable
other
- the value to be compared withpublic int identityHashCode()
identityHashCode
in interface IdentityComparable
public ExpressionCompiler getExpressionCompiler() throws CannotCompileException
CannotCompileException
- if it is not possible to generate bytecode for this expressionpublic static StreamingAdjunct makeStreamingAdjunct(Configuration config, Expression exp)
config
- the Saxon Configurationexp
- the expression to be compiledprotected StreamingAdjunct getStreamingAdjunct()
public final PostureAndSweep getStreamability(boolean allowExtensions, ContextItemStaticInfo contextInfo, List<String> reasons)
allowExtensions
- if false, the definition of "guaranteed streamability" in the
W3C specification is used. If true, Saxon extensions are permitted, which make somecontextInfo
- Information about the context item type and posturereasons
- the caller may supply a list, in which case the implementation may add to this
list a message explaining why the construct is not streamable, suitable for inclusion in anpublic Posture getPosture()
public Sweep getSweep()
public PostureAndSweep getPostureAndSweepIfKnown()
public void clearStreamabilityData()
public void setPostureAndSweep(PostureAndSweep ps)
public Expression optimizeForType(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException
XPathException
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.