public class Part21Writer extends Object
Modifier and Type | Class and Description |
---|---|
class |
Part21Writer.State
State of the Part 21 writer.
|
Modifier and Type | Field and Description |
---|---|
String |
EOLN
The line ending sequence.
|
int |
fill_column
The fill column for the Part21 file.
|
boolean |
keep_partial
If true, does not attempt to clean up when
statusUpdate()
throws a CanceledException. |
int |
status_freq
Set the frequency at which the statusUpdate method is called.
|
boolean |
update_header
If true, modify the instances in the header to reflect the values
written into the Part21 file.
|
boolean |
update_timestamp
If true (default), update the timestamp in the FILE_NAME record
to reflect the current time.
|
Constructor and Description |
---|
Part21Writer() |
Modifier and Type | Method and Description |
---|---|
ListString |
getSchema(Model mod)
Get the list of strings to be written as the schemas in a Part21 file.
|
String |
getSchema(SchemaBase schema)
Get the name of a schemas as written to a Part21 file.
|
void |
statusUpdate(Part21Writer.State st)
The method is called periodically as the data is written.
|
void |
write(File out,
Model mod)
Write a model as a part 21 file.
|
void |
write(OutputStream stream,
Model mod,
String fname)
Write a model as a part 21 file.
|
void |
write(String filename,
Model mod)
Write a model as a part 21 file
|
void |
write(Writer wr,
Model mod,
String fname)
Write a model as a part 21 file
|
public String EOLN
public int fill_column
public boolean update_header
public boolean update_timestamp
public int status_freq
status_freq
instances
are read in.public boolean keep_partial
statusUpdate()
throws a CanceledException. If a write method that specifies an output
file (not a stream) is used, the file will be deleted is keep_partial is
true.public void statusUpdate(Part21Writer.State st) throws CanceledException
status_freq
instance variable.
The write will be aborted if this method throws an exception.st
- The parser state information. This can be queried to
obtain the number of bytes in the file, the number of bytes ready by
the parser, and the number is insteances read.CanceledException
- to signal the write to stop writing the
data.public void write(String filename, Model mod) throws IOException, STDevException
filename
- The file to write the output tomod
- The model to outputIOException
STDevException
public void write(File out, Model mod) throws IOException, STDevException
CanceledException
is
thrown by a subtype's statusUpdate() method, the output file will be
deleted unless keep_partial
is true.out
- The file to write the output to.mod
- The model to output.IOException
STDevException
public void write(OutputStream stream, Model mod, String fname) throws IOException, STDevException
stream
- The output stream to write to.mod
- The model to outputfname
- The file name.IOException
STDevException
public void write(Writer wr, Model mod, String fname) throws IOException, STDevException
wr
- The write to sent the output tomod
- The model to outputfname
- The filename (used to set the file name in the header)IOException
STDevException
public ListString getSchema(Model mod)
mod
- The model being processed.public String getSchema(SchemaBase schema)
schema
- The schema whose name is getting retrieved.