Debian Codegraph @

net/sf/saxon/lib/ErrorGatherer.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.lib;
9
10 import net.sf.saxon.s9api.StaticError;
11 import net.sf.saxon.trans.XPathException;
12 import javax.xml.transform.TransformerException;
13 import java.util.ArrayList;
14 import java.util.List;
15
16
17 public class ErrorGatherer implements UnfailingErrorListener{
18
19 List <StaticError> errorList = new ArrayList<StaticError>();
20
21
22 public ErrorGatherer(List <StaticError> errorList){
23 this.errorList = errorList;
24
25 }
26
27 public void warning(TransformerException exception) {
28 XPathException newXPathException = XPathException.makeXPathException(exception);
29 errorList.add(new StaticError(newXPathException, true));
30 }
31
32 public void error(TransformerException exception) {
33 XPathException newXPathException = XPathException.makeXPathException(exception);
34 errorList.add(new StaticError(newXPathException, false));
35 }
36
37 public void fatalError(TransformerException exception) {
38 XPathException newXPathException = XPathException.makeXPathException(exception);
39 errorList.add(new StaticError(newXPathException, false));
40 }
41 }