* @see org.aavso.tools.vstar.input.AbstractObservationRetriever#retrieveObservations()
*/
public void retrieveObservations() throws ObservationReadError {
try {
CommonTextFormatValidator validator = this.analyser
.getTextFormatValidator(reader);
int lineNum = 0;
while (validator.next() && !wasInterrupted()) {
// Ignore comment, blank line or column header line
// (e.g. JD,Magnitude,...).
String line = validator.getRawRecord();
lineNum++;
if (!line.startsWith("#") && !line.matches("^\\s*$")
&& !isColumnHeaderLine(line)) {
try {
ValidObservation validOb = validator.validate();
if (validOb != null) {
addValidObservation(validOb, lineNum);
}
} catch (ObservationValidationError e) {
InvalidObservation invalidOb = new InvalidObservation(
validator.getRawRecord(), e.getMessage());
invalidOb.setRecordNumber(lineNum);
addInvalidObservation(invalidOb);
} catch (ObservationValidationWarning e) {
InvalidObservation invalidOb = new InvalidObservation(
validator.getRawRecord(), e.getMessage(), true);
invalidOb.setRecordNumber(lineNum);
addInvalidObservation(invalidOb);
addValidObservation(e.getObservation(), lineNum);
}