org.codehaus.stax2.ri
Class Stax2EventWriterImpl

java.lang.Object
  extended by org.codehaus.stax2.ri.Stax2EventWriterImpl
All Implemented Interfaces:
XMLEventConsumer, XMLEventWriter, XMLStreamConstants

public class Stax2EventWriterImpl
extends Object
implements XMLEventWriter, XMLStreamConstants

Simple implementation of XMLEventWriter.


Field Summary
 
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
 
Constructor Summary
Stax2EventWriterImpl(XMLStreamWriter2 sw)
           
 
Method Summary
 void add(XMLEvent event)
          Basic implementation of the method which will use event implementations available as part of the reference implementation.
 void add(XMLEventReader reader)
           
 void close()
           
 void flush()
           
 NamespaceContext getNamespaceContext()
           
 String getPrefix(String uri)
           
 void setDefaultNamespace(String uri)
           
 void setNamespaceContext(NamespaceContext ctxt)
           
 void setPrefix(String prefix, String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stax2EventWriterImpl

public Stax2EventWriterImpl(XMLStreamWriter2 sw)
Method Detail

add

public void add(XMLEvent event)
         throws XMLStreamException
Basic implementation of the method which will use event implementations available as part of the reference implementation.

Note: ALL events (except for custom ones ref. impl. itself doesn't produce, and thus may not always be able to deal with) are routed through stream writer. This because it may want to do different kinds of validation

Specified by:
add in interface XMLEventConsumer
Specified by:
add in interface XMLEventWriter
Throws:
XMLStreamException

add

public void add(XMLEventReader reader)
         throws XMLStreamException
Specified by:
add in interface XMLEventWriter
Throws:
XMLStreamException

close

public void close()
           throws XMLStreamException
Specified by:
close in interface XMLEventWriter
Throws:
XMLStreamException

flush

public void flush()
           throws XMLStreamException
Specified by:
flush in interface XMLEventWriter
Throws:
XMLStreamException

getNamespaceContext

public NamespaceContext getNamespaceContext()
Specified by:
getNamespaceContext in interface XMLEventWriter

getPrefix

public String getPrefix(String uri)
                 throws XMLStreamException
Specified by:
getPrefix in interface XMLEventWriter
Throws:
XMLStreamException

setDefaultNamespace

public void setDefaultNamespace(String uri)
                         throws XMLStreamException
Specified by:
setDefaultNamespace in interface XMLEventWriter
Throws:
XMLStreamException

setNamespaceContext

public void setNamespaceContext(NamespaceContext ctxt)
                         throws XMLStreamException
Specified by:
setNamespaceContext in interface XMLEventWriter
Throws:
XMLStreamException

setPrefix

public void setPrefix(String prefix,
                      String uri)
               throws XMLStreamException
Specified by:
setPrefix in interface XMLEventWriter
Throws:
XMLStreamException


Copyright © 2011 Codehaus. All Rights Reserved.