Top Description Fields Constructors Methods
com.ctc.wstx.sw

public abstract Class BaseNsStreamWriter

extends TypedStreamWriter
Class Inheritance
Known Direct Subclasses
com.ctc.wstx.sw.RepairingNsStreamWriter, com.ctc.wstx.sw.SimpleNsStreamWriter
Imports
java.io.IOException, javax.xml.XMLConstants, javax.xml.namespace.NamespaceContext, .QName, javax.xml.stream.XMLStreamException, javax.xml.stream.events.StartElement, org.codehaus.stax2.ri.typed.AsciiValueEncoder, com.ctc.wstx.api.EmptyElementHandler, .WriterConfig, com.ctc.wstx.cfg.ErrorConsts, .XmlConsts, com.ctc.wstx.exc.WstxIOException, com.ctc.wstx.util.DefaultXmlSymbolTable

Mid-level base class of namespace-aware stream writers. Contains shared functionality between repairing and non-repairing implementations.

Field Summary

Modifier and TypeField 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
Inherited from com.ctc.wstx.sw.TypedStreamWriter:
mValueEncoderFactory

Constructor Summary

AccessConstructor and Description
public
BaseNsStreamWriter(XmlWriter xw, String enc, WriterConfig cfg, boolean repairing)

Method Summary

Modifier and TypeMethod 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.ctc.wstx.sw.BaseStreamWriter.closeStartElement.

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
doSetPrefix(String prefix, String uri)

protected final void
doWriteAttr(String localName, String nsURI, String prefix, String value)

protected final void
doWriteAttr(String localName, String nsURI, String prefix, char[] buf, int start, int len)

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
doWriteStartTag(String prefix, String localName)

public QName
getCurrentElementName()

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.getCurrentElementName.

Implements org.codehaus.stax2.validation.ValidationContext.getCurrentElementName.

Method that can be used to access name information of the innermost (top) element in the element stack.

public NamespaceContext
public String
getNamespaceURI(String prefix)

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.getNamespaceURI.

Implements org.codehaus.stax2.validation.ValidationContext.getNamespaceURI.

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.ctc.wstx.sw.BaseStreamWriter.getPrefix.

Implements javax.xml.stream.XMLStreamWriter.getPrefix.

Gets the prefix the uri is bound to.

protected String
getTopElementDesc()

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.getTopElementDesc.

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.xml.stream.XMLStreamWriter.setDefaultNamespace.

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.setDefaultNamespace.

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.ctc.wstx.sw.BaseStreamWriter.setNamespaceContext.

Implements javax.xml.stream.XMLStreamWriter.setNamespaceContext.

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.ctc.wstx.sw.BaseStreamWriter.setPrefix.

Implements javax.xml.stream.XMLStreamWriter.setPrefix.

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.ctc.wstx.sw.BaseStreamWriter.writeAttribute.

Implements javax.xml.stream.XMLStreamWriter.writeAttribute.

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.xml.stream.XMLStreamWriter.writeAttribute.

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeAttribute.

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.xml.stream.XMLStreamWriter.writeAttribute.

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeAttribute.

Writes an attribute to the output stream

public abstract void
writeDefaultNamespace(String
the uri to bind the default namespace to
nsURI
)

Redeclares javax.xml.stream.XMLStreamWriter.writeDefaultNamespace.

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeDefaultNamespace.

Writes the default namespace to the stream

public void
writeEmptyElement(String
local name of the tag, may not be null
localName
)

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeEmptyElement.

Implements javax.xml.stream.XMLStreamWriter.writeEmptyElement.

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.ctc.wstx.sw.BaseStreamWriter.writeEmptyElement.

Implements javax.xml.stream.XMLStreamWriter.writeEmptyElement.

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.ctc.wstx.sw.BaseStreamWriter.writeEmptyElement.

Implements javax.xml.stream.XMLStreamWriter.writeEmptyElement.

Writes an empty element tag to the output

public void
writeEndElement()

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeEndElement.

