@Test public void forTypeReturnsAConverterMatchingTheTypeName() throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { assertThat(Converters.forType(PersonNamesConverter.TYPE), instanceOf(PersonNamesConverter.class)); assertThat(Converters.forType(DatableConverter.TYPE), instanceOf(DatableConverter.class)); assertThat(Converters.forType(StringToStringConverter.TYPE), instanceOf(StringToStringConverter.class)); assertThat(Converters.forType(HyperlinksConverter.TYPE), instanceOf(HyperlinksConverter.class)); assertThat(Converters.forType(DefaultFullPersonNameConverter.TYPE), instanceOf(DefaultFullPersonNameConverter.class)); assertThat(Converters.forType(ArrayToEncodedArrayConverter.TYPE), instanceOf(ArrayToEncodedArrayConverter.class)); assertThat(Converters.forType(AltNamesConverter.TYPE), instanceOf(AltNamesConverter.class)); }
public static Converter forType(String type, String... options) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { final Class<? extends Converter> converterClass = CONVERTER_TYPES.get(type); if (HasOptions.class.isAssignableFrom(converterClass)) { final Constructor<? extends Converter> hasOptionsConstructor = converterClass.getDeclaredConstructor(String[].class); return hasOptionsConstructor.newInstance((Object) options); } else { return converterClass.newInstance(); } }
Converters { public static Converter forType(String type, String... options) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { final Class<? extends Converter> converterClass = CONVERTER_TYPES.get(type); if (HasOptions.class.isAssignableFrom(converterClass)) { final Constructor<? extends Converter> hasOptionsConstructor = converterClass.getDeclaredConstructor(String[].class); return hasOptionsConstructor.newInstance((Object) options); } else { return converterClass.newInstance(); } } }
Converters { public static Converter forType(String type, String... options) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { final Class<? extends Converter> converterClass = CONVERTER_TYPES.get(type); if (HasOptions.class.isAssignableFrom(converterClass)) { final Constructor<? extends Converter> hasOptionsConstructor = converterClass.getDeclaredConstructor(String[].class); return hasOptionsConstructor.newInstance((Object) options); } else { return converterClass.newInstance(); } }  }
Converters { public static Converter forType(String type, String... options) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { final Class<? extends Converter> converterClass = CONVERTER_TYPES.get(type); if (HasOptions.class.isAssignableFrom(converterClass)) { final Constructor<? extends Converter> hasOptionsConstructor = converterClass.getDeclaredConstructor(String[].class); return hasOptionsConstructor.newInstance((Object) options); } else { return converterClass.newInstance(); } }  static StringArrayToEncodedArrayOfLimitedValues stringArrayToEncodedArrayOf(String... values); static StringToEncodedStringOfLimitedValuesConverter stringToEncodedStringOf(String... values); static StringToUnencodedStringOfLimitedValuesConverter stringToUnencodedStringOf(String... values); static Converter forType(String type, String... options); }
Converters { public static Converter forType(String type, String... options) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { final Class<? extends Converter> converterClass = CONVERTER_TYPES.get(type); if (HasOptions.class.isAssignableFrom(converterClass)) { final Constructor<? extends Converter> hasOptionsConstructor = converterClass.getDeclaredConstructor(String[].class); return hasOptionsConstructor.newInstance((Object) options); } else { return converterClass.newInstance(); } }  static StringArrayToEncodedArrayOfLimitedValues stringArrayToEncodedArrayOf(String... values); static StringToEncodedStringOfLimitedValuesConverter stringToEncodedStringOf(String... values); static StringToUnencodedStringOfLimitedValuesConverter stringToUnencodedStringOf(String... values); static Converter forType(String type, String... options); static final StringToStringConverter stringToString; static final ArrayToEncodedArrayConverter arrayToEncodedArray; static final HyperlinksConverter hyperlinks; static final DatableConverter datable; static final StringToEncodedStringOfLimitedValuesConverter gender; static final PersonNamesConverter personNames; static final StringToUnencodedStringOfLimitedValuesConverter stringOfYesNoUnknown; static final DefaultLocationNameConverter defaultLocationNameConverter; static final DefaultFullPersonNameConverter defaultFullPersonNameConverter; static final AltNamesConverter altNames; }