| Modifier and Type | Field and Description |
|---|---|
| protected static final String | |
| protected final boolean | mAutomaticNS
True, if writer needs to automatically output namespace declarations (we are in repairing mode) |
| pack-priv static final int | MAX_POOL_SIZE
Although pooled objects are small, let's limit the pool size nonetheless, to optimize memory usage for deeply nested documents. |
| protected SimpleOutputElement | |
| protected final EmptyElementHandler | |
| protected SimpleOutputElement | |
| protected int | |
| protected NamespaceContext | mRootNsContext
Optional "root" namespace context that application can set. |
| protected static final String | |
| protected static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | checkStartElement(String localName, String prefix)
Method that is called to ensure that we can start writing an element, both from structural point of view, and from syntactic (close previously open start element, if any). |
| protected void | closeStartElement(boolean
If true, the element being closed is an empty
element; if false, a separate stand-alone start element. emptyElem)Implements abstract com. Method called to close an open start element, when another main-level element (not namespace declaration or attribute) is being output; except for end element which is handled differently. |
| public abstract void | |
| protected final void | |
| protected final void | |
| protected void | |
| protected void | doWriteEndTag(QName
Name that the closing element should have; null
if whatever is in stack should be used expName, boolean If true, is allowed to create the empty element
if the closing element was truly empty; if false, has to write
the full empty element no matter what allowEmpty)
|
| protected void | |
| protected final void | |
| protected final void | |
| public QName | getCurrentElementName()
Implements abstract com. Implements org. Method that can be used to access name information of the innermost (top) element in the element stack. |
| public NamespaceContext | getNamespaceContext()
Implements abstract com. Implements javax. Returns the current namespace context. |
| public String | getNamespaceURI(String prefix)
Implements abstract com. Implements org. Method that can be called by the validator to resolve a namespace prefix of the currently active top-level element. |
| public String | getPrefix(String
the uri the prefix is bound to uri)Implements abstract com. Implements javax. Gets the prefix the uri is bound to. |
| protected String | getTopElementDesc()
Implements abstract com. Method needed for error message generation |
| public abstract void | setDefaultNamespace(String
the uri to bind to the default namespace, may be null uri)Redeclares javax. Implements abstract com. Binds a URI to the default namespace This URI is bound in the scope of the current START_ELEMENT / END_ELEMENT pair. |
| public void | setNamespaceContext(NamespaceContext
the namespace context to use for this writer, may not be null ctxt)Implements abstract com. Implements javax. Note Root namespace context works best if automatic prefix creation ("namespace/prefix repairing" in StAX lingo) is enabled. |
| public void | setPrefix(String
the prefix to bind to the uri, may not be null prefix, String the uri to bind to the prefix, may be null uri)Implements abstract com. Implements javax. Sets the prefix the uri is bound to. |
| public void | writeAttribute(String
the local name of the attribute localName, String the value of the attribute value)Implements abstract com. Implements javax. It's assumed calling this method implies caller just wants to add an attribute that does not belong to any namespace; as such no namespace checking or prefix generation is needed. |
| public abstract void | writeAttribute(String
the uri of the prefix for this attribute nsURI, String the local name of the attribute localName, String the value of the attribute value)Redeclares javax. Implements abstract com. Writes an attribute to the output stream |
| public abstract void | writeAttribute(String
the prefix for this attribute prefix, String the uri of the prefix for this attribute nsURI, String the local name of the attribute localName, String the value of the attribute value)Redeclares javax. Implements abstract com. Writes an attribute to the output stream |
| public abstract void | writeDefaultNamespace(String
the uri to bind the default namespace to nsURI)Redeclares javax. Implements abstract com. Writes the default namespace to the stream |
| public void | writeEmptyElement(String
local name of the tag, may not be null localName)Implements abstract com. Implements javax. Note It is assumed caller just wants the element to belong to whatever is the current default namespace. |
| public void | writeEmptyElement(String
the uri to bind the tag to, may not be null nsURI, String local name of the tag, may not be null localName)Implements abstract com. Implements javax. Writes an empty element tag to the output |
| public void | writeEmptyElement(String
the prefix of the tag, may not be null prefix, String local name of the tag, may not be null localName, String the uri to bind the tag to, may not be null nsURI)Implements abstract com. Implements javax. Writes an empty element tag to the output |
| public void | writeEndElement()
Implements abstract com. Implements javax. Writes an end tag to the output relying on the internal state of the writer to determine the prefix and local name of the event. |
| public void | writeEndElement(QName name)
Implements abstract com. Method called by |
| public void | writeFullEndElement()
Implements abstract com. Implements org. Similar to |
| public abstract void | writeNamespace(String
the prefix to bind this namespace to prefix, String the uri to bind the prefix to nsURI)Redeclares javax. Implements abstract com. Writes a namespace to the output stream If the prefix argument to this method is the empty string, "xmlns", or null this method will delegate to writeDefaultNamespace |
| public void | writeStartElement(String
local name of the tag, may not be null localName)Implements abstract com. Implements javax. This method is assumed to just use default namespace (if any), and no further checks should be done. |
| public void | writeStartElement(String
the namespaceURI of the prefix to use, may not be null nsURI, String local name of the tag, may not be null localName)Implements abstract com. Implements javax. Writes a start tag to the output |
| public void | writeStartElement(String
the prefix of the tag, may not be null prefix, String local name of the tag, may not be null localName, String the uri to bind the prefix to, may not be null nsURI)Implements abstract com. Implements javax. Writes a start tag to the output |
| public abstract void | writeStartElement(StartElement elem)
Implements abstract com. Convenience method needed by |
| protected abstract void | |
| protected abstract void | |
| protected void | writeTypedAttribute(String prefix, String nsURI, String localName, AsciiValueEncoder enc)
Implements abstract com. Method that will write attribute with value that is known not to require additional escaping. |
| ERR_NSDECL_WRONG_STATE | back to summary |
|---|---|
| protected static final String ERR_NSDECL_WRONG_STATE | |
| mAutomaticNS | back to summary |
|---|---|
| protected final boolean mAutomaticNS True, if writer needs to automatically output namespace declarations (we are in repairing mode) | |
| MAX_POOL_SIZE | back to summary |
|---|---|
| pack-priv static final int MAX_POOL_SIZE Although pooled objects are small, let's limit the pool size nonetheless, to optimize memory usage for deeply nested documents. In general, even just low number like 4 levels gets decent return, but 8 should get 99% hit rate. | |
| mCurrElem | back to summary |
|---|---|
| protected SimpleOutputElement mCurrElem | |
| mEmptyElementHandler | back to summary |
|---|---|
| protected final EmptyElementHandler mEmptyElementHandler | |
| mOutputElemPool | back to summary |
|---|---|
| protected SimpleOutputElement mOutputElemPool | |
| mPoolSize | back to summary |
|---|---|
| protected int mPoolSize | |
| mRootNsContext | back to summary |
|---|---|
| protected NamespaceContext mRootNsContext Optional "root" namespace context that application can set. If so, it can be used to lookup namespace/prefix mappings | |
| sPrefixXml | back to summary |
|---|---|
| protected static final String sPrefixXml | |
| sPrefixXmlns | back to summary |
|---|---|
| protected static final String sPrefixXmlns | |
| BaseNsStreamWriter | back to summary |
|---|---|
| public BaseNsStreamWriter(XmlWriter xw, String enc, WriterConfig cfg, boolean repairing) | |
| checkStartElement | back to summary |
|---|---|
| protected void checkStartElement(String localName, String prefix) throws XMLStreamException Method that is called to ensure that we can start writing an element, both from structural point of view, and from syntactic (close previously open start element, if any). | |
| closeStartElement | back to summary |
|---|---|
| protected void closeStartElement(boolean emptyElem) throws XMLStreamException Implements abstract com. Method called to close an open start element, when another main-level element (not namespace declaration or attribute) is being output; except for end element which is handled differently.
| |
| doSetPrefix | back to summary |
|---|---|
| public abstract void doSetPrefix(String prefix, String uri) throws XMLStreamException | |
| doWriteAttr | back to summary |
|---|---|
| protected final void doWriteAttr(String localName, String nsURI, String prefix, String value) throws XMLStreamException | |
| doWriteAttr | back to summary |
|---|---|
| protected final void doWriteAttr(String localName, String nsURI, String prefix, char[] buf, int start, int len) throws XMLStreamException | |
| doWriteDefaultNs | back to summary |
|---|---|
| protected void doWriteDefaultNs(String nsURI) throws XMLStreamException | |
| doWriteEndTag | back to summary |
|---|---|
protected void doWriteEndTag(QName expName, boolean allowEmpty) throws XMLStreamException
| |
| doWriteNamespace | back to summary |
|---|---|
| protected void doWriteNamespace(String prefix, String nsURI) throws XMLStreamException | |
| doWriteStartTag | back to summary |
|---|---|
| protected final void doWriteStartTag(String localName) throws XMLStreamException | |
| doWriteStartTag | back to summary |
|---|---|
| protected final void doWriteStartTag(String prefix, String localName) throws XMLStreamException | |
| getCurrentElementName | back to summary |
|---|---|
| public QName getCurrentElementName() Implements abstract com. Implements org. Doc from org. Method that can be used to access name information of the innermost (top) element in the element stack. | |
| getNamespaceContext | back to summary |
|---|---|
| public NamespaceContext getNamespaceContext() Implements abstract com. Implements javax. Doc from javax. Returns the current namespace context.
| |
| getNamespaceURI | back to summary |
|---|---|
| public String getNamespaceURI(String prefix) Implements abstract com. Implements org. Doc from org. Method that can be called by the validator to resolve a namespace prefix of the currently active top-level element. This may be necessary for things like DTD validators (which may need to heuristically guess proper namespace URI of attributes, esp. ones with default values).
| |
| getPrefix | back to summary |
|---|---|
| public String getPrefix(String uri) Implements abstract com. Implements javax. Doc from javax. Gets the prefix the uri is bound to. | |
| getTopElementDesc | back to summary |
|---|---|
| protected String getTopElementDesc() Implements abstract com. Doc from com. Method needed for error message generation
| |
| setDefaultNamespace | back to summary |
|---|---|
| public abstract void setDefaultNamespace(String uri) throws XMLStreamException Redeclares javax. Implements abstract com. Doc from javax. Binds a URI to the default namespace This URI is bound in the scope of the current START_ELEMENT / END_ELEMENT pair. If this method is called before a START_ELEMENT has been written the uri is bound in the root scope.
| |
| setNamespaceContext | back to summary |
|---|---|
| public void setNamespaceContext(NamespaceContext ctxt) throws XMLStreamException Implements abstract com. Implements javax. Note Root namespace context works best if automatic prefix creation ("namespace/prefix repairing" in StAX lingo) is enabled.
| |
| setPrefix | back to summary |
|---|---|
| public void setPrefix(String prefix, String uri) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Sets the prefix the uri is bound to. This prefix is bound in the scope of the current START_ELEMENT / END_ELEMENT pair. If this method is called before a START_ELEMENT has been written the prefix is bound in the root scope.
| |
| writeAttribute | back to summary |
|---|---|
| public void writeAttribute(String localName, String value) throws XMLStreamException Implements abstract com. Implements javax. It's assumed calling this method implies caller just wants to add an attribute that does not belong to any namespace; as such no namespace checking or prefix generation is needed.
| |
| writeAttribute | back to summary |
|---|---|
| public abstract void writeAttribute(String nsURI, String localName, String value) throws XMLStreamException Redeclares javax. Implements abstract com. Doc from javax. Writes an attribute to the output stream
| |
| writeAttribute | back to summary |
|---|---|
| public abstract void writeAttribute(String prefix, String nsURI, String localName, String value) throws XMLStreamException Redeclares javax. Implements abstract com. Doc from javax. Writes an attribute to the output stream
| |
| writeDefaultNamespace | back to summary |
|---|---|
| public abstract void writeDefaultNamespace(String nsURI) throws XMLStreamException Redeclares javax. Implements abstract com. Doc from javax. Writes the default namespace to the stream
| |
| writeEmptyElement | back to summary |
|---|---|
| public void writeEmptyElement(String localName) throws XMLStreamException Implements abstract com. Implements javax. Note It is assumed caller just wants the element to belong to whatever is the current default namespace.
| |
| writeEmptyElement | back to summary |
|---|---|
| public void writeEmptyElement(String nsURI, String localName) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes an empty element tag to the output
| |
| writeEmptyElement | back to summary |
|---|---|
| public void writeEmptyElement(String prefix, String localName, String nsURI) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes an empty element tag to the output
| |
| writeEndElement | back to summary |
|---|---|
| public void writeEndElement() throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes an end tag to the output relying on the internal state of the writer to determine the prefix and local name of the event.
| |
| writeEndElement | back to summary |
|---|---|
| public void writeEndElement(QName name) throws XMLStreamException Implements abstract com. Method called by
| |
| writeFullEndElement | back to summary |
|---|---|
| public void writeFullEndElement() throws XMLStreamException Implements abstract com. Implements org. Similar to
| |
| writeNamespace | back to summary |
|---|---|
| public abstract void writeNamespace(String prefix, String nsURI) throws XMLStreamException Redeclares javax. Implements abstract com. Doc from javax. Writes a namespace to the output stream If the prefix argument to this method is the empty string, "xmlns", or null this method will delegate to writeDefaultNamespace
| |
| writeStartElement | back to summary |
|---|---|
| public void writeStartElement(String localName) throws XMLStreamException Implements abstract com. Implements javax. This method is assumed to just use default namespace (if any), and no further checks should be done.
| |
| writeStartElement | back to summary |
|---|---|
| public void writeStartElement(String nsURI, String localName) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes a start tag to the output
| |
| writeStartElement | back to summary |
|---|---|
| public void writeStartElement(String prefix, String localName, String nsURI) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes a start tag to the output
| |
| writeStartElement | back to summary |
|---|---|
| public abstract void writeStartElement(StartElement elem) throws XMLStreamException Implements abstract com. Doc from com. Convenience method needed by
| |
| writeStartOrEmpty | back to summary |
|---|---|
| protected abstract void writeStartOrEmpty(String localName, String nsURI) throws XMLStreamException | |
| writeStartOrEmpty | back to summary |
|---|---|
| protected abstract void writeStartOrEmpty(String prefix, String localName, String nsURI) throws XMLStreamException | |
| writeTypedAttribute | back to summary |
|---|---|
| protected void writeTypedAttribute(String prefix, String nsURI, String localName, AsciiValueEncoder enc) throws XMLStreamException Implements abstract com. Doc from com. Method that will write attribute with value that is known not to require additional escaping.
| |