@Override public void handleError(Diagnostic diagnostic) { getLogger().error(new StringBuilder("ERROR: ").append(diagnostic.getMessage()).toString()); }
@Override public void handleInfo(Diagnostic diagnostic) { getLogger().info(new StringBuilder("INFO: ").append(diagnostic.getMessage()).toString()); } }
@Override public void handleWarning(Diagnostic diagnostic) { getLogger().warn(new StringBuilder("WARNING: ").append(diagnostic.getMessage()).toString()); }
/** * Initializes me with a diagnostic describing the nature of stopping * evaluation. * * @param diagnostic * non-null diagnostic object * */ public EvaluationHaltedException(Diagnostic diagnostic) { super(diagnostic.getMessage()); this.diagnostic = diagnostic; }
/** * Initializes me with a diagnostic describing the nature of stopping * evaluation. * * @param diagnostic * non-null diagnostic object * */ public EvaluationHaltedException(Diagnostic diagnostic) { super(diagnostic.getMessage()); this.diagnostic = diagnostic; }
/** * Initializes me with a diagnostic obtained from a problem handler. * * @param problem the diagnostic * * @since 1.2 */ public ParserException(Diagnostic problem) { super(problem.getMessage()); this.diagnostic = problem; }
/** * Initializes me with a diagnostic obtained from a problem handler. * * @param problem the diagnostic * * @since 1.2 */ public ParserException(Diagnostic problem) { super(problem.getMessage()); this.diagnostic = problem; }
public String getMessage() { return diagnostic.getMessage(); }
private static boolean shouldHandle(Diagnostic diagnostic) { // filter out diagnostics with no message or with root diagnostic message if (diagnostic.getMessage() == null || diagnostic.getMessage().startsWith("Diagnosis of")) { return false; } return true; }
@Override public void handleInfo(Diagnostic diagnostic) { System.out.println("INFO: " + diagnostic.getMessage()); } });
@Override public String getMessage() { StringBuffer msg = new StringBuffer(); msg.append(super.getMessage()); msg.append("\n"); for (Diagnostic d : diagnostics) { msg.append(d.getSource()); msg.append(": "); msg.append(d.getMessage()); msg.append("\n"); } return msg.toString(); }
public DiagnosticException(Diagnostic diagnostic) { super(diagnostic.getMessage(), diagnostic.getException()); this.diagnostic = diagnostic; }
@Override public void setBlocked(Diagnostic reason) { super.setBlocked(reason); printStream.println("#> " + reason.getMessage()); }
public boolean apply(Diagnostic d) { if (severity != null && d.getSeverity() != severity) return false; if (code != null && !code.equals(d.getCode())) return false; if (issueCode != null && d instanceof AbstractValidationDiagnostic && !((AbstractValidationDiagnostic) d).getIssueCode().equals(issueCode)) return false; if (msg != null && d.getMessage() != null && !d.getMessage().contains(msg)) return false; return true; }
public boolean apply(Diagnostic d) { if (severity != null && d.getSeverity() != severity) return false; if (code != null && !code.equals(d.getCode())) return false; if (issueCode != null && d instanceof AbstractValidationDiagnostic && !((AbstractValidationDiagnostic) d).getIssueCode().equals(issueCode)) return false; if (msg != null && d.getMessage() != null && !d.getMessage().contains(msg)) return false; return true; }
@Override public void clearBlocked() { printStream.println("=> " + getBlockedReason().getMessage()); super.clearBlocked(); } }
public void handleError(Diagnostic diagnostic) { System.out.println("ERROR: " + diagnostic.getMessage()); validationErrors.add(diagnostic.getMessage()); } });
public static Diagnostic createDiagnostic(Diagnostic baseDiagnostic, String source, int code) { BasicDiagnostic basicDiagnostic = new BasicDiagnostic( baseDiagnostic.getSeverity(), source, code, baseDiagnostic.getMessage(), baseDiagnostic.getData().toArray()); basicDiagnostic.addAll(baseDiagnostic); return basicDiagnostic; }
public void doCreateMessage(Diagnostic diagnostic, EObject object, EStructuralFeature feature, ValidationMessageAcceptor acceptor) { String code = XtextValidator.class.getName() + ".PackageValidation." + diagnostic.getCode(); int severity = diagnostic.getSeverity(); if (diagnostic.getCode() == EcoreValidator.UNIQUE_CLASSIFIER_NAMES || diagnostic.getCode() == EcoreValidator.UNIQUE_FEATURE_NAMES) severity = Diagnostic.ERROR; String message = diagnostic.getMessage(); doCreateMessage(message, code, severity, object, feature, acceptor); }
public boolean createMessageForSource(Diagnostic diagnostic, EObject object, ValidationMessageAcceptor acceptor) { String code = XtextValidator.class.getName() + ".PackageValidation." + diagnostic.getCode(); int severity = diagnostic.getSeverity(); if (diagnostic.getCode() == EcoreValidator.UNIQUE_CLASSIFIER_NAMES || diagnostic.getCode() == EcoreValidator.UNIQUE_FEATURE_NAMES) severity = Diagnostic.ERROR; String message = diagnostic.getMessage(); return createMessageForSource(message, code, severity, object, acceptor); }