| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.dom4j.io.STAXEventWriter
Writes DOM4J Nodes to a StAX event stream. In addition the
 createXXX methods are provided to directly create STAX events
 from DOM4J nodes.
| Constructor Summary | |
| STAXEventWriter() | |
| STAXEventWriter(File file)Constructs a STAXEventWriterthat writes events to the
 provided file. | |
| STAXEventWriter(OutputStream stream)Constructs a STAXEventWriterthat writes events to the
 provided stream. | |
| STAXEventWriter(Writer writer)Constructs a STAXEventWriterthat writes events to the
 provided character stream. | |
| STAXEventWriter(javax.xml.stream.util.XMLEventConsumer consumer)Constructs a STAXEventWriterthat writes events to the
 provided event stream. | |
| Method Summary | |
|  javax.xml.stream.events.Attribute | createAttribute(Attribute attr)Constructs a STAX Attributeevent from a
 DOM4JAttribute. | 
|  javax.xml.stream.events.Characters | createCharacters(CDATA cdata)Constructs a STAX Charactersevent from a DOM4JCDATA. | 
|  javax.xml.stream.events.Characters | createCharacters(Text text)Constructs a STAX Charactersevent from a DOM4JText. | 
|  javax.xml.stream.events.Comment | createComment(Comment comment)Constructs a STAX Commentevent from a
 DOM4JComment. | 
|  javax.xml.stream.events.DTD | createDTD(DocumentType docType)Constructs a STAX DTDevent from a DOM4JDocumentType. | 
|  javax.xml.stream.events.EndDocument | createEndDocument(Document doc)Constructs a STAX EndDocumentevent from a DOM4JDocument. | 
|  javax.xml.stream.events.EndElement | createEndElement(Element elem)Constructs a STAX EndElementevent from a DOM4JElement. | 
|  javax.xml.stream.events.Namespace | createNamespace(Namespace ns)Constructs a STAX Namespaceevent from a
 DOM4JNamespace. | 
|  javax.xml.stream.events.ProcessingInstruction | createProcessingInstruction(ProcessingInstruction pi)Constructs a STAX ProcessingInstructionevent from a DOM4JProcessingInstruction. | 
|  javax.xml.namespace.QName | createQName(QName qname)Constructs a STAX QNamefrom a DOM4JQName. | 
|  javax.xml.stream.events.StartDocument | createStartDocument(Document doc)Constructs a STAX StartDocumentevent from a DOM4JDocument. | 
|  javax.xml.stream.events.StartElement | createStartElement(Element elem)Constructs a STAX StartElementevent from a DOM4JElement. | 
|  javax.xml.stream.util.XMLEventConsumer | getConsumer()Returns a reference to the underlying event consumer to which events are written. | 
|  javax.xml.stream.XMLEventFactory | getEventFactory()Returns a reference to the event factory used to construct STAX events. | 
|  void | setConsumer(javax.xml.stream.util.XMLEventConsumer consumer)Sets the underlying event consumer to which events are written. | 
|  void | setEventFactory(javax.xml.stream.XMLEventFactory eventFactory)Sets the event factory used to construct STAX events. | 
|  void | writeAttribute(Attribute attr)Writes a DOM4J Attributeto the stream. | 
|  void | writeCDATA(CDATA cdata)Writes a DOM4J CDATAto the event stream. | 
|  void | writeChildNodes(Branch branch)Writes each child node within the provided Branchinstance. | 
|  void | writeComment(Comment comment)Writes a DOM4J Commentto the stream. | 
|  void | writeDocument(Document doc)Writes a DOM4J Documentnode, and all its contents, to the
 stream. | 
|  void | writeDocumentType(DocumentType docType)Writes a DOM4J DocumentTypeto the stream. | 
|  void | writeElement(Element elem)Writes a DOM4J Elementnode and its children to the stream. | 
|  void | writeEntity(Entity entity)Writes a DOM4J Entityto the stream. | 
|  void | writeNamespace(Namespace ns)Writes a DOM4J Namespaceto the stream. | 
|  void | writeNode(Node n)Writes a DOM4J Nodeto the stream. | 
|  void | writeProcessingInstruction(ProcessingInstruction pi)Writes a DOM4J ProcessingInstructionto the stream. | 
|  void | writeText(Text text)Writes a DOM4J Textto the stream. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public STAXEventWriter()
public STAXEventWriter(File file)
                throws javax.xml.stream.XMLStreamException,
                       IOException
STAXEventWriter that writes events to the
 provided file.
file - The file to which events will be written.
javax.xml.stream.XMLStreamException - If an error occurs creating an event writer from the file.
IOException - If an error occurs openin the file for writing.
public STAXEventWriter(Writer writer)
                throws javax.xml.stream.XMLStreamException
STAXEventWriter that writes events to the
 provided character stream.
writer - The character stream to which events will be written.
javax.xml.stream.XMLStreamException - If an error occurs constructing an event writer from the
             character stream.
public STAXEventWriter(OutputStream stream)
                throws javax.xml.stream.XMLStreamException
STAXEventWriter that writes events to the
 provided stream.
stream - The output stream to which events will be written.
javax.xml.stream.XMLStreamException - If an error occurs constructing an event writer from the
             stream.public STAXEventWriter(javax.xml.stream.util.XMLEventConsumer consumer)
STAXEventWriter that writes events to the
 provided event stream.
