public class AccumulatorManagerPE extends Object implements IAccumulatorManager
In principle there is a dataset containing accumulator values for every accumulator/document pair. In addition, if the same stylesheet is run concurrently in multiple transformations, and a document is shared between these transformations, the data values for the accumulator can differ between the two transformations, because the accumulator rules can depend on values of stylesheet parameters or on context variables such as current-dateTime.
It is important that the accumulator data for a tree does not cause the tree to be locked in memory for the duration of a transformation. We therefore keep a weak reference to the tree. For each tree, until it is garbage collected, there is a map from accumulator names to accumulator data.
Constructor and Description |
---|
AccumulatorManagerPE() |
Modifier and Type | Method and Description |
---|---|
void |
addAccumulatorData(TreeInfo doc,
Accumulator acc,
IAccumulatorData accData)
Add the accumulator data for a particular accumulator, if it does not already exist
|
void |
copyAccumulatorData(NodeInfo item,
VirtualCopy vc)
Copy the accumulator data for a subtree (unstreamed) when making a virtual copy of the subtree
|
IAccumulatorData |
getAccumulatorData(TreeInfo doc,
Accumulator acc,
XPathContext context)
Get the data relating to a particular accumulator for a particular unstreamed document tree
|
public IAccumulatorData getAccumulatorData(TreeInfo doc, Accumulator acc, XPathContext context) throws XPathException
doc
- the source document tree in questionacc
- the required accumulatorcontext
- the XPath dynamic evaluation contextXPathException
- if any dynamic error occurspublic void addAccumulatorData(TreeInfo doc, Accumulator acc, IAccumulatorData accData)
doc
- the document/tree whose accumulator data is being addedacc
- the accumulator in questionaccData
- the data holding the values of the accumulator for the nodes in this treepublic void copyAccumulatorData(NodeInfo item, VirtualCopy vc) throws XPathException
item
- the root of the subtreevc
- the virtual copy being createdXPathException
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.