private void _reportWarning(XMLReporter rep, String probType, String msg, Location loc) throws XMLStreamException { if (rep != null) { /* Note: since the problem occurs at DTD (schema) parsing, * not during validation, can not set reporter. */ XMLValidationProblem prob = new XMLValidationProblem (loc, msg, XMLValidationProblem.SEVERITY_WARNING, probType); rep.report(msg, probType, prob, loc); } } }
protected void verifyXmlEncoding(ReaderConfig cfg) throws XMLStreamException { String inputEnc = mInputEncoding; // Close enough? if (StringUtil.equalEncodings(inputEnc, mFoundEncoding)) { return; } /* Ok, maybe the difference is just with endianness indicator? * (UTF-16BE vs. UTF-16)? */ // !!! TBI XMLReporter rep = cfg.getXMLReporter(); if (rep != null) { Location loc = getLocation(); String msg = MessageFormat.format(ErrorConsts.W_MIXED_ENCODINGS, new Object[] { mFoundEncoding, inputEnc }); String type = ErrorConsts.WT_XML_DECL; /* 30-May-2008, tatus: Should wrap all the info as XMValidationProblem * since that's Woodstox' contract wrt. relatedInformation field. */ XMLValidationProblem prob = new XMLValidationProblem(loc, msg, XMLValidationProblem.SEVERITY_WARNING, type); rep.report(msg, type, prob, loc); } }
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); } }
private void reportWarning(XMLReporter rep, String probType, String msg, Location loc, Object extraArg) throws XMLStreamException { if (rep != null) { rep.report(msg, probType, extraArg, loc); } } }
private void reportWarning(XMLReporter rep, String probType, String msg, Location loc, Object extraArg) throws XMLStreamException { if (rep != null) { rep.report(msg, probType, extraArg, loc); } } }
private void reportWarning(XMLReporter rep, String probType, String msg, Location loc, Object extraArg) throws XMLStreamException { if (rep != null) { rep.report(msg, probType, extraArg, loc); } } }
/** * @see XMLReporter#report(String, String, Object, Location) */ public void report(final String message, final String errorType, final Object relatedInformation, final Location location) throws XMLStreamException { xmlReporter.report(message, errorType, relatedInformation, location); }
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); } } }
protected final void doReportProblem(XMLReporter rep, String probType, String msg, Location loc) { if (rep != null) { try { rep.report(msg, probType, null, loc); } catch (XMLStreamException e) { // Hmmh. Weird that a reporter is allowed to do this... System.err.println("Problem reporting a problem: "+e); } } }
protected final void doReportProblem(XMLReporter rep, String probType, String msg, Location loc) { if (rep != null) { try { rep.report(msg, probType, null, loc); } catch (XMLStreamException e) { // Hmmh. Weird that a reporter is allowed to do this... System.err.println("Problem reporting a problem: "+e); } } }
protected final void doReportProblem(XMLReporter rep, String probType, String msg, Location loc) { if (rep != null) { try { rep.report(msg, probType, null, loc); } catch (XMLStreamException e) { // Hmmh. Weird that a reporter is allowed to do this... System.err.println("Problem reporting a problem: "+e); } } }
/** * Used to report a {@link SAXException}to the {@link XMLReporter} registered with this handler. */ protected void reportException(String type, SAXException e) throws SAXException { if (this.reporter != null) { try { this.reporter.report(e.getMessage(), type, e, this.getCurrentLocation()); } catch (XMLStreamException e1) { throw new SAXException(e1); } } }
private void _reportWarning(XMLReporter rep, String probType, String msg, Location loc) throws XMLStreamException { if (rep != null) { /* Note: since the problem occurs at DTD (schema) parsing, * not during validation, can not set reporter. */ XMLValidationProblem prob = new XMLValidationProblem (loc, msg, XMLValidationProblem.SEVERITY_WARNING, probType); rep.report(msg, probType, prob, loc); } } }
private void _reportWarning(XMLReporter rep, String probType, String msg, Location loc) throws XMLStreamException { if (rep != null) { /* Note: since the problem occurs at DTD (schema) parsing, * not during validation, can not set reporter. */ XMLValidationProblem prob = new XMLValidationProblem (loc, msg, XMLValidationProblem.SEVERITY_WARNING, probType); rep.report(msg, probType, prob, loc); } } }
/** * Used to report a {@link SAXException}to the {@link XMLReporter} * registered with this handler. */ protected void reportException(String type, SAXException e) throws SAXException { if (reporter != null) { try { reporter.report(e.getMessage(), type, e, getCurrentLocation()); } catch (XMLStreamException e1) { throw new SAXException(e1); } } }
/** * Used to report a {@link SAXException}to the {@link XMLReporter} * registered with this handler. */ protected void reportException(String type, SAXException e) throws SAXException { if (reporter != null) { try { reporter.report(e.getMessage(), type, e, getCurrentLocation()); } catch (XMLStreamException e1) { throw new SAXException(e1); } } }
/** * Used to report a {@link SAXException}to the {@link XMLReporter} * registered with this handler. */ protected void reportException(String type, SAXException e) throws SAXException { if (reporter != null) { try { reporter.report(e.getMessage(), type, e, getCurrentLocation()); } catch (XMLStreamException e1) { throw new SAXException(e1); } } }
private void _reportWarning(XMLReporter rep, String probType, String msg, Location loc) throws XMLStreamException { if (rep != null) { /* Note: since the problem occurs at DTD (schema) parsing, * not during validation, can not set reporter. */ XMLValidationProblem prob = new XMLValidationProblem (loc, msg, XMLValidationProblem.SEVERITY_WARNING, probType); rep.report(msg, probType, prob, loc); } } }
private void _reportWarning(XMLReporter rep, String probType, String msg, Location loc) throws XMLStreamException { if (rep != null) { /* Note: since the problem occurs at DTD (schema) parsing, * not during validation, can not set reporter. */ XMLValidationProblem prob = new XMLValidationProblem (loc, msg, XMLValidationProblem.SEVERITY_WARNING, probType); rep.report(msg, probType, prob, loc); } } }
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); } }