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 TypeMethodDescriptionvoid
Output diagnostic explanation to an ExpressionPresentervoid
gatherProperties
(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 componentboolean
boolean
void
registerRule
(Rule rule) Register a rule for which this is the targetvoid
void
setBody
(Expression expression) Set the expression to be used to evaluate this constructvoid
setCapturing
(boolean capturing) void
setLocation
(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:RuleTarget
Output diagnostic explanation to an ExpressionPresenter- Specified by:
export
in 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:
registerRule
in 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:TraceableComponent
Get the expression at the root of the expression tree used to evaluate this construct- Specified by:
getBody
in interfaceTraceableComponent
- Returns:
- the root expression
-
setLocation
-
getLocation
Description copied from interface:Locatable
Get the location of the construct- Specified by:
getLocation
in interfaceLocatable
- Returns:
- the location. If no location information is available, the method should return
Loc.NONE
rather than returning null. However, callers would be well advised to check for the result being null.
-
getObjectName
Description copied from interface:Traceable
Get 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:
getObjectName
in interfaceTraceable
- Returns:
- the QName of the object declared or manipulated by this instruction or expression
-
setBody
Description copied from interface:TraceableComponent
Set the expression to be used to evaluate this construct- Specified by:
setBody
in interfaceTraceableComponent
- Parameters:
expression
- the evaluation expression
-
getTracingTag
Description copied from interface:TraceableComponent
Get a string to identify the type of component- Specified by:
getTracingTag
in interfaceTraceableComponent
- Returns:
- an identifying string
-
setAccumulatorName
-
gatherProperties
Description copied from interface:Traceable
Get the properties of this object to be included in trace messages, by supplying the property values to a supplied consumer function- Specified by:
gatherProperties
in interfaceTraceable
- Parameters:
consumer
- the function to which the properties should be supplied, as (property name, value) pairs.
-