| java.lang.Object org.mmbase.util.xml.applicationdata.NodeWriter
NodeWriter | public class NodeWriter (Code) | | Utility class for writing xml files for data- and relation sources, suppied by an application export class.
Does not support or export dtd information.
author: Daniel Ockeleon author: Jaco de Groot author: Pierre van Rooden version: $Id: NodeWriter.java,v 1.5 2007/04/05 14:04:18 pierre Exp $ |
Constructor Summary | |
| NodeWriter(MMBase mmb, Logger logger, String directory, String builderName, boolean isRelationNode) Constructor, opens the initial xml file and writes a header. |
Method Summary | |
public void | done() Writes a footer to the xml file, and closes the file. | static boolean | saveFile(String filename, byte[] value) | public void | write(MMObjectNode node) Writes a node (object) to the datasource file. |
NodeWriter | NodeWriter(MMBase mmb, Logger logger, String directory, String builderName, boolean isRelationNode)(Code) | | Constructor, opens the initial xml file and writes a header.
The file opened for writing is [directory]/[buildername].xml.
Parameters: mmb - MMBase object for retrieving type information Parameters: logger - place to log results. Parameters: directory - the directory to write the files to (including thetrailing slash). Parameters: buildername - name of the builder to export Parameters: isRelationNode - if true , the source to write is a relationsource.Otherwise, a datasource is written. |
done | public void done()(Code) | | Writes a footer to the xml file, and closes the file.
|
saveFile | static boolean saveFile(String filename, byte[] value)(Code) | | Stores binary data in a file
Parameters: filename - path of the file to store the data Parameters: value - binary data to store (byte array) true if the write was succesful, false if an exception occurred |
write | public void write(MMObjectNode node)(Code) | | Writes a node (object) to the datasource file.
Relationsources are stored in a slightly different format from data sources.
Parameters: node - The object to store. |
|
|