protected void throwFromIOE(IOException ioe) throws WstxException { throw new WstxIOException(ioe); }
protected static void throwFromIOE(IOException ioe) throws XMLStreamException { throw 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 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); } }
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); } }
public void writeDTD(String dtd) throws XMLStreamException { verifyWriteDTD(); mDtdRootElem = ""; // marker to verify only one is output try { mWriter.writeDTD(dtd); } catch (IOException ioe) { throw new WstxIOException(ioe); } /* 20-Dec-2005, TSa: Should we try to decipher what was actually * written, for validation? */ }
protected XMLStreamReader2 createSR(ReaderConfig cfg, URL src, boolean forER, boolean autoCloseInput) throws XMLStreamException { final SystemId systemId = SystemId.construct(src); try { return createSR(cfg, systemId, URLUtil.inputStreamFromURL(src), forER, autoCloseInput); } catch (IOException ioe) { throw new WstxIOException(ioe); } }
public XMLValidationSchema createSchema(URL url) throws XMLStreamException { ReaderConfig rcfg = createPrivateReaderConfig(); try { InputStream in = URLUtil.inputStreamFromURL(url); return doCreateSchema(rcfg, StreamBootstrapper.getInstance (null, null, in), null, url.toExternalForm(), url); } catch (IOException ioe) { throw new WstxIOException(ioe); } }