Changeset 3416
- Timestamp:
- May 31, 2007, 10:48:52 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/util/parser/FlatFileParser.java
r3264 r3416 882 882 lines from the stream. Each line is checked in the following order: 883 883 <ol> 884 <li>Does it match the {@link #setIgnoreRegexp(Pattern) ignore} regular 885 expression?</li> 886 <li>Does it match the {@link #setDataFooterRegexp(Pattern) data footer} 887 regular expression?</li> 888 <li>Does it match the {@link #setSectionRegexp(Pattern) section} 889 regular expression?</li> 884 890 <li>Can it be split by the {@link #setDataSplitterRegexp(Pattern) data} 885 regular expression into the appropriate number of columns? 886 <li>Does it match the {@link #setDataFooterRegexp(Pattern) data footer} 887 regular expression? 888 <li>Does it match the {@link #setSectionRegexp(Pattern) section} 889 regular expression? 891 regular expression into the appropriate number of columns?</li> 890 892 </ol> 891 893 If the first check is true, TRUE is returned and the data may be … … 937 939 } 938 940 } 941 942 // Check if it matches the data footer regexp 943 if (!done && dataFooter != null) 944 { 945 Matcher m = dataFooter.matcher(line); 946 done = m.matches(); 947 } 948 949 // Check if it matches the section regexp 950 if (!done && section != null) 951 { 952 Matcher m = section.matcher(line); 953 if (m.matches() && (m.groupCount() == 1)) 954 { 955 done = true; 956 nextSection = new Line(parsedLines, line, m.group(1), LineType.SECTION); 957 lines.add(nextSection); 958 } 959 } 939 960 940 961 if (!done) … … 947 968 done = true; 948 969 nextData = new Data(parsedLines, line, columns, emptyIsNull, nullIsNull); 949 }950 }951 952 // Check if it matches the data footer regexp953 if (!done && (dataFooter != null))954 {955 Matcher m = dataFooter.matcher(line);956 done = m.matches();957 }958 959 // Check if it matches the section regexp960 if (!done && (section != null))961 {962 Matcher m = section.matcher(line);963 if (m.matches() && (m.groupCount() == 1))964 {965 done = true;966 nextSection = new Line(parsedLines, line, m.group(1), LineType.SECTION);967 lines.add(nextSection);968 970 } 969 971 }
Note: See TracChangeset
for help on using the changeset viewer.