Package net.sf.saxon.expr.accum
Class AccumulatorRule
- java.lang.Object
-
- net.sf.saxon.expr.accum.AccumulatorRule
-
- All Implemented Interfaces:
Locatable,Traceable,TraceableComponent,RuleTarget
public class AccumulatorRule extends Object implements RuleTarget, TraceableComponent
This class represents one of the rules making up the definition of an accumulator
-
-
Constructor Summary
Constructors Constructor Description AccumulatorRule(Expression newValueExpression, SlotManager stackFrameMap, boolean postDescent)Create a rule
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexport(ExpressionPresenter out)Output 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 functionExpressiongetBody()Get the expression at the root of the expression tree used to evaluate this constructLocationgetLocation()Get the location of the constructExpressiongetNewValueExpression()StructuredQNamegetObjectName()Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc.SlotManagergetStackFrameMap()StringgetTracingTag()Get a string to identify the type of componentbooleanisCapturing()booleanisPostDescent()voidregisterRule(Rule rule)Register a rule for which this is the targetvoidsetAccumulatorName(StructuredQName name)voidsetBody(Expression expression)Set the expression to be used to evaluate this constructvoidsetCapturing(boolean capturing)voidsetLocation(Location loc)
-
-
-
Constructor Detail
-
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 Detail
-
getNewValueExpression
public Expression getNewValueExpression()
-
export
public void export(ExpressionPresenter out) throws XPathException
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
public SlotManager getStackFrameMap()
-
registerRule
public void registerRule(Rule rule)
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
public Expression 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
public void setLocation(Location loc)
-
getLocation
public Location 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
public StructuredQName 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
public void setBody(Expression expression)
Description copied from interface:TraceableComponentSet the expression to be used to evaluate this construct- Specified by:
setBodyin interfaceTraceableComponent- Parameters:
expression- the evaluation expression
-
getTracingTag
public String getTracingTag()
Description copied from interface:TraceableComponentGet a string to identify the type of component- Specified by:
getTracingTagin interfaceTraceableComponent- Returns:
- an identifying string
-
setAccumulatorName
public void setAccumulatorName(StructuredQName name)
-
gatherProperties
public void gatherProperties(BiConsumer<String,Object> consumer)
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.
-
-