Class BuildingStreamWriterImpl

  • All Implemented Interfaces:
    javax.xml.stream.XMLStreamWriter, BuildingStreamWriter

    public class BuildingStreamWriterImpl
    extends StreamWriterToReceiver
    implements BuildingStreamWriter
    This class is an implementation of XMLStreamWriter, allowing a document to be constructed by means of a series of XMLStreamWriter method calls such as writeStartElement(), writeAttribute(), writeCharacters(), and writeEndElement().

    The detailed way in which this class is packaged was carefully designed to ensure that if the functionality is not used, the DocumentBuilder would still be usable under JDK 1.5 (which does not include javax.xml.stream interfaces).

    • Constructor Detail

      • BuildingStreamWriterImpl

        public BuildingStreamWriterImpl​(Receiver receiver,
                                        Builder builder)
    • Method Detail

      • getDocumentNode

        public XdmNode getDocumentNode()
                                throws SaxonApiException
        Description copied from interface: BuildingStreamWriter
        After building the document by writing a sequence of events, retrieve the root node of the constructed document tree
        Specified by:
        getDocumentNode in interface BuildingStreamWriter
        Returns:
        the root node of the constructed tree. The result is undefined (maybe null, maybe an exception) if the method is called before successfully completing the sequence of events (of which the last should be XMLStreamWriter.writeEndDocument()) that constructs the tree.
        Throws:
        SaxonApiException - if any failure occurs