Nodes to a StAX event stream. In addition the
createXXX methods are provided to directly create STAX events
from DOM4J nodes.
| Modifier and Type | Class and Description |
|---|---|
| private class | STAXEventWriter.AttributeIterator
Internal |
| private class | STAXEventWriter.NamespaceIterator
Internal |
| Modifier and Type | Field and Description |
|---|---|
| private XMLEventConsumer | consumer
The event stream to which events are written. |
| private XMLEventFactory | factory
The event factory used to construct events. |
| private XMLOutputFactory |
| Access | Constructor and Description |
|---|---|
| public | |
| public | STAXEventWriter(File
The file to which events will be written. file)Constructs a |
| public | STAXEventWriter(Writer
The character stream to which events will be written. writer)Constructs a |
| public | STAXEventWriter(OutputStream
The output stream to which events will be written. stream)Constructs a |
| public | STAXEventWriter(XMLEventConsumer
The event stream to which events will be written. consumer)Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public Attribute | Returns: The newly constructedjavax.
event.The attr)Attributefrom which to construct the event.Constructs a STAX |
| public Characters | Returns: The constructedCharactersevent.The text)Textfrom which to construct the event.Constructs a STAX |
| public Characters | Returns: The newly constructedCharactersevent.The cdata)CDATAfrom which to construct the event.Constructs a STAX |
| public Comment | Returns: The constructedjavax.event.The comment)Commentfrom which to construct the event.Constructs a STAX |
| public DTD | Returns: The constructedDTDevent.The docType)DocumentTypefrom which to construct the event.Constructs a STAX |
| public EndDocument | Returns: The constructedEndDocumentevent.The doc)Documentfrom which to construct the event.Constructs a STAX |
| public EndElement | Returns: The newly constructedEndElementevent.The elem)Elementfrom which to construct the event.Constructs a STAX |
| private EntityReference | Returns: The constructedEntityReferenceevent.The entity)Entityfrom which to construct the event.Constructs a STAX |
| public Namespace | Returns: The constructedjavax.event.The ns)Namespacefrom which to construct the event.Constructs a STAX |
| public ProcessingInstruction | Returns: The constructedjavax. event.The pi)ProcessingInstructionfrom which to construct the
event.Constructs a STAX |
| public QName | Returns: The constructedQName.The qname)org.from which to construct the STAX
QName.Constructs a STAX |
| public StartDocument | Returns: The constructedStartDocumentevent.The doc)Documentfrom which to construct the event.Constructs a STAX |
| public StartElement | Returns: The newly constructedStartElementevent.The elem)Elementfrom which to construct the event.Constructs a STAX |
| public XMLEventConsumer | Returns: The underlying event consumer to which events are written.Returns a reference to the underlying event consumer to which events are written. |
| public XMLEventFactory | Returns: The event factory used to construct STAX events.Returns a reference to the event factory used to construct STAX events. |
| public void | setConsumer(XMLEventConsumer
The event consumer to which events should be written. consumer)Sets the underlying event consumer to which events are written. |
| public void | setEventFactory(XMLEventFactory
The new event factory. eventFactory)Sets the event factory used to construct STAX events. |
| public void | writeAttribute(Attribute
The attr)Attributeto write to the stream.Writes a DOM4J |
| public void | |
| public void | writeChildNodes(Branch
The node whose children will be written to the stream. branch)Writes each child node within the provided |
| public void | |
| public void | writeDocument(Document
The doc)Documentto write to the stream.Writes a DOM4J |
| public void | writeDocumentType(DocumentType
The docType)DocumentTypeto write to the stream.Writes a DOM4J |
| public void | writeElement(Element
The elem)Elementnode to write to the stream.Writes a DOM4J |
| public void | |
| public void | writeNamespace(Namespace
The ns)Namespaceto write to the stream.Writes a DOM4J |
| public void | |
| public void | writeProcessingInstruction(ProcessingInstruction
The pi)ProcessingInstructionto write to the stream.Writes a DOM4J |
| public void |
| consumer | back to summary |
|---|---|
| private XMLEventConsumer consumer The event stream to which events are written. | |
| factory | back to summary |
|---|---|
| private XMLEventFactory factory The event factory used to construct events. | |
| outputFactory | back to summary |
|---|---|
| private XMLOutputFactory outputFactory | |
| STAXEventWriter | back to summary |
|---|---|
| public STAXEventWriter() | |
| STAXEventWriter | back to summary |
|---|---|
| public STAXEventWriter(File file) throws XMLStreamException, IOException Constructs a
| |
| STAXEventWriter | back to summary |
|---|---|
| public STAXEventWriter(Writer writer) throws XMLStreamException Constructs a
| |
| STAXEventWriter | back to summary |
|---|---|
| public STAXEventWriter(OutputStream stream) throws XMLStreamException Constructs a
| |
| STAXEventWriter | back to summary |
|---|---|
| public STAXEventWriter(XMLEventConsumer consumer) Constructs a
| |
| createAttribute | back to summary |
|---|---|
| public Attribute createAttribute(Attribute attr) Constructs a STAX
| |
| createCharacters | back to summary |
|---|---|
| public Characters createCharacters(Text text) Constructs a STAX
| |
| createCharacters | back to summary |
|---|---|
| public Characters createCharacters(CDATA cdata) Constructs a STAX
| |
| createComment | back to summary |
|---|---|
| public Comment createComment(Comment comment) Constructs a STAX
| |
| createDTD | back to summary |
|---|---|
| public DTD createDTD(DocumentType docType) Constructs a STAX
| |
| createEndDocument | back to summary |
|---|---|
| public EndDocument createEndDocument(Document doc) Constructs a STAX
| |
| createEndElement | back to summary |
|---|---|
| public EndElement createEndElement(Element elem) Constructs a STAX
| |
| createEntityReference | back to summary |
|---|---|
| private EntityReference createEntityReference(Entity entity) Constructs a STAX
| |
| createNamespace | back to summary |
|---|---|
| public Namespace createNamespace(Namespace ns) Constructs a STAX
| |
| createProcessingInstruction | back to summary |
|---|---|
| public ProcessingInstruction createProcessingInstruction(ProcessingInstruction pi) Constructs a STAX
| |
| createQName | back to summary |
|---|---|
| public QName createQName(QName qname) Constructs a STAX
| |
| createStartDocument | back to summary |
|---|---|
| public StartDocument createStartDocument(Document doc) Constructs a STAX
| |
| createStartElement | back to summary |
|---|---|
| public StartElement createStartElement(Element elem) Constructs a STAX
| |
| getConsumer | back to summary |
|---|---|
| public XMLEventConsumer getConsumer() Returns a reference to the underlying event consumer to which events are written.
| |
| getEventFactory | back to summary |
|---|---|
| public XMLEventFactory getEventFactory() Returns a reference to the event factory used to construct STAX events.
| |
| setConsumer | back to summary |
|---|---|
| public void setConsumer(XMLEventConsumer consumer) Sets the underlying event consumer to which events are written.
| |
| setEventFactory | back to summary |
|---|---|
| public void setEventFactory(XMLEventFactory eventFactory) Sets the event factory used to construct STAX events.
| |
| writeAttribute | back to summary |
|---|---|
| public void writeAttribute(Attribute attr) throws XMLStreamException Writes a DOM4J
| |
| writeCDATA | back to summary |
|---|---|
| public void writeCDATA(CDATA cdata) throws XMLStreamException Writes a DOM4J
| |
| writeChildNodes | back to summary |
|---|---|
| public void writeChildNodes(Branch branch) throws XMLStreamException Writes each child node within the provided
| |
| writeComment | back to summary |
|---|---|
| public void writeComment(Comment comment) throws XMLStreamException Writes a DOM4J
| |
| writeDocument | back to summary |
|---|---|
| public void writeDocument(Document doc) throws XMLStreamException Writes a DOM4J
| |
| writeDocumentType | back to summary |
|---|---|
| public void writeDocumentType(DocumentType docType) throws XMLStreamException Writes a DOM4J
| |
| writeElement | back to summary |
|---|---|
| public void writeElement(Element elem) throws XMLStreamException Writes a DOM4J
| |
| writeEntity | back to summary |
|---|---|
| public void writeEntity(Entity entity) throws XMLStreamException Writes a DOM4J
| |
| writeNamespace | back to summary |
|---|---|
| public void writeNamespace(Namespace ns) throws XMLStreamException Writes a DOM4J
| |
| writeNode | back to summary |
|---|---|
| public void writeNode(Node n) throws XMLStreamException Writes a DOM4J
| |
| writeProcessingInstruction | back to summary |
|---|---|
| public void writeProcessingInstruction(ProcessingInstruction pi) throws XMLStreamException Writes a DOM4J
| |
| writeText | back to summary |
|---|---|
| public void writeText(Text text) throws XMLStreamException Writes a DOM4J
| |
| Modifier and Type | Field and Description |
|---|---|
| private Iterator | iter
The underlying DOm4J attribute iterator. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public Attribute | |
| public void | remove()
Overrides default java. |
| iter | back to summary |
|---|---|
| private Iterator<Attribute> iter The underlying DOm4J attribute iterator. | |
| AttributeIterator | back to summary |
|---|---|
| public AttributeIterator(Iterator<Attribute> iter) | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public Attribute next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public Namespace | |
| public void | remove()
Overrides default java. |
| iter | back to summary |
|---|---|
| private Iterator<Namespace> iter | |
| NamespaceIterator | back to summary |
|---|---|
| public NamespaceIterator(Iterator<Namespace> iter) | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public Namespace next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the | |