Implements javax.xml.stream.XMLStreamWriter.writeEndElement.

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.ctc.wstx.sw.BaseStreamWriter.writeEndElement.

Method called by javax.xml.stream.XMLEventWriter implementation (instead of the version that takes no argument), so that we can verify it does match the start element, if necessary

public void
writeFullEndElement()

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeFullEndElement.

Implements org.codehaus.stax2.XMLStreamWriter2.writeFullEndElement.

Similar to writeEndElement, but never allows implicit creation of empty elements.

public abstract void
writeNamespace(String
the prefix to bind this namespace to
prefix
,
String
the uri to bind the prefix to
nsURI
)

Redeclares javax.xml.stream.XMLStreamWriter.writeNamespace.

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeNamespace.

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.ctc.wstx.sw.BaseStreamWriter.writeStartElement.

Implements javax.xml.stream.XMLStreamWriter.writeStartElement.

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.ctc.wstx.sw.BaseStreamWriter.writeStartElement.

Implements javax.xml.stream.XMLStreamWriter.writeStartElement.

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.ctc.wstx.sw.BaseStreamWriter.writeStartElement.

Implements javax.xml.stream.XMLStreamWriter.writeStartElement.

Writes a start tag to the output

public abstract void
writeStartElement(StartElement elem)

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeStartElement.

Convenience method needed by javax.xml.stream.XMLEventWriter implementation, to use when writing a start element, and possibly its attributes and namespace declarations.

protected abstract void
writeStartOrEmpty(String localName, String nsURI)

protected abstract void
writeStartOrEmpty(String prefix, String localName, String nsURI)

protected void
writeTypedAttribute(String prefix, String nsURI, String localName, AsciiValueEncoder enc)

Implements abstract com.ctc.wstx.sw.TypedStreamWriter.writeTypedAttribute.

Method that will write attribute with value that is known not to require additional escaping.

Inherited from com.ctc.wstx.sw.TypedStreamWriter:
valueEncoderFactorywriteBinarywriteBinarywriteBinaryAttributewriteBinaryAttributewriteBooleanwriteBooleanAttributewriteDecimalwriteDecimalAttributewriteDoublewriteDoubleArraywriteDoubleArrayAttributewriteDoubleAttributewriteFloatwriteFloatArraywriteFloatArrayAttributewriteFloatAttributewriteIntwriteIntArraywriteIntArrayAttributewriteIntAttributewriteIntegerwriteIntegerAttributewriteLongwriteLongArraywriteLongArrayAttributewriteLongAttributewriteQNamewriteQNameAttributewriteTypedElement

Field Detail

ERR_NSDECL_WRONG_STATEback to summary
protected static final String ERR_NSDECL_WRONG_STATE
mAutomaticNSback to summary
protected final boolean mAutomaticNS

True, if writer needs to automatically output namespace declarations (we are in repairing mode)

MAX_POOL_SIZEback 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.

mCurrElemback to summary
protected SimpleOutputElement mCurrElem
mEmptyElementHandlerback to summary
protected final EmptyElementHandler mEmptyElementHandler
mOutputElemPoolback to summary
protected SimpleOutputElement mOutputElemPool
mPoolSizeback to summary
protected int mPoolSize
mRootNsContextback to summary
protected NamespaceContext mRootNsContext

Optional "root" namespace context that application can set. If so, it can be used to lookup namespace/prefix mappings

sPrefixXmlback to summary
protected static final String sPrefixXml
sPrefixXmlnsback to summary
protected static final String sPrefixXmlns

Constructor Detail

BaseNsStreamWriterback to summary
public BaseNsStreamWriter(XmlWriter xw, String enc, WriterConfig cfg, boolean repairing)

Method Detail

checkStartElementback 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).

closeStartElementback to summary
protected void closeStartElement(boolean emptyElem) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.closeStartElement.

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.

Parameters
emptyElem:boolean

If true, the element being closed is an empty element; if false, a separate stand-alone start element.

