protected void writeTypedAttribute(String prefix, String nsURI, String localName, AsciiValueEncoder enc) throws XMLStreamException { super.writeTypedAttribute(findOrCreateAttrPrefix(prefix, nsURI, mCurrElem), nsURI, localName, enc); }
public void writeAttribute(String nsURI, String localName, String value) throws XMLStreamException { // No need to set mAnyOutput, nor close the element if (!mStartElementOpen) { throwOutputError(ErrorConsts.WERR_ATTR_NO_ELEM); } String prefix = mCurrElem.getExplicitPrefix(nsURI); if (!mReturnNullForDefaultNamespace && prefix == null) { throwOutputError("Unbound namespace URI '" + nsURI + "'"); } doWriteAttr(localName, nsURI, prefix, value); }
public void writeEntityReference(String name) throws IOException, XMLStreamException { if (mSurrogate != 0) { throwUnpairedSurrogate(); } writeAscii(BYTE_AMP); writeName(name); writeAscii(BYTE_SEMICOLON); }
/** * Called by {@link #createSW(OutputStream, Writer, String, boolean)} after all of the nessesary configuration * logic is complete. */ protected XMLStreamWriter2 createSW(String enc, WriterConfig cfg, XmlWriter xw) { if (cfg.willSupportNamespaces()) { if (cfg.automaticNamespacesEnabled()) { return new RepairingNsStreamWriter(xw, enc, cfg); } return new SimpleNsStreamWriter(xw, enc, cfg); } return new NonNsStreamWriter(xw, enc, cfg); }
public void writeStartTagStart(String localName) throws IOException, XMLStreamException { writeAscii(BYTE_LT); writeName(localName); }
protected final void writeAscii(byte b1, byte b2) throws IOException { if (mSurrogate != 0) { throwUnpairedSurrogate(); } if ((mOutputPtr + 1) >= mOutputBuffer.length) { flushBuffer(); } mOutputBuffer[mOutputPtr++] = b1; mOutputBuffer[mOutputPtr++] = b2; }
public void writeQName(QName name) throws XMLStreamException { /* Can't use AsciiValueEncoder, since QNames can contain * non-ascii characters */ writeCharacters(serializeQName(name)); }
public void write(char[] cbuf, int off, int len) throws IOException { mWriter.writeCharacters(cbuf, off, len); }
public void writeStartElement(String nsURI, String localName) throws XMLStreamException { writeStartOrEmpty(localName, nsURI); mEmptyElement = false; }
/** * This is the method called when an output method call violates * name well-formedness checks * and {@link WstxOutputProperties#P_OUTPUT_VALIDATE_NAMES} is * is enabled. */ protected void reportNwfName(String msg) throws XMLStreamException { throwOutputError(msg); }
public final void writeCommentEnd() throws IOException { fastWriteRaw("-->"); }
/** * @return New head of the recycle pool */ protected SimpleOutputElement reuseAsChild(SimpleOutputElement parent, String localName) { mAttrSet = null; SimpleOutputElement poolHead = mParent; relink(parent, null, localName, mDefaultNsURI); return poolHead; }
public void setDefaultNamespace(String uri) throws XMLStreamException { reportIllegalArg("Can not set default namespace for non-namespace writer."); }
public void writeAttribute(String prefix, String nsURI, String localName, String value) throws XMLStreamException { writeAttribute(localName, value); }
public void writeStartElement(String localName) throws XMLStreamException { doWriteStartElement(localName); mEmptyElement = false; }
private final void fastWriteRaw(char c) throws IOException { if (mOutputPtr >= mOutputBufLen) { if (mOut == null) { return; } flushBuffer(); } mOutputBuffer[mOutputPtr++] = c; }
public void write(String str) throws IOException { mWriter.writeCharacters(str); }
public void writeStartElement(String prefix, String localName, String nsURI) throws XMLStreamException { writeStartOrEmpty(prefix, localName, nsURI); mEmptyElement = false; }
protected void reportNwfContent(String msg) throws XMLStreamException { throwOutputError(msg); }
public final void writePIEnd() throws IOException { fastWriteRaw('?', '>'); }