org.dom4j.io
public class STAXEventReader extends Object
Constructor Summary | |
---|---|
STAXEventReader()
Constructs a default STAXEventReader instance with a
default DocumentFactory. | |
STAXEventReader(DocumentFactory factory)
Constructs a STAXEventReader instance that uses the
specified DocumentFactoryto construct DOM4J Nodes.
|
Method Summary | |
---|---|
Attribute | createAttribute(Element elem, Attribute attr)
Constructs a new DOM4J Attribute from the provided StAX Attribute event.
|
CharacterData | createCharacterData(Characters characters)
Constructs a new DOM4J Text or CDATA object from the provided Characters
event.
|
Comment | createComment(Comment comment)
Constructs a new DOM4J Comment from the provided StAX Comment event.
|
Element | createElement(StartElement startEvent)
Constructs a new DOM4J Element from the provided StartElement event. |
Entity | createEntity(EntityReference entityRef)
Constructs a new DOM4J Entity from the provided StAX EntityReference
event.
|
Namespace | createNamespace(Namespace ns)
Constructs a new DOM4J Namespace from the provided StAX Namespace event.
|
ProcessingInstruction | createProcessingInstruction(ProcessingInstruction pi)
Constructs a new DOM4J ProcessingInstruction from the provided StAX
ProcessingInstruction event.
|
QName | createQName(QName qname)
Constructs a new DOM4J QName from the provided JAXP QName.
|
Attribute | readAttribute(XMLEventReader reader)
Constructs a DOM4J Attribute from the provided event stream. |
CharacterData | readCharacters(XMLEventReader reader)
Constructs a DOM4J Text or CDATA section from the provided event stream.
|
Comment | readComment(XMLEventReader reader)
Constructs a DOM4J Comment from the provided event stream. |
Document | readDocument(InputStream is)
Constructs a StAX event stream from the provided I/O stream and reads a
DOM4J document from it.
|
Document | readDocument(Reader reader)
Constructs a StAX event stream from the provided I/O character stream and
reads a DOM4J document from it.
|
Document | readDocument(InputStream is, String systemId)
Constructs a StAX event stream from the provided I/O stream and reads a
DOM4J document from it.
|
Document | readDocument(Reader reader, String systemId)
Constructs a StAX event stream from the provided I/O character stream and
reads a DOM4J document from it.
|
Document | readDocument(XMLEventReader reader)
Reads a DOM4J Documentfrom the provided stream. |
Element | readElement(XMLEventReader eventReader)
Reads a DOM4J Element from the provided event stream. |
Entity | readEntityReference(XMLEventReader reader)
Constructs a DOM4J Entity from the provided event stream. |
Namespace | readNamespace(XMLEventReader reader)
Constructs a DOM4J Namespace from the provided event stream. |
Node | readNode(XMLEventReader reader)
Reads a Nodefrom the event stream. |
ProcessingInstruction | readProcessingInstruction(XMLEventReader reader)
Constructs a DOM4J ProcessingInstruction from the provided event stream.
|
void | setDocumentFactory(DocumentFactory documentFactory)
Sets the DocumentFactory to be used when constructing DOM4J nodes.
|
STAXEventReader
instance with a
default DocumentFactory.STAXEventReader
instance that uses the
specified DocumentFactoryto construct DOM4J Nodes.
Parameters: factory
The DocumentFactory to use when constructing DOM4J nodes, or
null
if a default should be used.
Parameters: elem DOCUMENT ME! attr The Attribute event from which to construct the new DOM4J Attribute.
Returns: The Attribute constructed from the provided Attribute event.
Parameters: characters The Characters event from which to construct the new DOM4J Text or CDATA object.
Returns: The Text or CDATA object constructed from the provided Characters event.
Parameters: comment The Comment event from which to construct the new DOM4J Comment.
Returns: The Comment constructed from the provided Comment event.
Parameters: startEvent The StartElement event from which to construct the new DOM4J Element.
Returns: The Element constructed from the provided StartElement event.
Parameters: entityRef The EntityReference event from which to construct the new DOM4J Entity.
Returns: The Entity constructed from the provided EntityReference event.
Parameters: ns The Namespace event from which to construct the new DOM4J Namespace.
Returns: The Namespace constructed from the provided Namespace event.
Parameters: pi The ProcessingInstruction event from which to construct the new DOM4J ProcessingInstruction.
Returns: The ProcessingInstruction constructed from the provided ProcessingInstruction event.
Parameters: qname The JAXP QName from which to create a DOM4J QName.
Returns: The newly constructed DOM4J QName.
Parameters: reader The event stream from which to read the Attribute.
Returns: The Attribute that was read from the stream.
Throws: XMLStreamException If an error occured reading events from the stream, or the stream was not positioned before an {@linkAttribute }event.
Parameters: reader The event stream from which to read the Text or CDATA.
Returns: The Text or CDATA that was read from the stream.
Throws: XMLStreamException If an error occured reading events from the stream, or the stream was not positioned before a {@linkCharacters }event.
Parameters: reader The event stream from which to read the Comment.
Returns: The Comment that was read from the stream.
Throws: XMLStreamException If an error occured reading events from the stream, or the stream was not positioned before a {@linkComment }event.
Parameters: is The I/O stream from which the Document will be read.
Returns: The Document that was read from the stream.
Throws: XMLStreamException If an error occurs reading content from the stream.
Parameters: reader The character stream from which the Document will be read.
Returns: The Document that was read from the stream.
Throws: XMLStreamException If an error occurs reading content from the stream.
Parameters: is The I/O stream from which the Document will be read. systemId A system id used to resolve entities.
Returns: The Document that was read from the stream.
Throws: XMLStreamException If an error occurs reading content from the stream.
Parameters: reader The character stream from which the Document will be read. systemId A system id used to resolve entities.
Returns: The Document that was read from the stream.
Throws: XMLStreamException If an error occurs reading content from the stream.
Parameters: reader The event stream from which to read the Document.
Returns: The Documentthat was read from the stream.
Throws: XMLStreamException If an error occurs reading events from the stream.
Parameters: eventReader The event stream from which to read the Element.
Returns: The Element that was read from the stream.
Throws: XMLStreamException If an error occured reading events from the stream, or the stream was not positioned before a {@linkStartElement }event.
Parameters: reader The event stream from which to read the EntityReference.
Returns: The Entitythat was read from the stream.
Throws: XMLStreamException If an error occured reading events from the stream, or the stream was not positioned before an {@linkEntityReference } event.
Parameters: reader The event stream from which to read the Namespace.
Returns: The Namespace that was read from the stream.
Throws: XMLStreamException If an error occured reading events from the stream, or the stream was not positioned before a {@linkNamespace }event.
Pre-Conditions : The stream must be positioned before an
event other than an EndElement
,EndDocument
,
or any DTD-related events, which are not currently supported.
Parameters: reader The reader from which events will be read.
Returns: A DOM4J Nodeconstructed from the read events.
Throws: XMLStreamException If an error occurs reading from the stream, or the stream was positioned before an unsupported event.
Parameters: reader The event stream from which to read the ProcessingInstruction.
Returns: The ProcessingInstruction that was read from the stream.
Throws: XMLStreamException If an error occured reading events from the stream, or the stream was not positioned before a ProcessingInstruction event.
Parameters: documentFactory
The DocumentFactory to use when constructing DOM4J nodes, or
null
if a default should be used.