class EnumConverter implements PropertyConverter<T> {

    @Override
    public T convert(String value, ConversionContext ctx) {
        ctx.addSupportedFormats(getClass(), "<enumValue>");
        try {
            return (T) factory.invoke(null, value);
        } catch (InvocationTargetException | IllegalAccessException e) {
            LOG.log(Level.FINEST, "Invalid enum createValue '" + value + "' for " + enumType.getName(), e);
        }
        try {
            if (value != null) {
                return (T) factory.invoke(null, value.toUpperCase(Locale.ENGLISH));
            }
        } catch (InvocationTargetException | IllegalAccessException e) {
            LOG.log(Level.FINEST, "Invalid enum createValue '" + value + "' for " + enumType.getName(), e);
        }
        return null;
    }

    public  EnumConverter(Class<T> enumType);

}