org.mmbase.util.xml
Class BuilderWriter

Package class diagram package BuilderWriter
java.lang.Object
  extended by org.mmbase.util.xml.DocumentReader
      extended by org.mmbase.util.xml.DocumentWriter
          extended by org.mmbase.util.xml.BuilderWriter

public class BuilderWriter
extends DocumentWriter

Class for creating builder configuration documents. Use this class to create a DOM document for a given builder. The document can then be used internally or serialized using a number of utility methods. This writer takes extension of builders (inheritance) into account. XXX This class actually transforms nice builder XML's to stupid automatic XML's in deprecated format, forgetting all comments, alls datatype extensions. TODO: This is broken!

Since:
MMBase-1.6
Version:
$Id: BuilderWriter.java 45150 2011-02-10 09:18:12Z michiel $
Author:
Pierre van Rooden

Field Summary
 
Fields inherited from class org.mmbase.util.xml.DocumentWriter
publicId, systemId
 
Fields inherited from class org.mmbase.util.xml.DocumentReader
document, DTD_ERROR, DTD_ERROR_1_0, FILENOTFOUND, PUBLIC_ID_ERROR, PUBLIC_ID_ERROR_1_0, utilProperties
 
Constructor Summary
BuilderWriter(MMObjectBuilder builder)
          Constructs the document writer.
 
Method Summary
protected  void generate()
          Generates the document.
 boolean getExpandBuilder()
          Gets whether the builder will expand when writing.
 void setExpandBuilder(boolean value)
          Sets whether the builder will expand when writing.
 
Methods inherited from class org.mmbase.util.xml.DocumentWriter
, addComment, addComment, addComment, addContentElement, generateDocument, getDocument, getMessage, getMessage, getMessage, getMessage, getMessageRetriever, includeComments, setIncludeComments, write, writeToFile, writeToStream, writeToString
 
Methods inherited from class org.mmbase.util.xml.DocumentReader
appendChild, getAttribute, getChildElements, getChildElements, getChildElements, getChildElements, getDocumentBuilder, getDocumentBuilder, getDocumentBuilder, getDocumentBuilder, getElementAttributeValue, getElementAttributeValue, getElementByPath, getElementByPath, getElementName, getElementValue, getElementValue, getNodeTextValue, getNodeTextValue, getRootElement, getSystemId, hasAttribute, main, registerPublicIDs, setNodeTextValue, setPrefix, setSystemId, toDocument, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuilderWriter

public BuilderWriter(MMObjectBuilder builder)
              throws DOMException
Constructs the document writer. The constructor calls its super to create a basic document, based on the builder document type.

Parameters:
builder - the builder for which to create an XML document.
Throws:
DOMException
Method Detail

generate

protected void generate()
                 throws DOMException
Generates the document. Can only be called once.

Specified by:
generate in class DocumentWriter
Throws:
DOMException - when an error occurred during generation

setExpandBuilder

public void setExpandBuilder(boolean value)
Sets whether the builder will expand when writing. Expanding means that all data of a builder is written, including non-overriden data from parent builders.

Parameters:
value - if true, the buidler will expand

getExpandBuilder

public boolean getExpandBuilder()
Gets whether the builder will expand when writing. Expanding means that all data of a builder is written, including non-overriden data from parent builders.

Returns:
if true, the buidler will expand


MMBase2 Core 2.0-SNAPSHOT - 2014-09-22T23:08