- /** Parses a line character by character for performance purpose */
- protected List<String> parseLine(String str) {
- List<String> tokens = new ArrayList<String>();
+ /**
+ * Called before each (logical) line is processed, giving a change to modify
+ * it (typically for cleaning dirty files). To be overridden, return the
+ * line unchanged by default. Skip the line if 'null' is returned.
+ */
+ protected String preProcessLine(String line) {
+ return line;
+ }
+
+ /**
+ * Parses a line character by character for performance purpose
+ *
+ * @return whether to continue parsing this line
+ */
+ protected Boolean parseLine(String str, List<String> tokens,
+ StringBuffer currStr, Boolean wasInquote) {
+ // List<String> tokens = new ArrayList<String>();
+
+ // System.out.println("#LINE: " + str);
+
+ if (wasInquote)
+ currStr.append('\n');