Changeset 6458
- Timestamp:
- May 19, 2014, 9:08:39 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/util/parser/FlatFileParser.java
r6127 r6458 1093 1093 lines from the stream. Each line is checked in the following order: 1094 1094 <ol> 1095 <li>Does it match the {@link #setIgnoreRegexp(Pattern) ignore} regular1096 expression?</li>1097 1095 <li>Does it match the {@link #setDataFooterRegexp(Pattern) data footer} 1098 1096 regular expression?</li> 1099 1097 <li>Does it match the {@link #setSectionRegexp(Pattern) section} 1100 1098 regular expression?</li> 1099 <li>Does it match the {@link #setIgnoreRegexp(Pattern) ignore} regular 1100 expression?</li> 1101 1101 <li>Can it be split by the {@link #setDataSplitterRegexp(Pattern) data} 1102 1102 regular expression into the appropriate number of columns?</li> 1103 1103 </ol> 1104 If the first check is true, TRUE is returned and the data may be 1105 retrieved with the {@link #nextData() nextData} method. If the 1106 second check is true, FALSE is returned and no more data may be 1107 retrieved. If the third check is true, FALSE is returnd and no 1108 more data may be retrived but the section may be retrived with 1109 the {@link #nextSection() nextSection} method. If neither one is 1110 true, the processing continues with the next line until the end 1111 of file is reached. 1104 If the first or second check is true, FALSE is returned no more data may be 1105 retrieved, but a section may be retrived with the {@link #nextSection() nextSection} 1106 method. If the third check is true, the line is ignored and the processing 1107 continues with the next line. If the fourth check is true, TRUE is 1108 returned and the data may be retrieved with the {@link #nextData() nextData} method. 1112 1109 1113 1110 @return TRUE if there is more data, FALSE otherwise … … 1141 1138 parsedDataLines++; 1142 1139 parsedCharacters += line.length(); 1143 1144 // Check if it is a comment line1145 if (!done && ignore != null)1146 {1147 Matcher m = ignore.matcher(line);1148 if (m.matches())1149 {1150 ignoredLines++;1151 if (keepSkippedLines) skippedLines.add(new Line(parsedLines, line, LineType.IGNORED));1152 1153 // Skip to next line1154 /* #### CONTINUE-STATEMENT #### */1155 continue;1156 }1157 }1158 1140 1159 1141 // Check if it matches the data footer regexp … … 1176 1158 } 1177 1159 } 1178 1160 1161 // Check if it is a comment line 1162 if (!done && ignore != null) 1163 { 1164 Matcher m = ignore.matcher(line); 1165 if (m.matches()) 1166 { 1167 ignoredLines++; 1168 if (keepSkippedLines) skippedLines.add(new Line(parsedLines, line, LineType.IGNORED)); 1169 1170 // Skip to next line 1171 /* #### CONTINUE-STATEMENT #### */ 1172 continue; 1173 } 1174 } 1175 1179 1176 if (!done) 1180 1177 {
Note: See TracChangeset
for help on using the changeset viewer.