@@ -0,0 +1,1423 @@
+package com.alexrnl.commons.arguments.parsers;%0A%0Aimport java.lang.reflect.Field;%0A%0Aimport com.alexrnl.commons.arguments.ParameterParser;%0A%0A/**%0A * Abstract class to ease implementation of parsers.%3Cbr /%3E%0A * @author Alex%0A * @param %3CT%3E%0A *        the type of the field parsed.%0A */%0Apublic abstract class AbstractParser%3CT%3E implements ParameterParser %7B%0A%09/** The field type generated by this parser. */%0A%09private final Class%3CT%3E%09fieldType;%0A%09%0A%09/**%0A%09 * Constructor #1.%3Cbr /%3E%0A%09 * @param fieldType%0A%09 *        the type of the field which will be parsed by this parser.%0A%09 */%0A%09private AbstractParser (final Class%3CT%3E fieldType) %7B%0A%09%09super();%0A%09%09this.fieldType = fieldType;%0A%09%7D%0A%09%0A%09@Override%0A%09public Class%3C?%3E getFieldType () %7B%0A%09%09return fieldType;%0A%09%7D%0A%09%0A%09@Override%0A%09public void parse (final Object target, final Field field, final String parameter) %7B%0A%09%09try %7B%0A%09%09%09field.set(target, getValue(parameter));%0A%09%09%7D catch (IllegalArgumentException %7C IllegalAccessException e) %7B%0A%09%09%09throw new IllegalArgumentException(%22Could not parse %22 + parameter + %22 as a %22%0A%09%09%09%09%09+ fieldType, e);%0A%09%09%7D%0A%09%7D%0A%09%0A%09/**%0A%09 * Convert the %7B@link String%7D value into the appropriate type for the target field.%0A%09 * @param parameter%0A%09 *        the string to convert.%0A%09 * @return the generated object.%0A%09 * @throws IllegalArgumentException%0A%09 *         if the specified parameter could not be read properly.%0A%09 */%0A%09protected abstract T getValue (String parameter) throws IllegalArgumentException;%0A%7D%0A

Add an AbstractParser class to ease implementations of parsers