@Test public void testInterpolationConverterFactory() { Set<ConverterFactory> set = Converters.getConverterFactories(String.class, INTERPOLATION_CLASS); assertNotNull(set); assertFalse(set.isEmpty()); assertEquals(set.size(), 1); assertSame(set.iterator().next().getClass(), InterpolationConverterFactory.class); assertNull(new InterpolationConverterFactory().createConverter(null, null, null)); assertNull(new InterpolationConverterFactory().createConverter(String.class, null, null)); assertNull( new InterpolationConverterFactory() .createConverter(String.class, Double.class, null)); }
public Converter createConverter(Class<?> source, Class<?> target, Hints hints) { if (source == null || target == null || !source.equals(String.class)) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine( "InterpolationConverterFactory can be applied from Strings to Interpolation only."); } return null; } if (Interpolation.class.isAssignableFrom(target)) { return THE_INTERPOLATION_CONVERTER; } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine( "InterpolationConverterFactory can be applied from Strings to Interpolation only."); } } return null; }
InterpolationConverterFactory implements ConverterFactory { public Converter createConverter(Class<?> source, Class<?> target, Hints hints) { if (source == null || target == null || !source.equals(String.class)) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine( "InterpolationConverterFactory can be applied from Strings to Interpolation only."); } return null; } if (Interpolation.class.isAssignableFrom(target)) { return THE_INTERPOLATION_CONVERTER; } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine( "InterpolationConverterFactory can be applied from Strings to Interpolation only."); } } return null; } }
InterpolationConverterFactory implements ConverterFactory { public Converter createConverter(Class<?> source, Class<?> target, Hints hints) { if (source == null || target == null || !source.equals(String.class)) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine( "InterpolationConverterFactory can be applied from Strings to Interpolation only."); } return null; } if (Interpolation.class.isAssignableFrom(target)) { return THE_INTERPOLATION_CONVERTER; } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine( "InterpolationConverterFactory can be applied from Strings to Interpolation only."); } } return null; }  }
InterpolationConverterFactory implements ConverterFactory { public Converter createConverter(Class<?> source, Class<?> target, Hints hints) { if (source == null || target == null || !source.equals(String.class)) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine( "InterpolationConverterFactory can be applied from Strings to Interpolation only."); } return null; } if (Interpolation.class.isAssignableFrom(target)) { return THE_INTERPOLATION_CONVERTER; } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine( "InterpolationConverterFactory can be applied from Strings to Interpolation only."); } } return null; }  Converter createConverter(Class<?> source, Class<?> target, Hints hints); }
InterpolationConverterFactory implements ConverterFactory { public Converter createConverter(Class<?> source, Class<?> target, Hints hints) { if (source == null || target == null || !source.equals(String.class)) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine( "InterpolationConverterFactory can be applied from Strings to Interpolation only."); } return null; } if (Interpolation.class.isAssignableFrom(target)) { return THE_INTERPOLATION_CONVERTER; } else { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine( "InterpolationConverterFactory can be applied from Strings to Interpolation only."); } } return null; }  Converter createConverter(Class<?> source, Class<?> target, Hints hints);  }