consumer - The event stream to which events will be written.| Method Detail | 
public javax.xml.stream.util.XMLEventConsumer getConsumer()
public void setConsumer(javax.xml.stream.util.XMLEventConsumer consumer)
consumer - The event consumer to which events should be written.public javax.xml.stream.XMLEventFactory getEventFactory()
public void setEventFactory(javax.xml.stream.XMLEventFactory eventFactory)
eventFactory - The new event factory.
public void writeNode(Node n)
               throws javax.xml.stream.XMLStreamException
Nodeto the stream. This method is simply a
 gateway to the overloaded methods such as .
n - The DOM4J Nodeto write to the stream.
javax.xml.stream.XMLStreamException - If an error occurs writing to the stream.
public void writeChildNodes(Branch branch)
                     throws javax.xml.stream.XMLStreamException
Branchinstance. This
 method simply iterates through the Branch's nodes and calls
 writeNode(Node).
branch - The node whose children will be written to the stream.
javax.xml.stream.XMLStreamException - If an error occurs writing to the stream.
public void writeElement(Element elem)
                  throws javax.xml.stream.XMLStreamException
Elementnode and its children to the stream.
elem - The Elementnode to write to the stream.
javax.xml.stream.XMLStreamException - If an error occurs writing to the stream.public javax.xml.stream.events.StartElement createStartElement(Element elem)
StartElementevent from a DOM4J Element.
elem - The Elementfrom which to construct the event.
StartElementevent.public javax.xml.stream.events.EndElement createEndElement(Element elem)
EndElementevent from a DOM4J Element.
elem - The Elementfrom which to construct the event.
EndElementevent.
public void writeAttribute(Attribute attr)
                    throws javax.xml.stream.XMLStreamException
Attributeto the stream.
attr - The Attributeto write to the stream.
javax.xml.stream.XMLStreamException - If an error occurs writing to the stream.public javax.xml.stream.events.Attribute createAttribute(Attribute attr)
Attributeevent from a
 DOM4J Attribute.
attr - The Attributefrom which to construct the event.
Attribute
         event.
public void writeNamespace(Namespace ns)
                    throws javax.xml.stream.XMLStreamException
Namespaceto the stream.
ns - The Namespaceto write to the stream.
javax.xml.stream.XMLStreamException - If an error occurs writing to the stream.public javax.xml.stream.events.Namespace createNamespace(Namespace ns)
Namespaceevent from a
 DOM4J Namespace.
ns - The Namespacefrom which to construct the event.
Namespaceevent.
public void writeText(Text text)
               throws javax.xml.stream.XMLStreamException
Textto the stream.
text - The Textto write to the stream.
javax.xml.stream.XMLStreamException - If an error occurs writing to the stream.public javax.xml.stream.events.Characters createCharacters(Text text)
Charactersevent from a DOM4J Text.
text - The Textfrom which to construct the event.
Charactersevent.
public void writeCDATA(CDATA cdata)
                throws javax.xml.stream.XMLStreamException
CDATAto the event stream.
cdata - The CDATAto write to the stream.
javax.xml.stream.XMLStreamException - If an error occurs writing to the stream.public javax.xml.stream.events.Characters createCharacters(CDATA cdata)
Charactersevent from a DOM4J CDATA.
cdata - The CDATAfrom which to construct the event.
Charactersevent.
public void writeComment(Comment comment)
                  throws javax.xml.stream.XMLStreamException
Commentto the stream.
comment - The Commentto write to the stream.
javax.xml.stream.XMLStreamException - If an error occurs writing to the stream.public javax.xml.stream.events.Comment createComment(Comment comment)
Commentevent from a
 DOM4J Comment.
comment - The Commentfrom which to construct the event.
Commentevent.
public void writeProcessingInstruction(ProcessingInstruction pi)
                                throws javax.xml.stream.XMLStreamException
ProcessingInstructionto the stream.
pi - The ProcessingInstructionto write to the stream.
javax.xml.stream.XMLStreamException - If an error occurs writing to the stream.public javax.xml.stream.events.ProcessingInstruction createProcessingInstruction(ProcessingInstruction pi)
ProcessingInstruction
 event from a DOM4J ProcessingInstruction.
pi - The ProcessingInstructionfrom which to construct the
            event.
ProcessingInstruction event.
public void writeEntity(Entity entity)
                 throws javax.xml.stream.XMLStreamException
Entityto the stream.
entity - The Entityto write to the stream.
javax.xml.stream.XMLStreamException - If an error occurs writing to the stream.
public void writeDocumentType(DocumentType docType)
                       throws javax.xml.stream.XMLStreamException
DocumentTypeto the stream.
docType - The DocumentTypeto write to the stream.
javax.xml.stream.XMLStreamException - If an error occurs writing to the stream.public javax.xml.stream.events.DTD createDTD(DocumentType docType)
DTDevent from a DOM4J DocumentType.
docType - The DocumentTypefrom which to construct the event.
DTDevent.
RuntimeException - DOCUMENT ME!
public void writeDocument(Document doc)
                   throws javax.xml.stream.XMLStreamException
Documentnode, and all its contents, to the
 stream.
doc - The Documentto write to the stream.
javax.xml.stream.XMLStreamException - If an error occurs writing to the stream.public javax.xml.stream.events.StartDocument createStartDocument(Document doc)
StartDocumentevent from a DOM4J Document.
doc - The Documentfrom which to construct the event.
StartDocumentevent.public javax.xml.stream.events.EndDocument createEndDocument(Document doc)
EndDocumentevent from a DOM4J Document.
doc - The Documentfrom which to construct the event.
EndDocumentevent.public javax.xml.namespace.QName createQName(QName qname)
QNamefrom a DOM4J QName.
qname - The QNamefrom which to construct the STAX
            QName.
QName.| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||