Package org.apache.ofbiz.datafile
Class DataFile
java.lang.Object
org.apache.ofbiz.datafile.DataFile
DataFile main class
-
Constructor Summary
ModifierConstructorDescriptionprotected
DataFile()
DataFile
(ModelDataFile modelDataFile) Construct a DataFile object setting the model, does not load it -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add record.Gets records.static DataFile
makeDataFile
(URL definitionUrl, String dataFileName) Creates a DataFile object using the specified definition.makeRecord
(String recordName) Make record record.makeRecordIterator
(URL fileUrl) Make record iterator record iterator.void
readDataFile
(String content) Populates (or reloads) the data file with the text of the given contentReturns the records in this DataFile object as a plain text data file contentvoid
writeDataFile
(OutputStream outStream) Writes the records in this DataFile object to the given OutputStreamvoid
writeDataFile
(String filename) Writes the records in this DataFile object to a text data file
-
Constructor Details
-
DataFile
Construct a DataFile object setting the model, does not load it- Parameters:
modelDataFile
- The model of the DataFile to instantiate
-
DataFile
protected DataFile()
-
-
Method Details
-
makeDataFile
public static DataFile makeDataFile(URL definitionUrl, String dataFileName) throws DataFileException Creates a DataFile object using the specified definition.- Parameters:
definitionUrl
- The location of the data file definition XML filedataFileName
- The data file model name, as specified in the definition XML file- Returns:
- A new DataFile object
- Throws:
DataFileException
- Exception thown for various errors, generally has a nested exception
-
getRecords
Gets records.- Returns:
- the records
-
addRecord
Add record.- Parameters:
record
- the record
-
makeRecord
Make record record.- Parameters:
recordName
- the record name- Returns:
- the record
-
readDataFile
Populates (or reloads) the data file with the text of the given content- Parameters:
content
- The text data to populate the DataFile with- Throws:
DataFileException
- Exception thown for various errors, generally has a nested exception
-
makeRecordIterator
Make record iterator record iterator.- Parameters:
fileUrl
- the file url- Returns:
- the record iterator
- Throws:
DataFileException
- the data file exception
-
writeDataFile
Writes the records in this DataFile object to a text data file- Parameters:
filename
- The filename to put the data into- Throws:
DataFileException
- Exception thrown for various errors, generally has a nested exception
-
writeDataFile
Returns the records in this DataFile object as a plain text data file content- Returns:
- A String containing what would go into a data file as plain text
- Throws:
DataFileException
- Exception thown for various errors, generally has a nested exception
-
writeDataFile
Writes the records in this DataFile object to the given OutputStream- Parameters:
outStream
- The Stream to put the data into- Throws:
DataFileException
- Exception thown for various errors, generally has a nested exception
-