public static void throwLazily(XMLStreamException ex) throws WstxLazyException { throw new WstxLazyException(ex); }
protected void reportProblem(String msg, Location loc) throws XMLStreamException { throw new WstxParsingException(msg, loc); } }
protected void throwFromIOE(IOException ioe) throws WstxException { throw new WstxIOException(ioe); }
protected void throwUnexpectedEOF(String msg) throws WstxException { throw new WstxEOFException("Unexpected EOF" +(msg == null ? "" : msg), getLastCharLocation()); }
protected WstxException constructNullCharException() { return new WstxUnexpectedCharException("Illegal character (NULL, unicode 0) encountered: not valid in any content", getLastCharLocation(), CHAR_NULL); }
protected void throwFromStrE(XMLStreamException strex) throws WstxException { if (strex instanceof WstxException) { throw (WstxException) strex; } WstxException newEx = new WstxException(strex); ExceptionUtil.setInitCause(newEx, strex); throw newEx; }
/** * Method called to report an error, when caller's signature only * allows runtime exceptions to be thrown. */ protected void throwLazyError(Exception e) { if (e instanceof XMLStreamException) { WstxLazyException.throwLazily((XMLStreamException) e); } ExceptionUtil.throwRuntimeException(e); }
protected String getLocationDesc() { Location loc = getLocation(); return (loc == null) ? null : loc.toString(); } }
protected String getLocationDesc() { Location loc = getLocation(); return (loc == null) ? null : loc.toString(); } }
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); }
protected static void throwFromIOE(IOException ioe) throws XMLStreamException { throw new WstxIOException(ioe); }
protected void throwStreamException(String msg, Location loc) throws XMLStreamException { if (loc == null) { throw new WstxParsingException(msg); } throw new WstxParsingException(msg, loc); } }
/** * Similar to {@link #throwUnexpectedEOF}, but only indicates ending * of an input block. Used when reading a token that can not span * input block boundaries (ie. can not continue past end of an * entity expansion). */ protected void throwUnexpectedEOB(String msg) throws WstxException { throw new WstxEOFException("Unexpected end of input block" +(msg == null ? "" : msg), getLastCharLocation()); }
protected void throwUnexpectedChar(int i, String msg) throws WstxException { char c = (char) i; String excMsg = "Unexpected character "+getCharDesc(c)+msg; throw new WstxUnexpectedCharException(excMsg, getLastCharLocation(), c); }
protected void reportNull() throws WstxException { throw new WstxException("Illegal null byte in input stream", getLocation()); }
/** * Construct and return a {@link XMLStreamException} to throw * as a result of a failed Typed Access operation (but one not * caused by a Well-Formedness Constraint or Validation Constraint * problem) */ /* protected WstxException _constructTypeException(String msg) { // Hmmh. Should there be a distinct sub-type? return new WstxParsingException(msg, getLastCharLocation()); } */ protected WstxException constructFromIOE(IOException ioe) { return new WstxIOException(ioe); }
protected void reportXmlProblem(String msg) throws WstxException { throw new WstxParsingException(msg, getLocation()); }
public void output(char c) throws XMLStreamException { if (mIsFlattening > 0) { try { mWriter.write(c); } catch (IOException ioe) { throw new WstxIOException(ioe); } } } }
protected final void doWriteStartTag(String localName) throws XMLStreamException { mAnyOutput = true; mStartElementOpen = true; try { mWriter.writeStartTagStart(localName); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
public void writeAsEncodedUnicode(Writer w) throws XMLStreamException { try { writeEnc(w); } catch (IOException ie) { throw new WstxIOException(ie); } }