Package com.sun.xml.ws.streaming
Class XMLStreamWriterUtil
- java.lang.Object
-
- com.sun.xml.ws.streaming.XMLStreamWriterUtil
-
public class XMLStreamWriterUtil extends Object
XMLStreamWriterUtil provides some utility methods intended to be used in conjunction with a StAX XMLStreamWriter.
- Author:
- [email protected]
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
encodeQName(XMLStreamWriter writer, QName qname, PrefixFactory prefixFactory)
static String
getEncoding(XMLStreamWriter writer)
Gives the encoding with which XMLStreamWriter is created.static OutputStream
getOutputStream(XMLStreamWriter writer)
Gives the underlying stream for XMLStreamWriter.
-
-
-
Method Detail
-
getOutputStream
@Nullable public static OutputStream getOutputStream(XMLStreamWriter writer) throws XMLStreamException
Gives the underlying stream for XMLStreamWriter. It closes any start elements, and returns the stream so that JAXB can write infoset directly to the stream.- Parameters:
writer
- XMLStreamWriter for which stream is required- Returns:
- underlying OutputStream, null if writer doesn't provide a way to get it
- Throws:
XMLStreamException
- if any of writer operations throw the exception
-
getEncoding
@Nullable public static String getEncoding(XMLStreamWriter writer)
Gives the encoding with which XMLStreamWriter is created.- Parameters:
writer
- XMLStreamWriter for which encoding is required- Returns:
- null if cannot be found, else the encoding
-
encodeQName
public static String encodeQName(XMLStreamWriter writer, QName qname, PrefixFactory prefixFactory)
-
-