Annotations
@Override
doSetPrefixback to summary
public abstract void doSetPrefix(String prefix, String uri) throws XMLStreamException
doWriteAttrback to summary
protected final void doWriteAttr(String localName, String nsURI, String prefix, String value) throws XMLStreamException
doWriteAttrback to summary
protected final void doWriteAttr(String localName, String nsURI, String prefix, char[] buf, int start, int len) throws XMLStreamException
doWriteDefaultNsback to summary
protected void doWriteDefaultNs(String nsURI) throws XMLStreamException
doWriteEndTagback to summary
protected void doWriteEndTag(QName expName, boolean allowEmpty) throws XMLStreamException
Parameters
expName:QName

Name that the closing element should have; null if whatever is in stack should be used

allowEmpty: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

doWriteNamespaceback to summary
protected void doWriteNamespace(String prefix, String nsURI) throws XMLStreamException
doWriteStartTagback to summary
protected final void doWriteStartTag(String localName) throws XMLStreamException
doWriteStartTagback to summary
protected final void doWriteStartTag(String prefix, String localName) throws XMLStreamException
getCurrentElementNameback to summary
public QName getCurrentElementName()

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.getCurrentElementName.

Implements org.codehaus.stax2.validation.ValidationContext.getCurrentElementName.

Doc from org.codehaus.stax2.validation.ValidationContext.getCurrentElementName.

Method that can be used to access name information of the innermost (top) element in the element stack.

Returns:QName

Name of the element at the top of the current element stack, if any. During validation calls it refers to the element being processed (start or end tag), or its parent (when processing text nodes), or null (in document prolog and epilog).

Annotations
@Override
getNamespaceContextback to summary
public NamespaceContext getNamespaceContext()

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.getNamespaceContext.

Implements javax.xml.stream.XMLStreamWriter.getNamespaceContext.

Doc from javax.xml.stream.XMLStreamWriter.getNamespaceContext.

Returns the current namespace context.

Returns:NamespaceContext

the current NamespaceContext

Annotations
@Override
getNamespaceURIback to summary
public String getNamespaceURI(String prefix)

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.getNamespaceURI.

Implements org.codehaus.stax2.validation.ValidationContext.getNamespaceURI.

Doc from org.codehaus.stax2.validation.ValidationContext.getNamespaceURI.

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).

Annotations
@Override
getPrefixback to summary
public String getPrefix(String uri)

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.getPrefix.

Implements javax.xml.stream.XMLStreamWriter.getPrefix.

Doc from javax.xml.stream.XMLStreamWriter.getPrefix.

Gets the prefix the uri is bound to.

Parameters
uri:String

the uri the prefix is bound to

Returns:String

the prefix or null

Annotations
@Override
getTopElementDescback to summary
protected String getTopElementDesc()

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.getTopElementDesc.

Doc from com.ctc.wstx.sw.BaseStreamWriter.getTopElementDesc.

Method needed for error message generation

Annotations
@Override
setDefaultNamespaceback to summary
public abstract void setDefaultNamespace(String uri) throws XMLStreamException

Redeclares javax.xml.stream.XMLStreamWriter.setDefaultNamespace.

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.setDefaultNamespace.

Doc from javax.xml.stream.XMLStreamWriter.setDefaultNamespace.

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.

Parameters
uri:String

the uri to bind to the default namespace, may be null

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
setNamespaceContextback to summary
public void setNamespaceContext(NamespaceContext ctxt) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.setNamespaceContext.

Implements javax.xml.stream.XMLStreamWriter.setNamespaceContext.

Note

Root namespace context works best if automatic prefix creation ("namespace/prefix repairing" in StAX lingo) is enabled.

Parameters
ctxt:NamespaceContext

Doc from javax.xml.stream.XMLStreamWriter.setNamespaceContext.

the namespace context to use for this writer, may not be null

Annotations
@Override
Exceptions
XMLStreamException:

Doc from javax.xml.stream.XMLStreamWriter.setNamespaceContext.

if an error occurs

setPrefixback to summary
public void setPrefix(String prefix, String uri) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.setPrefix.

Implements javax.xml.stream.XMLStreamWriter.setPrefix.

