| java.lang.Object java.util.AbstractMap com.sun.xml.stream.writers.XMLStreamWriterImpl
XMLStreamWriterImpl | final public class XMLStreamWriterImpl extends AbstractMap implements XMLStreamWriter(Code) | | This class implements a StAX XMLStreamWriter. It extends
AbstractMap in order to support a getter for
implementation-specific properties. For example, you can get
the underlying OutputStream by casting an instance
of this class to Map and calling
getProperty(OUTPUTSTREAM_PROPERTY) .
author: Neeraj Bajaj author: K.Venugopal author: Santiago.Pericas-Geertsen@sun.com author: Sunitha.Reddy@sun.com |
Inner Class :protected class ElementStack | |
Inner Class :class ElementState extends QName | |
Inner Class :class Attribute extends QName | |
Method Summary | |
public boolean | canReuse() | void | checkForNull(QName attr) | public void | close() Close this XMLStreamWriter by closing underlying writer. | public boolean | containsKey(Object key) | void | correctPrefix(QName attr1, QName attr2) | public java.util.Set | entrySet() | public void | flush() Flush this XMLStreamWriter by flushin underlying writer. | public Object | get(Object key) Returns the value associated to an implementation-specific
property. | public boolean | getEscapeCharacters() | public NamespaceContext | getNamespaceContext() Return NamespaceContext being used by the writer. | public String | getPrefix(String uri) Return a prefix associated with specified uri, or null if the
uri is unknown. | public Object | getProperty(String str) Returns value associated with the specified property name. | boolean | isDeclared(QName attr) | public boolean | isEmpty() | void | removeDuplicateDecls() | protected void | repair() Correct's namespaces as per requirements of isReparisingNamespace property. | void | repairNamespaceDecl(QName attr) | public void | reset() Reset this instance so that it can be re-used. | void | reset(boolean resetProperties) Reset this instance so that it can be re-used. | public void | setDefaultNamespace(String uri) Set the specified URI as default namespace in the current namespace context. | public void | setEscapeCharacters(boolean escape) | public void | setNamespaceContext(NamespaceContext namespaceContext) Sets the current NamespaceContext for prefix and uri bindings.
This context becomes the root namespace context for writing and
will replace the current root namespace context. | public void | setOutput(StreamResult sr, String encoding) Use a StreamResult to initialize the output for this XMLStreamWriter. | public void | setPrefix(String prefix, String uri) Sets the prefix the uri is bound to. | public int | size() | public void | writeAttribute(String localName, String value) | public void | writeAttribute(String namespaceURI, String localName, String value) | public void | writeAttribute(String prefix, String namespaceURI, String localName, String value) | public void | writeCData(String cdata) | public void | writeCharacters(String data) | public void | writeCharacters(char[] data, int start, int len) | public void | writeComment(String comment) | public void | writeDTD(String dtd) | public void | writeDefaultNamespace(String namespaceURI) | public void | writeEmptyElement(String localName) | public void | writeEmptyElement(String namespaceURI, String localName) | public void | writeEmptyElement(String prefix, String localName, String namespaceURI) | public void | writeEndDocument() | public void | writeEndElement() | public void | writeEntityRef(String refName) | public void | writeNamespace(String prefix, String namespaceURI) Write a Namespace declaration.
If namespaceURI == null,
then it is assumed to be equivilent to
XMLConstants.NULL_NS_URI ,
i.e. | public void | writeProcessingInstruction(String target) | public void | writeProcessingInstruction(String target, String data) | public void | writeStartDocument() | public void | writeStartDocument(String version) | public void | writeStartDocument(String encoding, String version) | public void | writeStartElement(String localName) | public void | writeStartElement(String namespaceURI, String localName) | public void | writeStartElement(String prefix, String localName, String namespaceURI) |
CLOSE_EMPTY_ELEMENT | final public static String CLOSE_EMPTY_ELEMENT(Code) | | |
CLOSE_END_TAG | final public static char CLOSE_END_TAG(Code) | | |
CLOSE_START_TAG | final public static char CLOSE_START_TAG(Code) | | |
DEFAULT_ENCODING | final public static String DEFAULT_ENCODING(Code) | | |
DEFAULT_XMLDECL | final public static String DEFAULT_XMLDECL(Code) | | |
DEFAULT_XML_VERSION | final public static String DEFAULT_XML_VERSION(Code) | | |
OPEN_START_TAG | final public static char OPEN_START_TAG(Code) | | |
OUTPUTSTREAM_PROPERTY | final public static String OUTPUTSTREAM_PROPERTY(Code) | | |
fEscapeCharacters | boolean fEscapeCharacters(Code) | | This flag can be used to turn escaping off for content. It does
not apply to attribute content.
|
XMLStreamWriterImpl | public XMLStreamWriterImpl(OutputStream outputStream, PropertyManager props) throws IOException(Code) | | Creates a new instance of XMLStreamWriterImpl. Uses platform's default
encoding.
Parameters: outputStream - Underlying stream to write the bytes to Parameters: props - Properties used by this writer |
XMLStreamWriterImpl | public XMLStreamWriterImpl(OutputStream outputStream, String encoding, PropertyManager props) throws java.io.IOException(Code) | | Creates a new instance of XMLStreamWriterImpl.
Parameters: outputStream - Underlying stream to write the bytes Parameters: encoding - Encoding used to convert chars into bytes Parameters: props - Properties used by this writer |
XMLStreamWriterImpl | public XMLStreamWriterImpl(Writer writer, PropertyManager props) throws java.io.IOException(Code) | | Creates a new instance of XMLStreamWriterImpl using a Writer.
Parameters: writer - Underlying writer to which chars are written Parameters: props - Properties used by this writer |
XMLStreamWriterImpl | public XMLStreamWriterImpl(StreamResult sr, String encoding, PropertyManager props) throws java.io.IOException(Code) | | Creates a new instance of XMLStreamWriterImpl using a StreamResult.
A StreamResult encasupates an OutputStream, a Writer or a SystemId.
Parameters: writer - Underlying writer to which chars are written Parameters: props - Properties used by this writer |
canReuse | public boolean canReuse()(Code) | | Can this instance be reused
boolean boolean value to indicate if this instance can be reused or not |
get | public Object get(Object key)(Code) | | Returns the value associated to an implementation-specific
property.
|
getEscapeCharacters | public boolean getEscapeCharacters()(Code) | | |
getNamespaceContext | public NamespaceContext getNamespaceContext()(Code) | | Return NamespaceContext being used by the writer.
NamespaceContext |
isEmpty | public boolean isEmpty()(Code) | | |
removeDuplicateDecls | void removeDuplicateDecls()(Code) | | |
repair | protected void repair()(Code) | | Correct's namespaces as per requirements of isReparisingNamespace property.
|
repairNamespaceDecl | void repairNamespaceDecl(QName attr)(Code) | | |
reset | public void reset()(Code) | | Reset this instance so that it can be re-used. Do not read properties
again. The method setOutput(StreamResult, encoding) must
be called after this one.
|
reset | void reset(boolean resetProperties)(Code) | | Reset this instance so that it can be re-used. Clears but does not
re-allocate internal data structures.
Parameters: resetProperties - Indicates if properties should be read again |
setDefaultNamespace | public void setDefaultNamespace(String uri) throws XMLStreamException(Code) | | Set the specified URI as default namespace in the current namespace context.
Parameters: uri - Namespace URI |
setEscapeCharacters | public void setEscapeCharacters(boolean escape)(Code) | | |
setNamespaceContext | public void setNamespaceContext(NamespaceContext namespaceContext) throws XMLStreamException(Code) | | Sets the current NamespaceContext for prefix and uri bindings.
This context becomes the root namespace context for writing and
will replace the current root namespace context. Subsequent calls
to setPrefix and setDefaultNamespace will bind namespaces using
the context passed to the method as the root context for resolving
namespaces. This method may only be called once at the start of the
document. It does not cause the namespaces to be declared. If a
namespace URI to prefix mapping is found in the namespace context
it is treated as declared and the prefix may be used by the
XMLStreamWriter .
Parameters: namespaceContext - the namespace context to use for this writer, may not be null throws: XMLStreamException - |
setOutput | public void setOutput(StreamResult sr, String encoding) throws IOException(Code) | | Use a StreamResult to initialize the output for this XMLStreamWriter. Check
for OutputStream, Writer and then systemId, in that order.
Parameters: sr - StreamResult encapsulating output information Parameters: encoding - Encoding to be used except when a Writer is available |
setPrefix | public void setPrefix(String prefix, String uri) throws XMLStreamException(Code) | | 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 - Parameters: uri - throws: XMLStreamException - |
|
|