Package repast.simphony.integration
Class DataFileReader
- java.lang.Object
-
- repast.simphony.integration.DataFileReader
-
- All Implemented Interfaces:
Reader
public class DataFileReader extends Object implements Reader
This is the primary class for data file reading. This takes in a descriptor, a file name for the data, and an output writer and will parse the data file according to the descriptor, giving a final result.- Author:
- Jerry Vos
- See Also:
OutputBuilder
-
-
Field Summary
Fields Modifier and Type Field Description protected org.jdom.Document
descriptorDocument
-
Constructor Summary
Constructors Constructor Description DataFileReader(Object target)
Instantiates this reader with the specifiedOutputBuilder
used to build the object generated from the file.DataFileReader(OutputBuilder<?,?> outputBuilder)
Instantiates this reader with the specifiedOutputBuilder
used to build the object generated from the file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescriptorFileName()
String
getFileToParseName()
NewLinePatternConverter
getNewLineConverter()
OutputBuilder<?,?>
getoutputBuilder()
Object
getParseResult()
protected void
mark()
void
popMark()
void
read()
Loads in the xml descriptor file and causes the file to be parsed.protected void
restore()
void
setDescriptorFileName(String descriptorFileName)
void
setFileToParseName(String fileToParseName)
void
setNewLineConverter(NewLinePatternConverter newLineConverter)
void
setoutputBuilder(OutputBuilder<?,?> outputBuilder)
-
-
-
Constructor Detail
-
DataFileReader
public DataFileReader(OutputBuilder<?,?> outputBuilder)
Instantiates this reader with the specifiedOutputBuilder
used to build the object generated from the file.- Parameters:
outputBuilder
- used to build the result of the parsing
-
DataFileReader
public DataFileReader(Object target)
Instantiates this reader with the specifiedOutputBuilder
used to build the object generated from the file.- Parameters:
outputBuilder
- used to build the result of the parsing
-
-
Method Detail
-
restore
protected void restore() throws IOException
- Throws:
IOException
-
mark
protected void mark() throws IOException
- Throws:
IOException
-
read
public void read() throws IOException, org.jdom.JDOMException
Loads in the xml descriptor file and causes the file to be parsed. After calling this method (assuming it doesn't throw an exception), thegetParseResult()
method will return a value built from the read in file.- Specified by:
read
in interfaceReader
- Throws:
IOException
org.jdom.JDOMException
- See Also:
getDescriptorFileName()
,getFileToParseName()
,getParseResult()
-
getoutputBuilder
public OutputBuilder<?,?> getoutputBuilder()
-
setoutputBuilder
public void setoutputBuilder(OutputBuilder<?,?> outputBuilder)
-
getParseResult
public Object getParseResult()
-
getDescriptorFileName
public String getDescriptorFileName()
-
setDescriptorFileName
public void setDescriptorFileName(String descriptorFileName)
-
getFileToParseName
public String getFileToParseName()
-
setFileToParseName
public void setFileToParseName(String fileToParseName)
-
getNewLineConverter
public NewLinePatternConverter getNewLineConverter()
-
setNewLineConverter
public void setNewLineConverter(NewLinePatternConverter newLineConverter)
-
popMark
public void popMark()
-
-