Class 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.
    • Constructor Detail

      • AccumulatorRegistry

        public AccumulatorRegistry()
    • 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 node
        accumulator - the accumulator whose value is required
        phase - 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