@Test public void testGetConverterByGenericType() throws Exception { GenericType genericType1 = new GenericType(Fields.class, Fields.class.getField("field").getGenericType()); GenericType genericType2 = new GenericType(Fields.class, Fields.class.getField("connection").getGenericType()); assertNull(registry.getConverter((GenericType) null)); assertNotNull(registry.getConverter(genericType1)); assertNull(registry.getConverter(genericType2)); }
@Override public Converter getConverter(Class<?> valueType) { ConverterProvider provider = findProvider(valueType); if (provider == null) { return null; } return provider.createConverter(valueType); }
DefaultConverterRegistry implements ConverterRegistry { @Override public Converter getConverter(Class<?> valueType) { ConverterProvider provider = findProvider(valueType); if (provider == null) { return null; } return provider.createConverter(valueType); } }
DefaultConverterRegistry implements ConverterRegistry { @Override public Converter getConverter(Class<?> valueType) { ConverterProvider provider = findProvider(valueType); if (provider == null) { return null; } return provider.createConverter(valueType); } DefaultConverterRegistry(); }
DefaultConverterRegistry implements ConverterRegistry { @Override public Converter getConverter(Class<?> valueType) { ConverterProvider provider = findProvider(valueType); if (provider == null) { return null; } return provider.createConverter(valueType); } DefaultConverterRegistry(); @SuppressWarnings("unchecked") static List<Class<?>> getSupertypes(Class<?> type); @Override Converter getConverter(Class<?> valueType); final void registerConverter(Converter converter); final void registerConverter(ConverterProvider provider); }
DefaultConverterRegistry implements ConverterRegistry { @Override public Converter getConverter(Class<?> valueType) { ConverterProvider provider = findProvider(valueType); if (provider == null) { return null; } return provider.createConverter(valueType); } DefaultConverterRegistry(); @SuppressWarnings("unchecked") static List<Class<?>> getSupertypes(Class<?> type); @Override Converter getConverter(Class<?> valueType); final void registerConverter(Converter converter); final void registerConverter(ConverterProvider provider);  }