@Override
	public <T extends Enum> Converter<String, T> getConverter(Class<T> targetType) {
		Assert.notNull(targetType, "The target type must not be null.");

		Class<?> enumType = targetType;
		while (enumType != null && !enumType.isEnum()) {
			enumType = enumType.getSuperclass();
		}
		Assert.notNull(enumType, "The target type " + targetType.getName()
				+ " does not refer to an enum");
		return new StringToEnum(enumType);
	}
Copied from {@code org.springframework.boot.bind.RelaxedConversionService}.

@author Gunnar Hillert
spring-xd-module/src/main/java/org/springframework/xd/module/options/support/StringToEnumIgnoringCaseConverterFactory.java