Apache CXF API

org.apache.cxf.aegis.xml.stax
Class ElementWriter

java.lang.Object
  extended by org.apache.cxf.aegis.xml.AbstractMessageWriter
      extended by org.apache.cxf.aegis.xml.stax.ElementWriter
All Implemented Interfaces:
MessageWriter

public class ElementWriter
extends AbstractMessageWriter


Constructor Summary
ElementWriter(OutputStream os, String name, String namespace)
           
ElementWriter(XMLStreamWriter writer)
          Create an ElementWriter but without writing an element name.
ElementWriter(XMLStreamWriter streamWriter, QName name)
           
ElementWriter(XMLStreamWriter writer, String name, String namespace)
           
ElementWriter(XMLStreamWriter writer, String name, String namespace, String prefix)
           
 
Method Summary
 void close()
          Tells the MessageWriter that writing operations are completed so it can write the end element.
 void flush()
           
 MessageWriter getAttributeWriter(QName qname)
           
 MessageWriter getAttributeWriter(String nm)
           
 MessageWriter getAttributeWriter(String nm, String ns)
           
 MessageWriter getElementWriter(QName qname)
           
 MessageWriter getElementWriter(String nm)
           
 MessageWriter getElementWriter(String nm, String ns)
           
 String getNamespace()
           
 String getPrefixForNamespace(String ns)
           
 String getPrefixForNamespace(String ns, String hint)
          Get a prefix for a namespace.
 XMLStreamWriter getXMLStreamWriter()
           
 void writeValue(Object value)
           
 
Methods inherited from class org.apache.cxf.aegis.xml.AbstractMessageWriter
writeValueAsBoolean, writeValueAsByte, writeValueAsCharacter, writeValueAsDouble, writeValueAsFloat, writeValueAsInt, writeValueAsLong, writeValueAsShort, writeXsiNil, writeXsiType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementWriter

public ElementWriter(XMLStreamWriter writer)
Create an ElementWriter but without writing an element name.

Parameters:
writer -

ElementWriter

public ElementWriter(XMLStreamWriter writer,
                     String name,
                     String namespace)

ElementWriter

public ElementWriter(XMLStreamWriter streamWriter,
                     QName name)

ElementWriter

public ElementWriter(XMLStreamWriter writer,
                     String name,
                     String namespace,
                     String prefix)

ElementWriter

public ElementWriter(OutputStream os,
                     String name,
                     String namespace)
              throws XMLStreamException
Parameters:
os -
Throws:
XMLStreamException
Method Detail

writeValue

public void writeValue(Object value)
See Also:
MessageWriter.writeValue(java.lang.Object)

getElementWriter

public MessageWriter getElementWriter(String nm)
See Also:
org.apache.cxf.aegis.xml.MessageWriter#getWriter(java.lang.String)

getElementWriter

public MessageWriter getElementWriter(String nm,
                                      String ns)

getElementWriter

public MessageWriter getElementWriter(QName qname)

getNamespace

public String getNamespace()

close

public void close()
Description copied from interface: MessageWriter
Tells the MessageWriter that writing operations are completed so it can write the end element.


flush

public void flush()
           throws XMLStreamException
Throws:
XMLStreamException

getXMLStreamWriter

public XMLStreamWriter getXMLStreamWriter()

getAttributeWriter

public MessageWriter getAttributeWriter(String nm)

getAttributeWriter

public MessageWriter getAttributeWriter(String nm,
                                        String ns)

getAttributeWriter

public MessageWriter getAttributeWriter(QName qname)

getPrefixForNamespace

public String getPrefixForNamespace(String ns)

getPrefixForNamespace

public String getPrefixForNamespace(String ns,
                                    String hint)
Description copied from interface: MessageWriter
Get a prefix for a namespace. After calling this, the prefix returned is registered with the namespace.

This method will make an attempt to use the hint prefix if possible. If the namespace is already registered or the hint is already registered with a different namespace then the behavior will be the same as the non-hint version.

Parameters:
ns - the namespace to retrieve the prefix for
hint - the hint for the prefix.
Returns:
the prefix associated with the namespace

Apache CXF API

Apache CXF