public void addError(String file, int line, int column, String message) { addError(file, line, column, message, null); } public void addError(String file, int line, int column, String message, Throwable t) {
public void addWarning(String file, int line, int column, String message) { addWarning(file, line, column, message, null); } public void addWarning(String file, int line, int column, String message, Throwable t) {
public boolean hasErrors() { return listener.getErrorCount() > 0; }
if (context.getErrorListener().getErrorCount() > 0) { context.getErrorListener().throwToolException(); if (context.getErrorListener().getErrorCount() > 0) { context.getErrorListener().throwToolException();
public ToolErrorListener getErrorListener() { if (errors == null) { errors = new ToolErrorListener(); } return errors; } public void setErrorListener(ToolErrorListener e) {
public void throwToolException() { StringBuilder b = new StringBuilder(); for (ErrorInfo e : errors) { createMessage(b, e).append("\n"); } throw new ToolException(b.toString(), errors); } }
if (context.getErrorListener().getErrorCount() > 0) { context.getErrorListener().throwToolException(); if (context.getErrorListener().getErrorCount() > 0) { context.getErrorListener().throwToolException();
public ToolErrorListener getErrorListener() { if (errors == null) { errors = new ToolErrorListener(); } return errors; } public void setErrorListener(ToolErrorListener e) {
public void throwToolException() { StringBuilder b = new StringBuilder(); for (ErrorInfo e : errors) { createMessage(b, e).append("\n"); } throw new ToolException(b.toString(), errors); } }
public void addError(String file, int line, int column, String message) { addError(file, line, column, message, null); } public void addError(String file, int line, int column, String message, Throwable t) {
public boolean hasErrors() { return listener.getErrorCount() > 0; }
public void addWarning(String file, int line, int column, String message) { addWarning(file, line, column, message, null); } public void addWarning(String file, int line, int column, String message, Throwable t) {
public void error(org.xml.sax.SAXParseException exception) { listener.addError(exception.getSystemId(), exception.getLineNumber(), exception.getColumnNumber(), mapMessage(exception.getLocalizedMessage()), exception); }
return; if (c.getErrorListener().getErrorCount() > 0) { return;
public void warning(org.xml.sax.SAXParseException exception) { for (StackTraceElement el : new Exception().getStackTrace()) { if (el.getClassName().contains("DowngradingErrorHandler")) { //this is from within JAXB as it tries to validate the schemas //Xerces has issues with schema imports that don't have a //schemaLocation (or a schemaLocation that is not fully resolvable) //and emits strange warnings that are completely not //correct so we'll try and skip them. return; } } if (this.isVerbose) { System.out.println("JAXB parsing schema warning " + exception.toString() + " in schema " + exception.getSystemId()); } listener.addWarning(exception.getSystemId(), exception.getLineNumber(), exception.getColumnNumber(), mapMessage(exception.getLocalizedMessage()), exception); }
public void error(org.xml.sax.SAXParseException exception) { listener.addError(exception.getSystemId(), exception.getLineNumber(), exception.getColumnNumber(), mapMessage(exception.getLocalizedMessage()), exception); }
return; if (c.getErrorListener().getErrorCount() > 0) { return;
public void warning(org.xml.sax.SAXParseException exception) { for (StackTraceElement el : new Exception().getStackTrace()) { if (el.getClassName().contains("DowngradingErrorHandler")) { //this is from within JAXB as it tries to validate the schemas //Xerces has issues with schema imports that don't have a //schemaLocation (or a schemaLocation that is not fully resolvable) //and emits strange warnings that are completely not //correct so we'll try and skip them. return; } } if (this.isVerbose) { System.out.println("JAXB parsing schema warning " + exception.toString() + " in schema " + exception.getSystemId()); } listener.addWarning(exception.getSystemId(), exception.getLineNumber(), exception.getColumnNumber(), mapMessage(exception.getLocalizedMessage()), exception); }
public void addError(final String file, int line, int column, String message, Throwable t) { super.addError(file, line, column, message, t); File f = mapFile(file); if (f != null && !errorfiles.contains(f)) { buildContext.removeMessages(f); errorfiles.add(f); } if (f == null) { if (file == null) { f = new File("null"); } else { f = new File(file) { private static final long serialVersionUID = 1L; public String getAbsolutePath() { return file; } }; } } buildContext.addMessage(f, line, column, message, BuildContext.SEVERITY_ERROR, t); }
if (context.getErrorListener().getErrorCount() > 0) { return; if (context.getErrorListener().getErrorCount() == 0) { if (context.getErrorListener().getErrorCount() > 0) { return;