diff --git a/common/source/java/ch/systemsx/cisd/common/parser/IParserObjectFactory.java b/common/source/java/ch/systemsx/cisd/common/parser/IParserObjectFactory.java index 73b98aee8687419c48458853fbe8ae81898c7265..88087777107af0c912c35b4d6e8cae1c4175a481 100644 --- a/common/source/java/ch/systemsx/cisd/common/parser/IParserObjectFactory.java +++ b/common/source/java/ch/systemsx/cisd/common/parser/IParserObjectFactory.java @@ -18,9 +18,7 @@ package ch.systemsx.cisd.common.parser; /** * A <code>IParserObjectFactory</code> implementation knows how to deal with given line tokens and convert them into - * an appropriate <code>Object</code>. A <code>IParserObjectFactory</code> needs a <code>IPropertyMapper</code> - * to perform its job. A <code>IPropertyMapper</code> helps to map passed tokens to created <code>Object</code> - * properties . + * an appropriate <code>Object</code>. * <p> * A <code>IParserObjectFactory</code> is typically registered in {@link IReaderParser}. * </p> @@ -32,15 +30,14 @@ public interface IParserObjectFactory<E> /** * This <code>IParserObjectFactory</code> implementation does nothing and returns the passed - * <code>lineTokens</code> as <code>String[]</code>. No mapping needed, so - * {@link #setPropertyMapper(IPropertyMapper)} does nothing. + * <code>lineTokens</code> as <code>String[]</code>. * <p> * This implementation could be used to debugging purposes. * </p> * * @author Christian Ribeaud */ - public final static IParserObjectFactory<String[]> DO_NOTHING_OBJECT_FACTORY = new IParserObjectFactory<String[]>() + public final static IParserObjectFactory<String[]> STRING_ARRAY_OBJECT_FACTORY = new IParserObjectFactory<String[]>() { // @@ -51,23 +48,10 @@ public interface IParserObjectFactory<E> { return lineTokens; } - - public final void setPropertyMapper(IPropertyMapper propertyMapper) - { - } - }; /** * Parses given text line and returns an appropriate <i>Object</i>. */ public E createObject(String[] lineTokens); - - /** - * Sets a <code>IPropertyMapper</code> to map line tokens. - * <p> - * Usually you must set a <code>IPropertyMapper</code> before using {@link #createObject(String[])}. - * </p> - */ - public void setPropertyMapper(IPropertyMapper propertyMapper); } \ No newline at end of file diff --git a/common/sourceTest/java/ch/systemsx/cisd/common/parser/DefaultReaderParserTest.java b/common/sourceTest/java/ch/systemsx/cisd/common/parser/DefaultReaderParserTest.java index 6535b4c7522def2cacfd708d0185616d8f1f9a6d..31d85e2f22185ddf257d13486f37b74e884a5b30 100644 --- a/common/sourceTest/java/ch/systemsx/cisd/common/parser/DefaultReaderParserTest.java +++ b/common/sourceTest/java/ch/systemsx/cisd/common/parser/DefaultReaderParserTest.java @@ -42,7 +42,7 @@ public final class DefaultReaderParserTest public final void testParseWithoutFactoryAndHeader() throws IOException { final IReaderParser<String[]> parser = new DefaultReaderParser<String[]>(); - parser.setObjectFactory(IParserObjectFactory.DO_NOTHING_OBJECT_FACTORY); + parser.setObjectFactory(IParserObjectFactory.STRING_ARRAY_OBJECT_FACTORY); final Reader reader = new StringReader(text); final List<String[]> result = parser.parse(reader, new DefaultLineFilter()); assertEquals(3, result.size()); @@ -56,7 +56,7 @@ public final class DefaultReaderParserTest public final void testParseWithoutFactoryWithLineFilter() throws IOException { final IReaderParser<String[]> parser = new DefaultReaderParser<String[]>(); - parser.setObjectFactory(IParserObjectFactory.DO_NOTHING_OBJECT_FACTORY); + parser.setObjectFactory(IParserObjectFactory.STRING_ARRAY_OBJECT_FACTORY); final Reader reader = new StringReader(text); final List<String[]> result = parser.parse(reader, new DefaultLineFilter(2)); assertEquals(2, result.size());