org.dom4j.io
public class STAXEventWriter extends Object
createXXX
methods are provided to directly create STAX events
from DOM4J nodes.
Constructor Summary | |
---|---|
STAXEventWriter() | |
STAXEventWriter(File file)
Constructs a STAXEventWriter that writes events to the
provided file.
| |
STAXEventWriter(Writer writer)
Constructs a STAXEventWriter that writes events to the
provided character stream.
| |
STAXEventWriter(OutputStream stream)
Constructs a STAXEventWriter that writes events to the
provided stream.
| |
STAXEventWriter(XMLEventConsumer consumer)
Constructs a STAXEventWriter that writes events to the
provided event stream.
|
Method Summary | |
---|---|
Attribute | createAttribute(Attribute attr)
Constructs a STAX {@link javax.xml.stream.events.Attribute}event from a
DOM4J {@link Attribute}.
|
Characters | createCharacters(Text text)
Constructs a STAX {@link Characters}event from a DOM4J {@link Text}.
|
Characters | createCharacters(CDATA cdata)
Constructs a STAX {@link Characters}event from a DOM4J {@link CDATA}.
|
Comment | createComment(Comment comment)
Constructs a STAX {@link javax.xml.stream.events.Comment}event from a
DOM4J {@link Comment}.
|
DTD | createDTD(DocumentType docType)
Constructs a STAX {@link DTD}event from a DOM4J {@link DocumentType}.
|
EndDocument | createEndDocument(Document doc)
Constructs a STAX {@link EndDocument}event from a DOM4J {@link
Document}.
|
EndElement | createEndElement(Element elem)
Constructs a STAX {@link EndElement}event from a DOM4J {@link Element}.
|
Namespace | createNamespace(Namespace ns)
Constructs a STAX {@link javax.xml.stream.events.Namespace}event from a
DOM4J {@link Namespace}.
|
ProcessingInstruction | createProcessingInstruction(ProcessingInstruction pi)
Constructs a STAX {@link javax.xml.stream.events.ProcessingInstruction}
event from a DOM4J {@link ProcessingInstruction}.
|
QName | createQName(QName qname)
Constructs a STAX {@link QName}from a DOM4J {@link org.dom4j.QName}.
|
StartDocument | createStartDocument(Document doc)
Constructs a STAX {@link StartDocument}event from a DOM4J {@link
Document}.
|
StartElement | createStartElement(Element elem)
Constructs a STAX {@link StartElement}event from a DOM4J {@link
Element}.
|
XMLEventConsumer | getConsumer()
Returns a reference to the underlying event consumer to which events are
written.
|
XMLEventFactory | getEventFactory()
Returns a reference to the event factory used to construct STAX events.
|
void | setConsumer(XMLEventConsumer consumer)
Sets the underlying event consumer to which events are written.
|
void | setEventFactory(XMLEventFactory eventFactory)
Sets the event factory used to construct STAX events.
|
void | writeAttribute(Attribute attr)
Writes a DOM4J {@link Attribute}to the stream.
|
void | writeCDATA(CDATA cdata)
Writes a DOM4J {@link CDATA}to the event stream.
|
void | writeChildNodes(Branch branch)
Writes each child node within the provided {@link Branch}instance. |
void | writeComment(Comment comment)
Writes a DOM4J {@link Comment}to the stream.
|
void | writeDocument(Document doc)
Writes a DOM4J {@link Document}node, and all its contents, to the
stream.
|
void | writeDocumentType(DocumentType docType)
Writes a DOM4J {@link DocumentType}to the stream.
|
void | writeElement(Element elem)
Writes a DOM4J {@link Element}node and its children to the stream.
|
void | writeEntity(Entity entity)
Writes a DOM4J {@link Entity}to the stream.
|
void | writeNamespace(Namespace ns)
Writes a DOM4J {@link Namespace}to the stream.
|
void | writeNode(Node n)
Writes a DOM4J {@link Node}to the stream. |
void | writeProcessingInstruction(ProcessingInstruction pi)
Writes a DOM4J {@link ProcessingInstruction}to the stream.
|
void | writeText(Text text)
Writes a DOM4J {@link Text}to the stream.
|
STAXEventWriter
that writes events to the
provided file.
Parameters: file The file to which events will be written.
Throws: XMLStreamException If an error occurs creating an event writer from the file. IOException If an error occurs openin the file for writing.
STAXEventWriter
that writes events to the
provided character stream.
Parameters: writer The character stream to which events will be written.
Throws: XMLStreamException If an error occurs constructing an event writer from the character stream.
STAXEventWriter
that writes events to the
provided stream.
Parameters: stream The output stream to which events will be written.
Throws: XMLStreamException If an error occurs constructing an event writer from the stream.
STAXEventWriter
that writes events to the
provided event stream.
Parameters: consumer The event stream to which events will be written.
Parameters: attr The {@link Attribute}from which to construct the event.
Returns: The newly constructed {@link javax.xml.stream.events.Attribute} event.
Parameters: text The {@link Text}from which to construct the event.
Returns: The constructed {@link Characters}event.
Parameters: cdata The {@link CDATA}from which to construct the event.
Returns: The newly constructed {@link Characters}event.
Parameters: comment The {@link Comment}from which to construct the event.
Returns: The constructed {@link javax.xml.stream.events.Comment}event.
Parameters: docType The {@link DocumentType}from which to construct the event.
Returns: The constructed {@link DTD}event.
Throws: RuntimeException DOCUMENT ME!
Parameters: doc The {@link Document}from which to construct the event.
Returns: The constructed {@link EndDocument}event.
Parameters: elem The {@link Element}from which to construct the event.
Returns: The newly constructed {@link EndElement}event.
Parameters: ns The {@link Namespace}from which to construct the event.
Returns: The constructed {@link javax.xml.stream.events.Namespace}event.
Parameters: pi The {@link ProcessingInstruction}from which to construct the event.
Returns: The constructed {@link javax.xml.stream.events.ProcessingInstruction} event.
Parameters: qname The {@link org.dom4j.QName}from which to construct the STAX {@link QName}.
Returns: The constructed {@link QName}.
Parameters: doc The {@link Document}from which to construct the event.
Returns: The constructed {@link StartDocument}event.
Parameters: elem The {@link Element}from which to construct the event.
Returns: The newly constructed {@link StartElement}event.
Returns: The underlying event consumer to which events are written.
Returns: The event factory used to construct STAX events.
Parameters: consumer The event consumer to which events should be written.
Parameters: eventFactory The new event factory.
Parameters: attr The {@link Attribute}to write to the stream.
Throws: XMLStreamException If an error occurs writing to the stream.
Parameters: cdata The {@link CDATA}to write to the stream.
Throws: XMLStreamException If an error occurs writing to the stream.
Parameters: branch The node whose children will be written to the stream.
Throws: XMLStreamException If an error occurs writing to the stream.
Parameters: comment The {@link Comment}to write to the stream.
Throws: XMLStreamException If an error occurs writing to the stream.
Parameters: doc The {@link Document}to write to the stream.
Throws: XMLStreamException If an error occurs writing to the stream.
Parameters: docType The {@link DocumentType}to write to the stream.
Throws: XMLStreamException If an error occurs writing to the stream.
Parameters: elem The {@link Element}node to write to the stream.
Throws: XMLStreamException If an error occurs writing to the stream.
Parameters: entity The {@link Entity}to write to the stream.
Throws: XMLStreamException If an error occurs writing to the stream.
Parameters: ns The {@link Namespace}to write to the stream.
Throws: XMLStreamException If an error occurs writing to the stream.
Parameters: n The DOM4J {@link Node}to write to the stream.
Throws: XMLStreamException If an error occurs writing to the stream.
Parameters: pi The {@link ProcessingInstruction}to write to the stream.
Throws: XMLStreamException If an error occurs writing to the stream.
Parameters: text The {@link Text}to write to the stream.
Throws: XMLStreamException If an error occurs writing to the stream.