Debian Codegraph @

net/sf/saxon/expr/accum/FailedAccumulatorData.java

raw symbols SCIP
1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2018 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7
8 package net.sf.saxon.expr.accum;
9
10 import net.sf.saxon.om.NodeInfo;
11 import net.sf.saxon.om.Sequence;
12 import net.sf.saxon.trans.XPathException;
13
14 /**
15 * Represents the values of an accumulator whose evaluation has failed. The error is retained
16 * until referenced using accumulator-before() or accumulator-after().
17 */
18 public class FailedAccumulatorData implements IAccumulatorData {
19
20 private Accumulator acc;
21 private XPathException error;
22
23 public FailedAccumulatorData(Accumulator acc, XPathException error) {
24 this.acc = acc;
25 this.error = error;
26 }
27
28 @Override
29 public Accumulator getAccumulator() {
30 return acc;
31 }
32
33 @Override
34 public Sequence<?> getValue(NodeInfo node, boolean postDescent) throws XPathException {
35 throw error;
36 }
37 }