| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 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 |
} |