Skip to content
Snippets Groups Projects
Commit c2910ac8 authored by felmer's avatar felmer
Browse files

Code review

SVN: 2841
parent fc9898f9
No related branches found
No related tags found
No related merge requests found
......@@ -21,10 +21,10 @@ package ch.systemsx.cisd.common.parser;
*
* @author Tomasz Pylak on Oct 29, 2007
*/
public interface IPropertiesSetter<ConstructedType>
public interface IPropertiesSetter<T>
{
void setProperty(String name, String valueOrNull);
/** returns constructed object, called after setting properties values */
ConstructedType done();
T getConstructedObject();
}
\ No newline at end of file
......@@ -48,7 +48,7 @@ public class PropertiesParserObjectFactory<E> implements IParserObjectFactory<E>
String propertyValue = getPropertyValue(lineTokens, propertyModel);
setter.setProperty(name, propertyValue);
}
return setter.done();
return setter.getConstructedObject();
}
private String getPropertyValue(final String[] lineTokens, final IPropertyModel propertyModel)
......@@ -56,8 +56,10 @@ public class PropertiesParserObjectFactory<E> implements IParserObjectFactory<E>
int column = propertyModel.getColumn();
if (column >= lineTokens.length)
{
throw UserFailureException.fromTemplate("Value for column '%s' cannot be found in line '%s'", propertyModel
.getName(), merge(lineTokens));
String name = propertyModel.getName();
String mergedTokens = merge(lineTokens);
throw UserFailureException.fromTemplate("Value for column '%s' cannot be found in line '%s'", name,
mergedTokens);
}
return lineTokens[column];
}
......
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