project35.io
Class Project35DataFileWriter

java.lang.Object
  extended by project35.io.Project35DataFileWriter

public class Project35DataFileWriter
extends java.lang.Object

Write out a data file in an XML format that will validate against the original schema. Note that the output is an Unicode XML text file.


Copyright (c) 2008 Kevin Garwood for Project35. The original code was developed by Kevin Garwood for the University of Manchester. Revisions have been made for Project35, a project that is independent of that institution. This code is licensed under the Academic Free License version 3.0. The code attribution for the original code is included here:

Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.


Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)

Constructor Summary
Project35DataFileWriter(Project35FormContext project35FormContext, boolean writeTemplate, boolean writeChildRecords)
           
 
Method Summary
static java.lang.String escapeXml(java.lang.String str)
          Convenience method for escaping XML characters in a given String.
 void initialiseCommentFacility(ModelObjectCommentRegistry modelObjectCommentRegistry, java.lang.Object userObject)
           
 void omitModelStamp()
           
 void setDocumentHeaderComment(java.lang.String documentHeaderComment)
          Set the value of documentHeaderComment.
protected  void visitRecordModel(int indentationLevel, RecordModel recordModel, java.io.OutputStreamWriter out)
           
 void write(java.io.OutputStream outputStream, RecordModel recordModel)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Project35DataFileWriter

public Project35DataFileWriter(Project35FormContext project35FormContext,
                               boolean writeTemplate,
                               boolean writeChildRecords)
Method Detail

escapeXml

public static java.lang.String escapeXml(java.lang.String str)
Convenience method for escaping XML characters in a given String. It translates: The method does not throw a NullPointerException if the given String is null. Instead, it returns a null.

Parameters:
str -
Returns:
the converted result of escaping the str input string.

setDocumentHeaderComment

public void setDocumentHeaderComment(java.lang.String documentHeaderComment)
Set the value of documentHeaderComment.

Parameters:
documentHeaderComment - Value to assign to documentHeaderComment.

write

public void write(java.io.OutputStream outputStream,
                  RecordModel recordModel)
           throws java.io.IOException
Throws:
java.io.IOException

visitRecordModel

protected void visitRecordModel(int indentationLevel,
                                RecordModel recordModel,
                                java.io.OutputStreamWriter out)
                         throws java.io.IOException
Throws:
java.io.IOException

omitModelStamp

public void omitModelStamp()

initialiseCommentFacility

public void initialiseCommentFacility(ModelObjectCommentRegistry modelObjectCommentRegistry,
                                      java.lang.Object userObject)