Save This Page
Home » dom4j-1.6.1 » org.dom4j.io » [javadoc | source]
org.dom4j.io
public class: STAXEventReader [javadoc | source]
java.lang.Object
   org.dom4j.io.STAXEventReader
Reads a DOM4J Document , as well as other Node s, from a StAX XMLEventReader .
Constructor:
 public STAXEventReader() 
 public STAXEventReader(DocumentFactory factory) 
    Constructs a STAXEventReader instance that uses the specified DocumentFactory to construct DOM4J Node s.
    Parameters:
    factory - The DocumentFactory to use when constructing DOM4J nodes, or null if a default should be used.
Method from org.dom4j.io.STAXEventReader Summary:
createAttribute,   createCharacterData,   createComment,   createElement,   createEntity,   createNamespace,   createProcessingInstruction,   createQName,   readAttribute,   readCharacters,   readComment,   readDocument,   readDocument,   readDocument,   readDocument,   readDocument,   readElement,   readEntityReference,   readNamespace,   readNode,   readProcessingInstruction,   setDocumentFactory
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.dom4j.io.STAXEventReader Detail:
 public Attribute createAttribute(Element elem,
    Attribute attr) 
    Constructs a new DOM4J Attribute from the provided StAX Attribute event.
 public CharacterData createCharacterData(Characters characters) 
    Constructs a new DOM4J Text or CDATA object from the provided Characters event.
 public Comment createComment(Comment comment) 
    Constructs a new DOM4J Comment from the provided StAX Comment event.
 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.
 public Entity createEntity(EntityReference entityRef) 
    Constructs a new DOM4J Entity from the provided StAX EntityReference event.
 public Namespace createNamespace(Namespace ns) 
    Constructs a new DOM4J Namespace from the provided StAX Namespace event.
 public ProcessingInstruction createProcessingInstruction(ProcessingInstruction pi) 
    Constructs a new DOM4J ProcessingInstruction from the provided StAX ProcessingInstruction event.
 public QName createQName(QName qname) 
    Constructs a new DOM4J QName from the provided JAXP QName.
 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.
 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.
 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.
 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.
 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.
 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.
 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.
 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.
 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.
 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.
 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.
 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.

 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.
 public  void setDocumentFactory(DocumentFactory documentFactory) 
    Sets the DocumentFactory to be used when constructing DOM4J nodes.