com.sun.xml.ws.streaming
Class XMLStreamWriterUtil

java.lang.Object
  extended by com.sun.xml.ws.streaming.XMLStreamWriterUtil

public class XMLStreamWriterUtil
extends java.lang.Object

XMLStreamWriterUtil provides some utility methods intended to be used in conjunction with a StAX XMLStreamWriter.


Method Summary
static java.lang.String encodeQName(javax.xml.stream.XMLStreamWriter writer, javax.xml.namespace.QName qname, PrefixFactory prefixFactory)
           
static java.lang.String getEncoding(javax.xml.stream.XMLStreamWriter writer)
          Gives the encoding with which XMLStreamWriter is created.
static java.io.OutputStream getOutputStream(javax.xml.stream.XMLStreamWriter writer)
          Gives the underlying stream for XMLStreamWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getOutputStream

@Nullable
public static java.io.OutputStream getOutputStream(javax.xml.stream.XMLStreamWriter writer)
                                            throws javax.xml.stream.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:
javax.xml.stream.XMLStreamException - if any of writer operations throw the exception

getEncoding

@Nullable
public static java.lang.String getEncoding(javax.xml.stream.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 java.lang.String encodeQName(javax.xml.stream.XMLStreamWriter writer,
                                           javax.xml.namespace.QName qname,
                                           PrefixFactory prefixFactory)


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.