com.steptools.stdev.p21
Class Part21Writer

java.lang.Object
  extended by com.steptools.stdev.p21.Part21Writer

public class Part21Writer
extends java.lang.Object

Provides the methods to write the contents of a model into a Part 21 file


Field Summary
 boolean update_header
          If true, modify the instances in the header to reflect the values written into the Part21 file.
 
Constructor Summary
Part21Writer()
           
 
Method Summary
 ListString getSchema(Model mod)
          Get the list of strings to be written as the schemas in a Part21 file.
 void write(java.io.File out, Model mod)
          Write a model as a part 21 file
 void write(java.lang.String filename, Model mod)
          Write a model as a part 21 file
 void write(java.io.Writer wr, Model mod, java.lang.String fname)
          Write a model as a part 21 file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

update_header

public boolean update_header
If true, modify the instances in the header to reflect the values written into the Part21 file. In this is false, the header values copies before being updated and written to the Part 21 file. By default this is true.

Constructor Detail

Part21Writer

public Part21Writer()
Method Detail

write

public void write(java.lang.String filename,
                  Model mod)
           throws java.io.IOException
Write a model as a part 21 file

Parameters:
filename - The file to write the output to
mod - The model to output
Throws:
java.io.IOException

write

public void write(java.io.File out,
                  Model mod)
           throws java.io.IOException
Write a model as a part 21 file

Parameters:
out - The file to write the output to
mod - The model to output
Throws:
java.io.IOException

write

public void write(java.io.Writer wr,
                  Model mod,
                  java.lang.String fname)
Write a model as a part 21 file

Parameters:
wr - The write to sent the output to
mod - The model to output
fname - The filename (used to set the file name in the header)

getSchema

public ListString getSchema(Model mod)
Get the list of strings to be written as the schemas in a Part21 file. This method can be overidden in a subtype to control how schemas are written

Parameters:
mod - The model being processed.
Returns:
The list of schemas to be written into the Part 21 header.