public class Generator extends Object
| Constructor and Description |
|---|
Generator(Document doc) |
Generator(DocumentBuilder documentBuilder) |
Generator(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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(List<? extends Node> nodes)
Adds a whole MMBase bridge NodeList to the DOM Document.
|
Element |
add(Node node)
Adds one Node to a DOM Document.
|
Element |
add(Node node,
Field fieldDefinition)
Adds a field to the DOM Document.
|
Element |
add(Relation relation)
Adds one Relation to a DOM Document.
|
protected Element |
createElement(String name) |
protected String |
getAttribute(Element element,
String name) |
long |
getCost()
Returns an estimation on how long it took to construct the document.
|
Document |
getDocument()
Returns the working DOM document.
|
int |
getSize()
The number of presented MMBase nodes in the document.
|
boolean |
isNamespaceAware() |
protected void |
setAttribute(Element element,
String name,
String value) |
void |
setNamespaceAware(boolean n)
If namespace aware, element are created with the namespace http://www.mmbase.org/objects,
otherwise, without namespace.
|
String |
toString()
Returns the document as a String.
|
String |
toString(boolean ident)
Returns the document as a String.
|
public static final String NAMESPACE
public Generator(DocumentBuilder documentBuilder, Cloud cloud)
documentBuilder - The DocumentBuilder which will be used to create the Document.cloud - The cloud from which the data will be.DocumentReader.getDocumentBuilder()public Generator(DocumentBuilder documentBuilder)
public Generator(Document doc)
public long getCost()
public int getSize()
public Document getDocument()
public void setNamespaceAware(boolean n)
public boolean isNamespaceAware()
public String toString()
public String toString(boolean ident)
ident - if the string has to be identedpublic Element add(Node node, Field fieldDefinition)
node - An MMbase bridge Node.fieldDefinition - An MMBase bridge Field.public Element add(Node node)
node - An MMBase bridge Node.public Element add(Relation relation)
relation - An MMBase bridge Node.MMBase 1.9-SNAPSHOT - ${javadoctimestamp}