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>
return lineTokenizer.tokenize(lineNumber, line);
}
/** Inits the parsing. */
protected void initParsing() {
// Inits <code>ILineTokenizer</code>
lineTokenizer.init();
String line;
//
if (mapperFactory.getHeaderLine() < 0)
{
}
}
///////////////////////////////////////////////////////
// Parser
///////////////////////////////////////////////////////
......@@ -116,13 +104,14 @@ public class DefaultReaderParser<E> implements IReaderParser<E>
List<E> elements = new ArrayList<E>();
synchronized (lineTokenizer)
{
initParsing();
// Inits <code>ILineTokenizer</code>
lineTokenizer.init();
String line;
try
{
for (int lineNumber = 0; (line = bufferedReader.readLine()) != null; lineNumber++)
{
if (mapperFactory.getHeaderLine() > -1)
if (mapperFactory != null && mapperFactory.getHeaderLine() > -1)
{
String[] tokens = parseLine(lineNumber, line);
factory.setPropertyMapper(mapperFactory.createPropertyMapper(tokens));
......
......@@ -38,9 +38,9 @@ public interface IParserObjectFactory<E>
public final static IParserObjectFactory<String[]> DO_NOTHING_OBJECT_FACTORY = new IParserObjectFactory<String[]>()
{
// /////////////////////////////////////////////////////
///////////////////////////////////////////////////////
// IParserObjectFactory
// /////////////////////////////////////////////////////
///////////////////////////////////////////////////////
public String[] createObject(String[] lineTokens)
{
......
......@@ -37,6 +37,7 @@ public interface IPropertyMapper
*
* @author Christian Ribeaud
*/
// TODO Christian: we should maybe add a type...
public final static class Property {
public final int column;
......
......@@ -21,6 +21,8 @@ package ch.systemsx.cisd.common.parser;
*
* @author Christian Ribeaud
*/
// TODO Christian: actually this only can understand file with a header. We should
// be more generic.
public interface IPropertyMapperFactory
{
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