createAttribute
public Attribute createAttribute(Element elem,
Attribute attr)
Constructs a new DOM4J Attribute from the provided StAX Attribute event.
elem
- DOCUMENT ME!attr
- The Attribute event from which to construct the new DOM4J
Attribute.
- The Attribute constructed from the provided Attribute event.
createCharacterData
public CharacterData createCharacterData(Characters characters)
Constructs a new DOM4J Text or CDATA object from the provided Characters
event.
characters
- The Characters event from which to construct the new DOM4J
Text or CDATA object.
- The Text or CDATA object constructed from the provided Characters
event.
createComment
public Comment createComment(Comment comment)
Constructs a new DOM4J Comment from the provided StAX Comment event.
comment
- The Comment event from which to construct the new DOM4J
Comment.
- The Comment constructed from the provided Comment event.
createElement
public Element createElement(StartElement startEvent)
Constructs a new DOM4J Element from the provided StartElement event. All
attributes and namespaces will be added to the returned element.
startEvent
- The StartElement event from which to construct the new DOM4J
Element.
- The Element constructed from the provided StartElement event.
createEntity
public Entity createEntity(EntityReference entityRef)
Constructs a new DOM4J Entity from the provided StAX EntityReference
event.
entityRef
- The EntityReference event from which to construct the new
DOM4J Entity.
- The Entity constructed from the provided EntityReference event.
createNamespace
public Namespace createNamespace(Namespace ns)
Constructs a new DOM4J Namespace from the provided StAX Namespace event.
ns
- The Namespace event from which to construct the new DOM4J
Namespace.
- The Namespace constructed from the provided Namespace event.
createProcessingInstruction
public ProcessingInstruction createProcessingInstruction(ProcessingInstruction pi)
Constructs a new DOM4J ProcessingInstruction from the provided StAX
ProcessingInstruction event.
pi
- The ProcessingInstruction event from which to construct the
new DOM4J ProcessingInstruction.
- The ProcessingInstruction constructed from the provided
ProcessingInstruction event.
createQName
public QName createQName(QName qname)
Constructs a new DOM4J QName from the provided JAXP QName.
qname
- The JAXP QName from which to create a DOM4J QName.
- The newly constructed DOM4J QName.
readAttribute
public Attribute readAttribute(XMLEventReader reader)
throws XMLStreamException
Constructs a DOM4J Attribute from the provided event stream. The stream
must be positioned before an Attribute
event.
reader
- The event stream from which to read the Attribute.
- The Attribute that was read from the stream.
readCharacters
public CharacterData readCharacters(XMLEventReader reader)
throws XMLStreamException
Constructs a DOM4J Text or CDATA section from the provided event stream.
The stream must be positioned before a Characters
event.
reader
- The event stream from which to read the Text or CDATA.
- The Text or CDATA that was read from the stream.
readComment
public Comment readComment(XMLEventReader reader)
throws XMLStreamException
Constructs a DOM4J Comment from the provided event stream. The stream
must be positioned before a Comment
event.
reader
- The event stream from which to read the Comment.
- The Comment that was read from the stream.
readDocument
public Document readDocument(InputStream is)
throws XMLStreamException
Constructs a StAX event stream from the provided I/O stream and reads a
DOM4J document from it.
is
- The I/O stream from which the Document will be read.
- The Document that was read from the stream.
readDocument
public Document readDocument(InputStream is,
String systemId)
throws XMLStreamException
Constructs a StAX event stream from the provided I/O stream and reads a
DOM4J document from it.
is
- The I/O stream from which the Document will be read.systemId
- A system id used to resolve entities.
- The Document that was read from the stream.
readDocument
public Document readDocument(Reader reader)
throws XMLStreamException
Constructs a StAX event stream from the provided I/O character stream and
reads a DOM4J document from it.
reader
- The character stream from which the Document will be read.
- The Document that was read from the stream.
readDocument
public Document readDocument(Reader reader,
String systemId)
throws XMLStreamException
Constructs a StAX event stream from the provided I/O character stream and
reads a DOM4J document from it.
reader
- The character stream from which the Document will be read.systemId
- A system id used to resolve entities.
- The Document that was read from the stream.
readDocument
public Document readDocument(XMLEventReader reader)
throws XMLStreamException
Reads a DOM4J
Document
from the provided stream. The stream
should be positioned at the start of a document, or before a
StartElement
event.
reader
- The event stream from which to read the Document
.
- The
Document
that was read from the stream.
readElement
public Element readElement(XMLEventReader eventReader)
throws XMLStreamException
Reads a DOM4J Element from the provided event stream. The stream must be
positioned before an StartElement
event. In addition to the
initial start event, all events up to and including the closing EndElement
will be read, and included with the returned element.
eventReader
- The event stream from which to read the Element.
- The Element that was read from the stream.
readEntityReference
public Entity readEntityReference(XMLEventReader reader)
throws XMLStreamException
Constructs a DOM4J Entity from the provided event stream. The stream must
be positioned before an EntityReference
event.
reader
- The event stream from which to read the EntityReference
.
- The
Entity
that was read from the stream.
readNamespace
public Namespace readNamespace(XMLEventReader reader)
throws XMLStreamException
Constructs a DOM4J Namespace from the provided event stream. The stream
must be positioned before a Namespace
event.
reader
- The event stream from which to read the Namespace.
- The Namespace that was read from the stream.
readNode
public Node readNode(XMLEventReader reader)
throws XMLStreamException
Reads a
Node
from the event stream. If the next event is a
StartElement
, all events until the closing
EndElement
will be read, and the resulting nodes will be added to the returned
Element
.
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.
reader
- The reader from which events will be read.
- A DOM4J
Node
constructed from the read events.
readProcessingInstruction
public ProcessingInstruction readProcessingInstruction(XMLEventReader reader)
throws XMLStreamException
Constructs a DOM4J ProcessingInstruction from the provided event stream.
The stream must be positioned before a ProcessingInstruction
event.
reader
- The event stream from which to read the ProcessingInstruction.
- The ProcessingInstruction that was read from the stream.
setDocumentFactory
public void setDocumentFactory(DocumentFactory documentFactory)
Sets the DocumentFactory to be used when constructing DOM4J nodes.
documentFactory
- The DocumentFactory to use when constructing DOM4J nodes, or
null
if a default should be used.