Constructor and Description |
---|
STAXEventWriter() |
STAXEventWriter(File file)
Constructs a
STAXEventWriter that writes events to the
provided file. |
STAXEventWriter(OutputStream stream)
Constructs a
STAXEventWriter that writes events to the
provided stream. |
STAXEventWriter(Writer writer)
Constructs a
STAXEventWriter that writes events to the
provided character stream. |
STAXEventWriter(XMLEventConsumer consumer)
Constructs a
STAXEventWriter that writes events to the
provided event stream. |
Modifier and Type | Method and Description |
---|---|
Attribute |
createAttribute(Attribute attr)
|
Characters |
createCharacters(CDATA cdata)
Constructs a STAX
Characters event from a DOM4J CDATA . |
Characters |
createCharacters(Text text)
Constructs a STAX
Characters event from a DOM4J Text . |
Comment |
createComment(Comment comment)
|
DTD |
createDTD(DocumentType docType)
Constructs a STAX
DTD event from a DOM4J DocumentType . |
EndDocument |
createEndDocument(Document doc)
Constructs a STAX
EndDocument event from a DOM4J Document . |
EndElement |
createEndElement(Element elem)
Constructs a STAX
EndElement event from a DOM4J Element . |
Namespace |
createNamespace(Namespace ns)
|
ProcessingInstruction |
createProcessingInstruction(ProcessingInstruction pi)
Constructs a STAX
ProcessingInstruction
event from a DOM4J ProcessingInstruction . |
QName |
createQName(QName qname)
|
StartDocument |
createStartDocument(Document doc)
Constructs a STAX
StartDocument event from a DOM4J Document . |
StartElement |
createStartElement(Element elem)
Constructs a STAX
StartElement event from a DOM4J 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
Attribute to the stream. |
void |
writeCDATA(CDATA cdata)
Writes a DOM4J
CDATA to the event stream. |
void |
writeChildNodes(Branch branch)
Writes each child node within the provided
Branch instance. |
void |
writeComment(Comment comment)
Writes a DOM4J
Comment to the stream. |
void |
writeDocument(Document doc)
Writes a DOM4J
Document node, and all its contents, to the
stream. |
void |
writeDocumentType(DocumentType docType)
Writes a DOM4J
DocumentType to the stream. |
void |
writeElement(Element elem)
Writes a DOM4J
Element node and its children to the stream. |
void |
writeEntity(Entity entity)
Writes a DOM4J
Entity to the stream. |
void |
writeNamespace(Namespace ns)
Writes a DOM4J
Namespace to the stream. |
void |
writeNode(Node n)
Writes a DOM4J
Node to the stream. |
void |
writeProcessingInstruction(ProcessingInstruction pi)
Writes a DOM4J
ProcessingInstruction to the stream. |
void |
writeText(Text text)
Writes a DOM4J
Text to the stream. |
public STAXEventWriter()
public STAXEventWriter(File file) throws XMLStreamException, IOException
STAXEventWriter
that writes events to the
provided file.file
- The file to which events will be written.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 XMLStreamException
STAXEventWriter
that writes events to the
provided character stream.writer
- The character stream to which events will be written.XMLStreamException
- If an error occurs constructing an event writer from the
character stream.public STAXEventWriter(OutputStream stream) throws XMLStreamException
STAXEventWriter
that writes events to the
provided stream.stream
- The output stream to which events will be written.XMLStreamException
- If an error occurs constructing an event writer from the
stream.public STAXEventWriter(XMLEventConsumer consumer)
STAXEventWriter
that writes events to the
provided event stream.consumer
- The event stream to which events will be written.public XMLEventConsumer getConsumer()
public void setConsumer(XMLEventConsumer consumer)
consumer
- The event consumer to which events should be written.public XMLEventFactory getEventFactory()
public void setEventFactory(XMLEventFactory eventFactory)
eventFactory
- The new event factory.public void writeNode(Node n) throws XMLStreamException
Node
to the stream. This method is simply a
gateway to the overloaded methods such as .n
- The DOM4J Node
to write to the stream.XMLStreamException
- If an error occurs writing to the stream.public void writeChildNodes(Branch branch) throws XMLStreamException
Branch
instance. This
method simply iterates through the Branch
's nodes and calls
writeNode(Node)
.branch
- The node whose children will be written to the stream.XMLStreamException
- If an error occurs writing to the stream.public void writeElement(Element elem) throws XMLStreamException
Element
node and its children to the stream.elem
- The Element
node to write to the stream.XMLStreamException
- If an error occurs writing to the stream.public StartElement createStartElement(Element elem)
StartElement
event from a DOM4J Element
.elem
- The Element
from which to construct the event.StartElement
event.public EndElement createEndElement(Element elem)
EndElement
event from a DOM4J Element
.elem
- The Element
from which to construct the event.EndElement
event.public void writeAttribute(Attribute attr) throws XMLStreamException
Attribute
to the stream.attr
- The Attribute
to write to the stream.XMLStreamException
- If an error occurs writing to the stream.public void writeNamespace(Namespace ns) throws XMLStreamException
Namespace
to the stream.ns
- The Namespace
to write to the stream.XMLStreamException
- If an error occurs writing to the stream.public void writeText(Text text) throws XMLStreamException
Text
to the stream.text
- The Text
to write to the stream.XMLStreamException
- If an error occurs writing to the stream.public Characters createCharacters(Text text)
Characters
event from a DOM4J Text
.text
- The Text
from which to construct the event.Characters
event.public void writeCDATA(CDATA cdata) throws XMLStreamException
CDATA
to the event stream.cdata
- The CDATA
to write to the stream.XMLStreamException
- If an error occurs writing to the stream.public Characters createCharacters(CDATA cdata)
Characters
event from a DOM4J CDATA
.cdata
- The CDATA
from which to construct the event.Characters
event.public void writeComment(Comment comment) throws XMLStreamException
Comment
to the stream.comment
- The Comment
to write to the stream.XMLStreamException
- If an error occurs writing to the stream.public void writeProcessingInstruction(ProcessingInstruction pi) throws XMLStreamException
ProcessingInstruction
to the stream.pi
- The ProcessingInstruction
to write to the stream.XMLStreamException
- If an error occurs writing to the stream.public ProcessingInstruction createProcessingInstruction(ProcessingInstruction pi)
ProcessingInstruction
event from a DOM4J ProcessingInstruction
.pi
- The ProcessingInstruction
from which to construct the
event.ProcessingInstruction
event.public void writeEntity(Entity entity) throws XMLStreamException
Entity
to the stream.entity
- The Entity
to write to the stream.XMLStreamException
- If an error occurs writing to the stream.public void writeDocumentType(DocumentType docType) throws XMLStreamException
DocumentType
to the stream.docType
- The DocumentType
to write to the stream.XMLStreamException
- If an error occurs writing to the stream.public DTD createDTD(DocumentType docType)
DTD
event from a DOM4J DocumentType
.docType
- The DocumentType
from which to construct the event.DTD
event.RuntimeException
- DOCUMENT ME!public void writeDocument(Document doc) throws XMLStreamException
Document
node, and all its contents, to the
stream.doc
- The Document
to write to the stream.XMLStreamException
- If an error occurs writing to the stream.public StartDocument createStartDocument(Document doc)
StartDocument
event from a DOM4J Document
.doc
- The Document
from which to construct the event.StartDocument
event.public EndDocument createEndDocument(Document doc)
EndDocument
event from a DOM4J Document
.doc
- The Document
from which to construct the event.EndDocument
event.Copyright © 2012 JBoss by Red Hat. All Rights Reserved.