Package net.sf.saxon.expr.accum
Class AccumulatorRegistry
- java.lang.Object
-
- net.sf.saxon.expr.accum.AccumulatorRegistry
-
- Direct Known Subclasses:
AccumulatorRegistryEE
public class AccumulatorRegistry extends java.lang.Object
Static registry for accumulators (XSLT 3.0) defined within a single package. Generally accessed via the PackageData object for the package.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<StructuredQName,Accumulator>
accumulatorsByName
-
Constructor Summary
Constructors Constructor Description AccumulatorRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAccumulator(Accumulator acc)
Register an accumulatorAccumulator
getAccumulator(StructuredQName name)
Get the accumulator with a given namejava.lang.Iterable<Accumulator>
getAllAccumulators()
Get all the registered accumulatorsSequence
getStreamingAccumulatorValue(NodeInfo node, Accumulator accumulator, AccumulatorFn.Phase phase)
Get the run-time value of a streamed accumulatorjava.util.Set<Accumulator>
getUsedAccumulators(java.lang.String useAccumulatorsAtt, StyleElement styleElement)
Process the use-accumulators attribute of instructions such as xsl:stream, xsl:mode, etc
-
-
-
Field Detail
-
accumulatorsByName
protected java.util.Map<StructuredQName,Accumulator> accumulatorsByName
-
-
Method Detail
-
getUsedAccumulators
public java.util.Set<Accumulator> getUsedAccumulators(java.lang.String useAccumulatorsAtt, StyleElement styleElement)
Process the use-accumulators attribute of instructions such as xsl:stream, xsl:mode, etc- Parameters:
useAccumulatorsAtt
- the value of the use-accumulators attribute- Returns:
- the list of accumulators referenced
-
addAccumulator
public void addAccumulator(Accumulator acc)
Register an accumulator- Parameters:
acc
- the accumulator to be registered
-
getAccumulator
public Accumulator getAccumulator(StructuredQName name)
Get the accumulator with a given name- Parameters:
name
- the name of the accumulator- Returns:
- the accumulator with this name
-
getAllAccumulators
public java.lang.Iterable<Accumulator> getAllAccumulators()
Get all the registered accumulators- Returns:
- a collection of accumulators
-
getStreamingAccumulatorValue
public Sequence getStreamingAccumulatorValue(NodeInfo node, Accumulator accumulator, AccumulatorFn.Phase phase) throws XPathException
Get the run-time value of a streamed accumulator- Parameters:
node
- the context node, which must be a streamed nodeaccumulator
- the accumulator whose value is requiredphase
- pre-descent or post-descent- Returns:
- the value of the accumulator, or null if the context node is not streamed
- Throws:
XPathException
- if a dynamic error occurs
-
-