protected void throwFromIOE(IOException ioe) throws WstxException { throw new WstxIOException(ioe); }
protected static void throwFromIOE(IOException ioe) throws XMLStreamException { throw new WstxIOException(ioe); }
/** * 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); }
public void output(char c) throws XMLStreamException { if (mIsFlattening > 0) { try { mWriter.write(c); } catch (IOException ioe) { throw new WstxIOException(ioe); } } } }
public void flush(char[] buf, int upUntil) throws XMLStreamException { if (mFlattenStart < upUntil) { if (mIsFlattening > 0) { try { mWriter.write(buf, mFlattenStart, upUntil - mFlattenStart); } catch (IOException ioe) { throw new WstxIOException(ioe); } } mFlattenStart = upUntil; } }
/** * Method called when explicit output has to be done for flatten output: * this is usually done when there's need to do speculative checks * before it's known if some chars are output (when suppressing comments * or conditional sections) */ public void output(String output) throws XMLStreamException { if (mIsFlattening > 0) { try { mWriter.write(output); } catch (IOException ioe) { throw new WstxIOException(ioe); } } }
public XMLValidationSchema createSchema(File f) throws XMLStreamException { try { return createSchema(f.toURL()); } 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); } }
protected void throwOutputError(String msg) throws XMLStreamException { // First, let's flush any output we may have, to make debugging easier try { flush(); } catch (IOException ioe) { throw new WstxIOException(ioe); } throw new XMLStreamException(msg); }
public void flush() throws XMLStreamException { /* Note: there have been changes to exact scope of flushing * (with Woodstox versions 2.x and 3.x); but the current * one of just flushing the underlying OutputStream or Writer * should be the interpretation compatible with the Stax specs. */ try { mWriter.flush(); } catch (IOException ie) { throw new WstxIOException(ie); } }
public void writeAsEncodedUnicode(Writer w) throws XMLStreamException { try { w.write('<'); String prefix = mName.getPrefix(); if (prefix != null && prefix.length() > 0) { w.write(prefix); w.write(':'); } w.write(mName.getLocalPart()); // Base class can output namespaces and attributes: outputNsAndAttr(w); w.write('>'); } catch (IOException ie) { throw new WstxIOException(ie); } }
public XMLValidationSchema createSchema(URL url) throws XMLStreamException { try { InputStream in = URLUtil.inputStreamFromURL(url); InputSource src = new InputSource(in); src.setSystemId(url.toExternalForm()); return loadSchema(src, url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
public void writeRaw(String text) throws XMLStreamException { mAnyOutput = true; if (mStartElementOpen) { closeStartElement(mEmptyElement); } try { mWriter.writeRaw(text, 0, text.length()); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
public XMLValidationSchema createSchema(File f) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { URL url = f.toURL(); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (null, null, new FileInputStream(f)), null, url.toExternalForm(), url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
throw new WstxIOException(ex); } catch (Exception ex) { throw new XMLStreamException(ex.getMessage(), ex);
public void writeDTD(String rootName, String systemId, String publicId, String internalSubset) throws XMLStreamException { verifyWriteDTD(); mDtdRootElem = rootName; try { mWriter.writeDTD(rootName, systemId, publicId, internalSubset); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
protected final void doWriteStartTag(String prefix, String localName) throws XMLStreamException { mAnyOutput = true; mStartElementOpen = true; try { boolean hasPrefix = (prefix != null && prefix.length() > 0); if (hasPrefix) { mWriter.writeStartTagStart(prefix, localName); } else { mWriter.writeStartTagStart(localName); } } catch (IOException ioe) { throw new WstxIOException(ioe); } }
public void writeRaw(char[] text, int start, int offset) throws XMLStreamException { mAnyOutput = true; if (mStartElementOpen) { closeStartElement(mEmptyElement); } try { mWriter.writeRaw(text, start, offset); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
public void writeRaw(String text, int start, int offset) throws XMLStreamException { mAnyOutput = true; if (mStartElementOpen) { closeStartElement(mEmptyElement); } try { mWriter.writeRaw(text, start, offset); } catch (IOException ioe) { throw new WstxIOException(ioe); } }