|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ofbiz.datafile.DataFile
public class DataFile
DataFile main class
| Field Summary | |
|---|---|
protected ModelDataFile |
modelDataFile
Contains the definition for the file |
static java.lang.String |
module
|
protected java.util.List<Record> |
records
List of record in the file, contains Record objects |
| Constructor Summary | |
|---|---|
protected |
DataFile()
|
|
DataFile(ModelDataFile modelDataFile)
Construct a DataFile object setting the model, does not load it |
| Method Summary | |
|---|---|
void |
addRecord(Record record)
|
ModelDataFile |
getModelDataFile()
|
java.util.List<Record> |
getRecords()
|
static DataFile |
makeDataFile(java.net.URL definitionUrl,
java.lang.String dataFileName)
Creates a DataFile object using the specified definition. |
Record |
makeRecord(java.lang.String recordName)
|
RecordIterator |
makeRecordIterator(java.io.InputStream dataFileStream,
java.lang.String locationInfo)
|
RecordIterator |
makeRecordIterator(java.net.URL fileUrl)
|
void |
readDataFile(java.io.InputStream dataFileStream,
java.lang.String locationInfo)
Loads (or reloads) the data file from the given stream |
void |
readDataFile(java.lang.String content)
Populates (or reloads) the data file with the text of the given content |
void |
readDataFile(java.net.URL fileUrl)
Loads (or reloads) the data file at the pre-specified location. |
static DataFile |
readFile(java.net.URL fileUrl,
java.net.URL definitionUrl,
java.lang.String dataFileName)
Creates a DataFile object which will contain the parsed objects for the specified datafile, using the specified definition. |
java.lang.String |
writeDataFile()
Returns the records in this DataFile object as a plain text data file content |
void |
writeDataFile(java.io.OutputStream outStream)
Writes the records in this DataFile object to the given OutputStream |
void |
writeDataFile(java.lang.String filename)
Writes the records in this DataFile object to a text data file |
protected void |
writeRecords(java.io.OutputStream outStream,
java.util.List<Record> records)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String module
protected java.util.List<Record> records
protected ModelDataFile modelDataFile
| Constructor Detail |
|---|
public DataFile(ModelDataFile modelDataFile)
modelDataFile - The model of the DataFile to instantiateprotected DataFile()
| Method Detail |
|---|
public static DataFile readFile(java.net.URL fileUrl,
java.net.URL definitionUrl,
java.lang.String dataFileName)
throws DataFileException
fileUrl - The URL where the data file is locateddefinitionUrl - The location of the data file definition XML filedataFileName - The data file model name, as specified in the definition XML file
DataFileException - Exception thown for various errors, generally has a nested exception
public static DataFile makeDataFile(java.net.URL definitionUrl,
java.lang.String dataFileName)
throws DataFileException
definitionUrl - The location of the data file definition XML filedataFileName - The data file model name, as specified in the definition XML file
DataFileException - Exception thown for various errors, generally has a nested exceptionpublic ModelDataFile getModelDataFile()
public java.util.List<Record> getRecords()
public void addRecord(Record record)
public Record makeRecord(java.lang.String recordName)
public void readDataFile(java.net.URL fileUrl)
throws DataFileException
fileUrl - The URL that the file will be loaded from
DataFileException - Exception thown for various errors, generally has a nested exception
public void readDataFile(java.lang.String content)
throws DataFileException
content - The text data to populate the DataFile with
DataFileException - Exception thown for various errors, generally has a nested exception
public void readDataFile(java.io.InputStream dataFileStream,
java.lang.String locationInfo)
throws DataFileException
dataFileStream - A stream containing the text data for the data filelocationInfo - Text information about where the data came from for exception messages
DataFileException - Exception thown for various errors, generally has a nested exception
public RecordIterator makeRecordIterator(java.net.URL fileUrl)
throws DataFileException
DataFileException
public RecordIterator makeRecordIterator(java.io.InputStream dataFileStream,
java.lang.String locationInfo)
throws DataFileException
DataFileException
public void writeDataFile(java.lang.String filename)
throws DataFileException
filename - The filename to put the data into
DataFileException - Exception thown for various errors, generally has a nested exception
public java.lang.String writeDataFile()
throws DataFileException
DataFileException - Exception thown for various errors, generally has a nested exception
public void writeDataFile(java.io.OutputStream outStream)
throws DataFileException
outStream - The Stream to put the data into
DataFileException - Exception thown for various errors, generally has a nested exception
protected void writeRecords(java.io.OutputStream outStream,
java.util.List<Record> records)
throws DataFileException
DataFileException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||