Doc from javax.xml.stream.XMLStreamWriter.setPrefix.

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.

Parameters
prefix:String

the prefix to bind to the uri, may not be null

uri:String

the uri to bind to the prefix, may be null

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
writeAttributeback to summary
public void writeAttribute(String localName, String value) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeAttribute.

Implements javax.xml.stream.XMLStreamWriter.writeAttribute.

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.

Parameters
localName:String

Doc from javax.xml.stream.XMLStreamWriter.writeAttribute.

the local name of the attribute

value:String

Doc from javax.xml.stream.XMLStreamWriter.writeAttribute.

the value of the attribute

Annotations
@Override
Exceptions
XMLStreamException:

Doc from javax.xml.stream.XMLStreamWriter.writeAttribute.

if an error occurs

writeAttributeback to summary
public abstract void writeAttribute(String nsURI, String localName, String value) throws XMLStreamException

Redeclares javax.xml.stream.XMLStreamWriter.writeAttribute.

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeAttribute.

Doc from javax.xml.stream.XMLStreamWriter.writeAttribute.

Writes an attribute to the output stream

Parameters
nsURI:String

the uri of the prefix for this attribute

localName:String

the local name of the attribute

value:String

the value of the attribute

Annotations
@Override
Exceptions
XMLStreamException:
if the namespace URI has not been bound to a prefix and javax.xml.stream.isRepairingNamespaces has not been set to true
writeAttributeback to summary
public abstract void writeAttribute(String prefix, String nsURI, String localName, String value) throws XMLStreamException

Redeclares javax.xml.stream.XMLStreamWriter.writeAttribute.

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeAttribute.

Doc from javax.xml.stream.XMLStreamWriter.writeAttribute.

Writes an attribute to the output stream

Parameters
prefix:String

the prefix for this attribute

nsURI:String

the uri of the prefix for this attribute

localName:String

the local name of the attribute

value:String

the value of the attribute

Annotations
@Override
Exceptions
XMLStreamException:
if the namespace URI has not been bound to a prefix and javax.xml.stream.isRepairingNamespaces has not been set to true
writeDefaultNamespaceback to summary
public abstract void writeDefaultNamespace(String nsURI) throws XMLStreamException

Redeclares javax.xml.stream.XMLStreamWriter.writeDefaultNamespace.

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeDefaultNamespace.

Doc from javax.xml.stream.XMLStreamWriter.writeDefaultNamespace.

Writes the default namespace to the stream

Parameters
nsURI:String

the uri to bind the default namespace to

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
writeEmptyElementback to summary
public void writeEmptyElement(String localName) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeEmptyElement.

Implements javax.xml.stream.XMLStreamWriter.writeEmptyElement.

Note

It is assumed caller just wants the element to belong to whatever is the current default namespace.

Parameters
localName:String

Doc from javax.xml.stream.XMLStreamWriter.writeEmptyElement.

local name of the tag, may not be null

Annotations
@Override
Exceptions
XMLStreamException:

Doc from javax.xml.stream.XMLStreamWriter.writeEmptyElement.

if an error occurs

writeEmptyElementback to summary
public void writeEmptyElement(String nsURI, String localName) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeEmptyElement.

Implements javax.xml.stream.XMLStreamWriter.writeEmptyElement.

Doc from javax.xml.stream.XMLStreamWriter.writeEmptyElement.

Writes an empty element tag to the output

Parameters
nsURI:String

the uri to bind the tag to, may not be null

localName:String

local name of the tag, may not be null

Annotations
@Override
Exceptions
XMLStreamException:
if the namespace URI has not been bound to a prefix and javax.xml.stream.isRepairingNamespaces has not been set to true
writeEmptyElementback to summary
public void writeEmptyElement(String prefix, String localName, String nsURI) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeEmptyElement.

Implements javax.xml.stream.XMLStreamWriter.writeEmptyElement.

Doc from javax.xml.stream.XMLStreamWriter.writeEmptyElement.

Writes an empty element tag to the output

Parameters
prefix:String

