public static WstxValidationException create(XMLValidationProblem cause) { // Should always get a message Location loc = cause.getLocation(); if (loc == null) { return new WstxValidationException(cause, cause.getMessage()); } return new WstxValidationException(cause, cause.getMessage(), loc); }
/** * Method is overridden for two main reasons: first, default method * does not display public/system id information, even if it exists, and * second, default implementation can not handle nested Location * information. */ public String getMessage() { String locMsg = getLocationDesc(); /* Better not use super's message if we do have location information, * since parent's message contains (part of) Location * info; something we can regenerate better... */ if (locMsg == null) { return super.getMessage(); } String msg = getValidationProblem().getMessage(); StringBuffer sb = new StringBuffer(msg.length() + locMsg.length() + 20); sb.append(msg); StringUtil.appendLF(sb); sb.append(" at "); sb.append(locMsg); return sb.toString(); }
protected void doReportProblem(XMLReporter rep, XMLValidationProblem prob) throws XMLStreamException { if (rep != null) { Location loc = prob.getLocation(); if (loc == null) { loc = getLocation(); prob.setLocation(loc); } // Backwards-compatibility fix: add non-null type, if missing: if (prob.getType() == null) { prob.setType(ErrorConsts.WT_VALIDATION); } // [WSTX-154]: was catching and dropping thrown exception: shouldn't. rep.report(prob.getMessage(), prob.getType(), prob, loc); } }
protected void _reportProblem(XMLReporter rep, XMLValidationProblem prob) throws XMLStreamException { if (rep != null) { Location loc = prob.getLocation(); if (loc == null) { loc = getLastCharLocation(); prob.setLocation(loc); } // Backwards-compatibility fix: add non-null type, if missing: if (prob.getType() == null) { prob.setType(ErrorConsts.WT_VALIDATION); } // [WSTX-154]: was catching and dropping thrown exception: shouldn't. // [WTSX-157]: need to support XMLReporter2 if (rep instanceof XMLReporter2) { ((XMLReporter2) rep).report(prob); } else { rep.report(prob.getMessage(), prob.getType(), prob, loc); } } }
public void reportProblem(XMLValidationProblem problem) throws XMLValidationException { throw new Fault(problem.getMessage(), LOG); } });
public static ValidationException create(XMLValidationProblem cause) { // Should always get a message Location loc = cause.getLocation(); if (loc == null) { return new ValidationException(cause, cause.getMessage()); } return new ValidationException(cause, cause.getMessage(), loc); }
public static WstxValidationException create(XMLValidationProblem cause) { // Should always get a message Location loc = cause.getLocation(); if (loc == null) { return new WstxValidationException(cause, cause.getMessage()); } return new WstxValidationException(cause, cause.getMessage(), loc); }
public static WstxValidationException create(XMLValidationProblem cause) { // Should always get a message Location loc = cause.getLocation(); if (loc == null) { return new WstxValidationException(cause, cause.getMessage()); } return new WstxValidationException(cause, cause.getMessage(), loc); }
public static ValidationException create(XMLValidationProblem cause) { // Should always get a message Location loc = cause.getLocation(); if (loc == null) { return new ValidationException(cause, cause.getMessage()); } return new ValidationException(cause, cause.getMessage(), loc); }
public static WstxValidationException create(XMLValidationProblem cause) { // Should always get a message Location loc = cause.getLocation(); if (loc == null) { return new WstxValidationException(cause, cause.getMessage()); } return new WstxValidationException(cause, cause.getMessage(), loc); }
public static WstxValidationException create(XMLValidationProblem cause) { // Should always get a message Location loc = cause.getLocation(); if (loc == null) { return new WstxValidationException(cause, cause.getMessage()); } return new WstxValidationException(cause, cause.getMessage(), loc); }
public static WstxValidationException create(XMLValidationProblem cause) { // Should always get a message Location loc = cause.getLocation(); if (loc == null) { return new WstxValidationException(cause, cause.getMessage()); } return new WstxValidationException(cause, cause.getMessage(), loc); }
public static WstxValidationException create(XMLValidationProblem cause) { // Should always get a message Location loc = cause.getLocation(); if (loc == null) { return new WstxValidationException(cause, cause.getMessage()); } return new WstxValidationException(cause, cause.getMessage(), loc); }
public void reportProblem(XMLValidationProblem problem) throws XMLValidationException { throw new Fault(new Message("READ_VALIDATION_ERROR", LOG, problem.getMessage()), Fault.FAULT_CODE_CLIENT); } });
public void reportProblem(XMLValidationProblem problem) throws XMLValidationException { throw new Fault(new Message("READ_VALIDATION_ERROR", LOG, problem.getMessage()), Fault.FAULT_CODE_CLIENT); } });
public void reportProblem(XMLValidationProblem problem) throws XMLValidationException { throw new Fault(new Message("READ_VALIDATION_ERROR", LOG, problem.getMessage()), Fault.FAULT_CODE_CLIENT); } });
public static XMLValidationException createException(XMLValidationProblem cause) { String msg = cause.getMessage(); if (msg == null) { return new XMLValidationException(cause); } Location loc = cause.getLocation(); if (loc == null) { return new XMLValidationException(cause, msg); } return new XMLValidationException(cause, msg, loc); }
public static XMLValidationException createException(XMLValidationProblem cause) { String msg = cause.getMessage(); if (msg == null) { return new XMLValidationException(cause); } Location loc = cause.getLocation(); if (loc == null) { return new XMLValidationException(cause, msg); } return new XMLValidationException(cause, msg, loc); }
public static XMLValidationException createException(XMLValidationProblem cause) { String msg = cause.getMessage(); if (msg == null) { return new XMLValidationException(cause); } Location loc = cause.getLocation(); if (loc == null) { return new XMLValidationException(cause, msg); } return new XMLValidationException(cause, msg, loc); }
public static XMLValidationException createException(XMLValidationProblem cause) { String msg = cause.getMessage(); if (msg == null) { return new XMLValidationException(cause); } Location loc = cause.getLocation(); if (loc == null) { return new XMLValidationException(cause, msg); } return new XMLValidationException(cause, msg, loc); }