STAXEventWriter
public STAXEventWriter()
STAXEventWriter
public STAXEventWriter(File file)
throws XMLStreamException,
IOException
Constructs a STAXEventWriter
that writes events to the
provided file.
file
- The file to which events will be written.
STAXEventWriter
public STAXEventWriter(OutputStream stream)
throws XMLStreamException
Constructs a STAXEventWriter
that writes events to the
provided stream.
stream
- The output stream to which events will be written.
STAXEventWriter
public STAXEventWriter(Writer writer)
throws XMLStreamException
Constructs a STAXEventWriter
that writes events to the
provided character stream.
writer
- The character stream to which events will be written.
STAXEventWriter
public STAXEventWriter(XMLEventConsumer consumer)
Constructs a STAXEventWriter
that writes events to the
provided event stream.
consumer
- The event stream to which events will be written.
createAttribute
public javax.xml.stream.events.Attribute createAttribute(Attribute attr)
Constructs a STAX
javax.xml.stream.events.Attribute
event from a
DOM4J
Attribute
.
attr
- The Attribute
from which to construct the event.
- The newly constructed
javax.xml.stream.events.Attribute
event.
createCharacters
public Characters createCharacters(CDATA cdata)
Constructs a STAX
Characters
event from a DOM4J
CDATA
.
cdata
- The CDATA
from which to construct the event.
- The newly constructed
Characters
event.
createCharacters
public Characters createCharacters(Text text)
Constructs a STAX
Characters
event from a DOM4J
Text
.
text
- The Text
from which to construct the event.
- The constructed
Characters
event.
createComment
public javax.xml.stream.events.Comment createComment(Comment comment)
Constructs a STAX
javax.xml.stream.events.Comment
event from a
DOM4J
Comment
.
comment
- The Comment
from which to construct the event.
- The constructed
javax.xml.stream.events.Comment
event.
createDTD
public DTD createDTD(DocumentType docType)
docType
- The DocumentType
from which to construct the event.
- The constructed
DTD
event.
createEndDocument
public EndDocument createEndDocument(Document doc)
Constructs a STAX
EndDocument
event from a DOM4J
Document
.
doc
- The Document
from which to construct the event.
- The constructed
EndDocument
event.
createEndElement
public EndElement createEndElement(Element elem)
Constructs a STAX
EndElement
event from a DOM4J
Element
.
elem
- The Element
from which to construct the event.
- The newly constructed
EndElement
event.
createNamespace
public javax.xml.stream.events.Namespace createNamespace(Namespace ns)
Constructs a STAX
javax.xml.stream.events.Namespace
event from a
DOM4J
Namespace
.
ns
- The Namespace
from which to construct the event.
- The constructed
javax.xml.stream.events.Namespace
event.
createProcessingInstruction
public ProcessingInstruction createProcessingInstruction(ProcessingInstruction pi)
Constructs a STAX javax.xml.stream.events.ProcessingInstruction
event from a DOM4J ProcessingInstruction
.
pi
- The ProcessingInstruction
from which to construct the
event.
- The constructed
javax.xml.stream.events.ProcessingInstruction
event.
createQName
public QName createQName(QName qname)
Constructs a STAX
QName
from a DOM4J
QName
.
qname
- The QName
from which to construct the STAX
QName
.
createStartDocument
public StartDocument createStartDocument(Document doc)
Constructs a STAX
StartDocument
event from a DOM4J
Document
.
doc
- The Document
from which to construct the event.
- The constructed
StartDocument
event.
createStartElement
public StartElement createStartElement(Element elem)
Constructs a STAX
StartElement
event from a DOM4J
Element
.
elem
- The Element
from which to construct the event.
- The newly constructed
StartElement
event.
getConsumer
public XMLEventConsumer getConsumer()
Returns a reference to the underlying event consumer to which events are
written.
- The underlying event consumer to which events are written.
getEventFactory
public XMLEventFactory getEventFactory()
Returns a reference to the event factory used to construct STAX events.
- The event factory used to construct STAX events.
setConsumer
public void setConsumer(XMLEventConsumer consumer)
Sets the underlying event consumer to which events are written.
consumer
- The event consumer to which events should be written.
setEventFactory
public void setEventFactory(XMLEventFactory eventFactory)
Sets the event factory used to construct STAX events.
eventFactory
- The new event factory.
writeAttribute
public void writeAttribute(Attribute attr)
throws XMLStreamException
writeCDATA
public void writeCDATA(CDATA cdata)
throws XMLStreamException
Writes a DOM4J
CDATA
to the event stream.
cdata
- The CDATA
to write to the stream.
writeChildNodes
public void writeChildNodes(Branch branch)
throws XMLStreamException
Writes each child node within the provided
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.
writeComment
public void writeComment(Comment comment)
throws XMLStreamException
Writes a DOM4J
Comment
to the stream.
comment
- The Comment
to write to the stream.
writeDocument
public void writeDocument(Document doc)
throws XMLStreamException
Writes a DOM4J
Document
node, and all its contents, to the
stream.
doc
- The Document
to write to the stream.
writeDocumentType
public void writeDocumentType(DocumentType docType)
throws XMLStreamException
writeElement
public void writeElement(Element elem)
throws XMLStreamException
Writes a DOM4J
Element
node and its children to the stream.
elem
- The Element
node to write to the stream.
writeEntity
public void writeEntity(Entity entity)
throws XMLStreamException
Writes a DOM4J
Entity
to the stream.
entity
- The Entity
to write to the stream.
writeNamespace
public void writeNamespace(Namespace ns)
throws XMLStreamException
writeNode
public void writeNode(Node n)
throws XMLStreamException
Writes a DOM4J
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.
writeProcessingInstruction
public void writeProcessingInstruction(ProcessingInstruction pi)
throws XMLStreamException
Writes a DOM4J ProcessingInstruction
to the stream.
pi
- The ProcessingInstruction
to write to the stream.
writeText
public void writeText(Text text)
throws XMLStreamException
Writes a DOM4J
Text
to the stream.
text
- The Text
to write to the stream.