@Test @SuppressWarnings("unchecked") public void classIsCreatedFromFullyQualifiedClassName() { Class<Annotator> clazz = converter.convert(Annotator.class.getName()); assertThat(clazz, is(equalTo(Annotator.class))); }
@Override public Class convert(String value) { if (isBlank(value)) { throw new ParameterException(getErrorString("a blank value", "a class")); } try { return Class.forName(value); } catch (ClassNotFoundException e) { throw new ParameterException(getErrorString(value, "a class")); } }
ClassConverter extends BaseConverter<Class> { @Override public Class convert(String value) { if (isBlank(value)) { throw new ParameterException(getErrorString("a blank value", "a class")); } try { return Class.forName(value); } catch (ClassNotFoundException e) { throw new ParameterException(getErrorString(value, "a class")); } } }
ClassConverter extends BaseConverter<Class> { @Override public Class convert(String value) { if (isBlank(value)) { throw new ParameterException(getErrorString("a blank value", "a class")); } try { return Class.forName(value); } catch (ClassNotFoundException e) { throw new ParameterException(getErrorString(value, "a class")); } } ClassConverter(String optionName); }
ClassConverter extends BaseConverter<Class> { @Override public Class convert(String value) { if (isBlank(value)) { throw new ParameterException(getErrorString("a blank value", "a class")); } try { return Class.forName(value); } catch (ClassNotFoundException e) { throw new ParameterException(getErrorString(value, "a class")); } } ClassConverter(String optionName); @Override Class convert(String value); }
ClassConverter extends BaseConverter<Class> { @Override public Class convert(String value) { if (isBlank(value)) { throw new ParameterException(getErrorString("a blank value", "a class")); } try { return Class.forName(value); } catch (ClassNotFoundException e) { throw new ParameterException(getErrorString(value, "a class")); } } ClassConverter(String optionName); @Override Class convert(String value);  }