org.mmbase.bridge.util.xml
Class Generator

java.lang.Object
  |
  +--org.mmbase.bridge.util.xml.Generator

public class Generator
extends java.lang.Object

Uses the XML functions from the bridge the construct DOM elements representing MMBase data structures.

Version:
$Id: Generator.java,v 1.16 2002/09/30 12:37:20 michiel Exp $
Author:
Michiel Meeuwissen, Eduard Witteveen

Constructor Summary
Generator(javax.xml.parsers.DocumentBuilder documentBuilder)
           
Generator(javax.xml.parsers.DocumentBuilder documentBuilder, Cloud cloud)
          To create documents representing structures from the cloud, it needs a documentBuilder, to contruct the DOM Document, and the cloud from which the data to be inserted will come from.
 
Method Summary
 void add(Node node)
          Adds one Node to a DOM Document.
 void add(Node node, Field fieldDefinition)
          Adds a field to the DOM Document.
 void add(NodeList nodes)
          Adds a whole MMBase bridge NodeList to the DOM Document.
 void add(Relation relation)
          Adds one Relation to a DOM Document.
 void add(RelationList relations)
          Adds one Relation to a DOM Document.
 org.w3c.dom.Document getDocument()
          Returns the working DOM document.
 java.lang.String toString()
          Returns the document as a String.
 java.lang.String toString(boolean ident)
          Returns the document as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Generator

public Generator(javax.xml.parsers.DocumentBuilder documentBuilder,
                 Cloud cloud)
To create documents representing structures from the cloud, it needs a documentBuilder, to contruct the DOM Document, and the cloud from which the data to be inserted will come from.
Parameters:
documentBuilder - The DocumentBuilder which will be used to create the Document.
cloud - The cloud from which the data will be.

Generator

public Generator(javax.xml.parsers.DocumentBuilder documentBuilder)
Method Detail

getDocument

public org.w3c.dom.Document getDocument()
Returns the working DOM document.
Returns:
The document, build with the operations done on the generator class

toString

public java.lang.String toString()
Returns the document as a String.
Overrides:
toString in class java.lang.Object
Returns:
the xml generated as an string

toString

public java.lang.String toString(boolean ident)
Returns the document as a String.
Parameters:
ident - if the string has to be idented
Returns:
the generated xml as a (formatted) string

add

public void add(Node node,
                Field fieldDefinition)
Adds a field to the DOM Document. This means that there will also be added a Node if this is necessary.
Parameters:
An - MMbase bridge Node.
An - MMBase bridge Field.

add

public void add(Node node)
Adds one Node to a DOM Document.
Parameters:
An - MMBase bridge Node.

add

public void add(Relation relation)
Adds one Relation to a DOM Document.
Parameters:
An - MMBase bridge Node.

add

public void add(NodeList nodes)
Adds a whole MMBase bridge NodeList to the DOM Document.
Parameters:
An - MMBase bridge NodeList.

add

public void add(RelationList relations)
Adds one Relation to a DOM Document.
Parameters:
An - MMBase bridge Node.


MMBase build 1.6.5.20030923