Skip to content
Snippets Groups Projects
Commit f2953db9 authored by ribeaudc's avatar ribeaudc
Browse files

TODO added.

SVN: 118
parent a53c0aed
No related branches found
No related tags found
No related merge requests found
...@@ -82,18 +82,6 @@ public class DefaultReaderParser<E> implements IReaderParser<E> ...@@ -82,18 +82,6 @@ public class DefaultReaderParser<E> implements IReaderParser<E>
return lineTokenizer.tokenize(lineNumber, line); return lineTokenizer.tokenize(lineNumber, line);
} }
/** Inits the parsing. */
protected void initParsing() {
// Inits <code>ILineTokenizer</code>
lineTokenizer.init();
String line;
//
if (mapperFactory.getHeaderLine() < 0)
{
}
}
/////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
// Parser // Parser
/////////////////////////////////////////////////////// ///////////////////////////////////////////////////////
...@@ -116,13 +104,14 @@ public class DefaultReaderParser<E> implements IReaderParser<E> ...@@ -116,13 +104,14 @@ public class DefaultReaderParser<E> implements IReaderParser<E>
List<E> elements = new ArrayList<E>(); List<E> elements = new ArrayList<E>();
synchronized (lineTokenizer) synchronized (lineTokenizer)
{ {
initParsing(); // Inits <code>ILineTokenizer</code>
lineTokenizer.init();
String line; String line;
try try
{ {
for (int lineNumber = 0; (line = bufferedReader.readLine()) != null; lineNumber++) for (int lineNumber = 0; (line = bufferedReader.readLine()) != null; lineNumber++)
{ {
if (mapperFactory.getHeaderLine() > -1) if (mapperFactory != null && mapperFactory.getHeaderLine() > -1)
{ {
String[] tokens = parseLine(lineNumber, line); String[] tokens = parseLine(lineNumber, line);
factory.setPropertyMapper(mapperFactory.createPropertyMapper(tokens)); factory.setPropertyMapper(mapperFactory.createPropertyMapper(tokens));
......
...@@ -38,9 +38,9 @@ public interface IParserObjectFactory<E> ...@@ -38,9 +38,9 @@ public interface IParserObjectFactory<E>
public final static IParserObjectFactory<String[]> DO_NOTHING_OBJECT_FACTORY = new IParserObjectFactory<String[]>() public final static IParserObjectFactory<String[]> DO_NOTHING_OBJECT_FACTORY = new IParserObjectFactory<String[]>()
{ {
// ///////////////////////////////////////////////////// ///////////////////////////////////////////////////////
// IParserObjectFactory // IParserObjectFactory
// ///////////////////////////////////////////////////// ///////////////////////////////////////////////////////
public String[] createObject(String[] lineTokens) public String[] createObject(String[] lineTokens)
{ {
......
...@@ -37,6 +37,7 @@ public interface IPropertyMapper ...@@ -37,6 +37,7 @@ public interface IPropertyMapper
* *
* @author Christian Ribeaud * @author Christian Ribeaud
*/ */
// TODO Christian: we should maybe add a type...
public final static class Property { public final static class Property {
public final int column; public final int column;
......
...@@ -21,6 +21,8 @@ package ch.systemsx.cisd.common.parser; ...@@ -21,6 +21,8 @@ package ch.systemsx.cisd.common.parser;
* *
* @author Christian Ribeaud * @author Christian Ribeaud
*/ */
// TODO Christian: actually this only can understand file with a header. We should
// be more generic.
public interface IPropertyMapperFactory public interface IPropertyMapperFactory
{ {
public int getHeaderLine(); public int getHeaderLine();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment