org.ofbiz.datafile
Class RecordIterator
java.lang.Object
org.ofbiz.datafile.RecordIterator
public class RecordIterator
- extends java.lang.Object
Record Iterator for reading large files
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
module
public static final java.lang.String module
br
protected java.io.BufferedReader br
modelDataFile
protected ModelDataFile modelDataFile
dataFileStream
protected java.io.InputStream dataFileStream
closed
protected boolean closed
locationInfo
protected java.lang.String locationInfo
nextLineNum
protected int nextLineNum
curLine
protected java.lang.String curLine
curRecord
protected Record curRecord
nextLine
protected java.lang.String nextLine
nextRecord
protected Record nextRecord
eof
protected java.lang.String eof
RecordIterator
public RecordIterator(java.net.URL fileUrl,
ModelDataFile modelDataFile)
throws DataFileException
- Throws:
DataFileException
RecordIterator
public RecordIterator(java.io.InputStream dataFileStream,
ModelDataFile modelDataFile,
java.lang.String locationInfo)
throws DataFileException
- Throws:
DataFileException
setupStream
protected void setupStream(java.io.InputStream dataFileStream,
java.lang.String locationInfo)
throws DataFileException
- Throws:
DataFileException
getNextLine
protected boolean getNextLine()
throws DataFileException
- Throws:
DataFileException
getCurrentLineNumber
public int getCurrentLineNumber()
hasNext
public boolean hasNext()
next
public Record next()
throws DataFileException
- Throws:
DataFileException
close
public void close()
throws DataFileException
- Throws:
DataFileException
findModelForLine
protected static ModelRecord findModelForLine(java.lang.String line,
int lineNum,
ModelDataFile modelDataFile)
throws DataFileException
- Searches through the record models to find one with a matching type-code, if no type-code exists that model will always be used if it gets to it
- Parameters:
line
- lineNum
- modelDataFile
-
- Returns:
-
- Throws:
DataFileException
- Exception thown for various errors, generally has a nested exception