com.steptools.stdev.p21
Class Part21Parser

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

public class Part21Parser
extends java.lang.Object

Provides the facilities to read a Part 21 file and populate a model from the instance data contained in the file.


Constructor Summary
Part21Parser()
           
 
Method Summary
 SchemaBase getSchema(java.lang.String name)
          Find the schema for a given name.
 Model parse(java.io.File src)
          Read a Part 21 file into a Model.
 void parse(java.io.File src, Model mod, EntityIDTable eids, boolean set_header, boolean one_sect)
          Read a Part 21 file into an existing Model.
 Model parse(java.io.Reader in)
          Read a Part 21 file into a Model.
 void parse(java.io.Reader in, Model mod, EntityIDTable eids, boolean set_header, boolean one_sect)
          Read a Part 21 file into an existing Model.
 Model parse(java.lang.String fname)
          Read a Part 21 file into a Model.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Part21Parser

public Part21Parser()
             throws STDevException
Throws:
STDevException
Method Detail

parse

public Model parse(java.lang.String fname)
            throws STDevException,
                   java.io.IOException
Read a Part 21 file into a Model.

Parameters:
fname - The file name.
Returns:
The model that contains the instances in the file
Throws:
STDevException - There was some problem parsing the file
java.io.IOException - An I/O exception occurred getting the input

parse

public Model parse(java.io.File src)
            throws STDevException,
                   java.io.IOException
Read a Part 21 file into a Model.

Parameters:
src - The file to read.
Returns:
The model that contains the instances in the file
Throws:
STDevException - There was some problem parsing the file
java.io.IOException - An I/O exception occurred getting the input

parse

public Model parse(java.io.Reader in)
            throws STDevException,
                   java.io.IOException
Read a Part 21 file into a Model.

Parameters:
in - The reader to read
Returns:
The model that contains the instances in the file
Throws:
STDevException - There was some problem parsing the file
java.io.IOException - An I/O exception occurred getting the input

parse

public void parse(java.io.File src,
                  Model mod,
                  EntityIDTable eids,
                  boolean set_header,
                  boolean one_sect)
           throws STDevException,
                  java.io.IOException
Read a Part 21 file into an existing Model.

Parameters:
src - The Part 21 file to read
mod - The model to populate
eids - The entity ID table to populate
set_header - Add the file header as a section to the model.
one_sect - Force everything into one data population
Throws:
STDevException - There was some problem parsing the file
java.io.IOException - An I/O exception occurred getting the input

parse

public void parse(java.io.Reader in,
                  Model mod,
                  EntityIDTable eids,
                  boolean set_header,
                  boolean one_sect)
           throws STDevException,
                  java.io.IOException
Read a Part 21 file into an existing Model.

Parameters:
in - The reader to read
mod - The model to populate
eids - The entity ID table to populate
set_header - Add the file header as a section to the model.
one_sect - Force everything into one data population
Throws:
STDevException - There was some problem parsing the file
java.io.IOException - An I/O exception occurred getting the input

getSchema

public SchemaBase getSchema(java.lang.String name)
                     throws SchemaNotFoundException
Find the schema for a given name. This method can be overridden in subclasses to control which schema is used, based on the specified file name

Parameters:
name - The name of the schema as specified in Part 21
Returns:
The schema to to use for the given name.
Throws:
SchemaNotFoundException - the schema could not be found.