the prefix of the tag, may not be null

localName:String

local name of the tag, may not be null

nsURI:String

the uri to bind the tag to, may not be null

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
writeEndElementback to summary
public void writeEndElement() throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeEndElement.

Implements javax.xml.stream.XMLStreamWriter.writeEndElement.

Doc from javax.xml.stream.XMLStreamWriter.writeEndElement.

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.

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
writeEndElementback to summary
public void writeEndElement(QName name) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeEndElement.

Method called by javax.xml.stream.XMLEventWriter implementation (instead of the version that takes no argument), so that we can verify it does match the start element, if necessary

Annotations
@Override
writeFullEndElementback to summary
public void writeFullEndElement() throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeFullEndElement.

Implements org.codehaus.stax2.XMLStreamWriter2.writeFullEndElement.

Similar to writeEndElement, but never allows implicit creation of empty elements.

Annotations
@Override
writeNamespaceback to summary
public abstract void writeNamespace(String prefix, String nsURI) throws XMLStreamException

Redeclares javax.xml.stream.XMLStreamWriter.writeNamespace.

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeNamespace.

Doc from javax.xml.stream.XMLStreamWriter.writeNamespace.

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

Parameters
prefix:String

the prefix to bind this namespace to

nsURI:String

the uri to bind the prefix to

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
writeStartElementback to summary
public void writeStartElement(String localName) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeStartElement.

Implements javax.xml.stream.XMLStreamWriter.writeStartElement.

This method is assumed to just use default namespace (if any), and no further checks should be done.

Parameters
localName:String

Doc from javax.xml.stream.XMLStreamWriter.writeStartElement.

local name of the tag, may not be null

Annotations
@Override
Exceptions
XMLStreamException:

Doc from javax.xml.stream.XMLStreamWriter.writeStartElement.

if an error occurs

writeStartElementback to summary
public void writeStartElement(String nsURI, String localName) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeStartElement.

Implements javax.xml.stream.XMLStreamWriter.writeStartElement.

Doc from javax.xml.stream.XMLStreamWriter.writeStartElement.

Writes a start tag to the output

Parameters
nsURI:String

the namespaceURI of the prefix to use, may not be null

localName:String

local name of the tag, may not be null

Annotations
@Override
Exceptions
XMLStreamException:
if the namespace URI has not been bound to a prefix and javax.xml.stream.isRepairingNamespaces has not been set to true
writeStartElementback to summary
public void writeStartElement(String prefix, String localName, String nsURI) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeStartElement.

Implements javax.xml.stream.XMLStreamWriter.writeStartElement.

Doc from javax.xml.stream.XMLStreamWriter.writeStartElement.

Writes a start tag to the output

Parameters
prefix:String

the prefix of the tag, may not be null

localName:String

local name of the tag, may not be null

nsURI:String

the uri to bind the prefix to, may not be null

Annotations
@Override
Exceptions
XMLStreamException:
if an error occurs
writeStartElementback to summary
public abstract void writeStartElement(StartElement elem) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.BaseStreamWriter.writeStartElement.

Doc from com.ctc.wstx.sw.BaseStreamWriter.writeStartElement.

Convenience method needed by javax.xml.stream.XMLEventWriter implementation, to use when writing a start element, and possibly its attributes and namespace declarations.

Annotations
@Override
writeStartOrEmptyback to summary
protected abstract void writeStartOrEmpty(String localName, String nsURI) throws XMLStreamException
writeStartOrEmptyback to summary
protected abstract void writeStartOrEmpty(String prefix, String localName, String nsURI) throws XMLStreamException
writeTypedAttributeback to summary
protected void writeTypedAttribute(String prefix, String nsURI, String localName, AsciiValueEncoder enc) throws XMLStreamException

Implements abstract com.ctc.wstx.sw.TypedStreamWriter.writeTypedAttribute.

Doc from com.ctc.wstx.sw.TypedStreamWriter.writeTypedAttribute.

Method that will write attribute with value that is known not to require additional escaping.

Annotations
@Override