Package net.sf.saxon.expr.accum
Class AccumulatorRule
java.lang.Object
net.sf.saxon.expr.accum.AccumulatorRule
- All Implemented Interfaces:
Locatable,Traceable,TraceableComponent,RuleTarget
This class represents one of the rules making up the definition of an accumulator
-
Constructor Summary
ConstructorsConstructorDescriptionAccumulatorRule(Expression newValueExpression, SlotManager stackFrameMap, boolean postDescent) Create a rule -
Method Summary
Modifier and TypeMethodDescriptionvoidOutput diagnostic explanation to an ExpressionPresentervoidgatherProperties(BiConsumer<String, Object> consumer) Get the properties of this object to be included in trace messages, by supplying the property values to a supplied consumer functiongetBody()Get the expression at the root of the expression tree used to evaluate this constructGet the location of the constructGet a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc.Get a string to identify the type of componentbooleanbooleanvoidregisterRule(Rule rule) Register a rule for which this is the targetvoidvoidsetBody(Expression expression) Set the expression to be used to evaluate this constructvoidsetCapturing(boolean capturing) voidsetLocation(Location loc)
-
Constructor Details
-
AccumulatorRule
public AccumulatorRule(Expression newValueExpression, SlotManager stackFrameMap, boolean postDescent) Create a rule- Parameters:
newValueExpression- the expression that computes a new value of the accumulator functionstackFrameMap- the stack frame used to evaluate this expressionpostDescent- true if this is a post-descent rule, false for a pre-descent rule
-
-
Method Details
-
getNewValueExpression
-
export
Description copied from interface:RuleTargetOutput diagnostic explanation to an ExpressionPresenter- Specified by:
exportin interfaceRuleTarget- Parameters:
out- the destination for the explanation- Throws:
XPathException- if output fails
-
getStackFrameMap
-
registerRule
Register a rule for which this is the target- Specified by:
registerRulein interfaceRuleTarget- Parameters:
rule- a rule in which this is the target
-
setCapturing
public void setCapturing(boolean capturing) -
isCapturing
public boolean isCapturing() -
isPostDescent
public boolean isPostDescent() -
getBody
Description copied from interface:TraceableComponentGet the expression at the root of the expression tree used to evaluate this construct- Specified by:
getBodyin interfaceTraceableComponent- Returns:
- the root expression
-
setLocation
-
getLocation
Description copied from interface:LocatableGet the location of the construct- Specified by:
getLocationin interfaceLocatable- Returns:
- the location. If no location information is available, the method should return
Loc.NONErather than returning null. However, callers would be well advised to check for the result being null.
-
getObjectName
Description copied from interface:TraceableGet a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. This is used only where the name is known statically.- Specified by:
getObjectNamein interfaceTraceable- Returns:
- the QName of the object declared or manipulated by this instruction or expression
-
setBody
Description copied from interface:TraceableComponentSet the expression to be used to evaluate this construct- Specified by:
setBodyin interfaceTraceableComponent- Parameters:
expression- the evaluation expression
-
getTracingTag
Description copied from interface:TraceableComponentGet a string to identify the type of component- Specified by:
getTracingTagin interfaceTraceableComponent- Returns:
- an identifying string
-
setAccumulatorName
-
gatherProperties
Description copied from interface:TraceableGet the properties of this object to be included in trace messages, by supplying the property values to a supplied consumer function- Specified by:
gatherPropertiesin interfaceTraceable- Parameters:
consumer- the function to which the properties should be supplied, as (property name, value) pairs.
-