Package com.sun.xml.rpc.streaming
Class StAXWriter
java.lang.Object
com.sun.xml.rpc.streaming.XMLWriterBase
com.sun.xml.rpc.streaming.StAXWriter
- All Implemented Interfaces:
XMLWriter
An implementation of XMLWriter that uses StAX
-
Constructor Summary
ConstructorDescriptionStAXWriter
(OutputStream out, String enc, boolean declare) StAXWriter
(OutputStream out, String enc, boolean declare, XMLStreamWriter writer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the writer and its underlying stream.void
Write the end tag for the current element.void
flush()
Flush the writer and its underlying stream.Return a prefix for the given URI.Return the prefix factory in use by this writer.Return the URI for a given prefix.Returns the StAX XMLStreamWriter that is being used.void
setPrefixFactory
(PrefixFactory factory) Set the prefix factory to be used by this writer.void
startElement
(String localName, String uri) Write the start tag for an element.void
startElement
(String localName, String uri, String prefix) Write the start tag for an element.void
writeAttribute
(String localName, String uri, String value) Write an attribute of the current element.void
writeAttributeUnquoted
(String localName, String uri, String value) Write an attribute (unquoted) of the current element.void
writeChars
(CDATA chars) Write character data within an element.void
writeChars
(String chars) Write character data within an element.void
writeCharsUnquoted
(char[] buf, int offset, int len) If the first character of the string is an opening bracket, then this method assumes that the string is xml and it parses the string to write out the correct xml representation.void
writeCharsUnquoted
(String chars) If the first character of the string is an opening bracket, then this method assumes that the string is xml and it parses the string to write out the correct xml representation.void
writeComment
(String comment) Write a comment within an element.void
Write a namespace declaration of the current element.void
writeNamespaceDeclaration
(String prefix, String uri) Write a namespace declaration of the current element.Methods inherited from class com.sun.xml.rpc.streaming.XMLWriterBase
startElement, startElement, startElement, writeAttribute, writeAttribute, writeAttributeUnquoted, writeAttributeUnquoted
-
Constructor Details
-
StAXWriter
-
StAXWriter
-
-
Method Details
-
getXMLStreamWriter
Returns the StAX XMLStreamWriter that is being used. -
startElement
Description copied from interface:XMLWriter
Write the start tag for an element. -
startElement
Description copied from interface:XMLWriter
Write the start tag for an element. -
writeAttribute
Description copied from interface:XMLWriter
Write an attribute of the current element. -
writeAttributeUnquoted
Description copied from interface:XMLWriter
Write an attribute (unquoted) of the current element. -
writeChars
Description copied from interface:XMLWriter
Write character data within an element.- Specified by:
writeChars
in interfaceXMLWriter
- Specified by:
writeChars
in classXMLWriterBase
-
writeChars
Description copied from interface:XMLWriter
Write character data within an element.- Specified by:
writeChars
in interfaceXMLWriter
- Specified by:
writeChars
in classXMLWriterBase
-
writeCharsUnquoted
If the first character of the string is an opening bracket, then this method assumes that the string is xml and it parses the string to write out the correct xml representation. This is because there is no api in stax to write unescaped characters. -
writeCharsUnquoted
public void writeCharsUnquoted(char[] buf, int offset, int len) If the first character of the string is an opening bracket, then this method assumes that the string is xml and it parses the string to write out the correct xml representation. This is because there is no api in stax to write unescaped characters. -
writeComment
Description copied from interface:XMLWriter
Write a comment within an element.- Specified by:
writeComment
in interfaceXMLWriter
- Overrides:
writeComment
in classXMLWriterBase
-
writeNamespaceDeclaration
Description copied from interface:XMLWriter
Write a namespace declaration of the current element. -
writeNamespaceDeclaration
Description copied from interface:XMLWriter
Write a namespace declaration of the current element. The prefix name will be generated by the PrefixFactory currently configured for this writer. -
endElement
public void endElement()Description copied from interface:XMLWriter
Write the end tag for the current element. -
close
public void close()Description copied from interface:XMLWriter
Close the writer and its underlying stream. -
flush
public void flush()Description copied from interface:XMLWriter
Flush the writer and its underlying stream. -
getPrefix
Description copied from interface:XMLWriter
Return a prefix for the given URI.If no prefix for the given URI is in scope, return null.
-
getURI
Description copied from interface:XMLWriter
Return the URI for a given prefix. If the prefix is undeclared, return null. -
getPrefixFactory
Description copied from interface:XMLWriter
Return the prefix factory in use by this writer. -
setPrefixFactory
Description copied from interface:XMLWriter
Set the prefix factory to be used by this writer.
-