org.apache.ecs.factory
Class DOMFactory

java.lang.Object
  |
  +--org.apache.ecs.factory.DOMFactory

public class DOMFactory
extends java.lang.Object


Field Summary
private  java.io.ByteArrayOutputStream outStream
           
 
Constructor Summary
DOMFactory()
          Default Constructor.
 
Method Summary
 org.w3c.dom.Document createDOM()
          Creates a Document from the root element of the XML Stream.
 java.io.OutputStream getOutputStream()
          Gets the output stream for the ecs element to write to.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

outStream

private java.io.ByteArrayOutputStream outStream
Constructor Detail

DOMFactory

public DOMFactory()
Default Constructor. Here is a simple example on how to use this class.
PI p = new PI();
p.setVersion(1.0);
XML x = new XML("root",true);
XML x1 = new XML("page",true);
XML x2 = new XML("paragraph");
XML x3 = new XML("paragraph");
x2.addElement("This is the first Paragraph");
x3.addElement("This is the second Paragraph");
x.addElement(x1.addElement(x2).addElement(x3));
p.addElement(x);
DOMFactory d = new DOMFactory();
p.output(d.getOutputStream());

Document doc = d.createDOM();
Method Detail

getOutputStream

public java.io.OutputStream getOutputStream()
Gets the output stream for the ecs element to write to.

createDOM

public org.w3c.dom.Document createDOM()
Creates a Document from the root element of the XML Stream.


Copyright © 1999-2003 Apache Software Foundation. All Rights Reserved.