- All Known Implementing Classes:
public interface StringDetector
Interface for checking if a text line in a file seems to be decoded correctly with the current character set. See the
SimpleStringDetector for a
simple implementation that can be used to detect the encoding in a datafile
that contains a header line.
Modifier and Type Method Description
String line)(int lineNo,Check the given line.
(int parsedLines)This is called when the end of file has been reached and the checkLine method has returned false for all lines.
checkLineCheck the given line. The detector should return TRUE if it can be certain that the file has been decoded correctly. If it can be sure that the file has been decoded incorrecty it should throw an IOException. If the detector is not sure without more data, it should return false.
eofvoid eof(int parsedLines) throws IOExceptionThis is called when the end of file has been reached and the checkLine method has returned false for all lines. If this is considered to be an incorrect decoding condition, the detector should throw an IOException, otherwise it should simply return. Note that this method is not called if TRUE is returned from the checkLine method.