@Test(dataProvider = "parse_client_success_data") public void parse_client(Class type, String input, Object expected) throws Exception { Translator t = source.getByType(type); Object actual = t.parseClient(null, input, null); assertEquals(actual, expected); }
public Translator getByType(Class valueType) { Translator result = registry.get(valueType); if (result == null) { List<String> names = CollectionFactory.newList(); for (Class type : registry.getTypes()) { names.add(type.getName()); } throw new IllegalArgumentException(String.format("No translator is defined for type %s. Registered types: %s.", PlasticUtils.toTypeName(valueType), InternalUtils .joinSorted(names))); } return result; }
TranslatorSourceImpl implements TranslatorSource, Runnable { public Translator getByType(Class valueType) { Translator result = registry.get(valueType); if (result == null) { List<String> names = CollectionFactory.newList(); for (Class type : registry.getTypes()) { names.add(type.getName()); } throw new IllegalArgumentException(String.format("No translator is defined for type %s. Registered types: %s.", PlasticUtils.toTypeName(valueType), InternalUtils .joinSorted(names))); } return result; } }
TranslatorSourceImpl implements TranslatorSource, Runnable { public Translator getByType(Class valueType) { Translator result = registry.get(valueType); if (result == null) { List<String> names = CollectionFactory.newList(); for (Class type : registry.getTypes()) { names.add(type.getName()); } throw new IllegalArgumentException(String.format("No translator is defined for type %s. Registered types: %s.", PlasticUtils.toTypeName(valueType), InternalUtils .joinSorted(names))); } return result; } TranslatorSourceImpl(Map<Class, Translator> configuration);  TranslatorSourceImpl(Map<Class, Translator> configuration, Map<String, Translator> alternates); }
TranslatorSourceImpl implements TranslatorSource, Runnable { public Translator getByType(Class valueType) { Translator result = registry.get(valueType); if (result == null) { List<String> names = CollectionFactory.newList(); for (Class type : registry.getTypes()) { names.add(type.getName()); } throw new IllegalArgumentException(String.format("No translator is defined for type %s. Registered types: %s.", PlasticUtils.toTypeName(valueType), InternalUtils .joinSorted(names))); } return result; } TranslatorSourceImpl(Map<Class, Translator> configuration);  TranslatorSourceImpl(Map<Class, Translator> configuration, Map<String, Translator> alternates); Translator get(String name); Translator getByType(Class valueType); Translator findByType(Class valueType); void run(); }
TranslatorSourceImpl implements TranslatorSource, Runnable { public Translator getByType(Class valueType) { Translator result = registry.get(valueType); if (result == null) { List<String> names = CollectionFactory.newList(); for (Class type : registry.getTypes()) { names.add(type.getName()); } throw new IllegalArgumentException(String.format("No translator is defined for type %s. Registered types: %s.", PlasticUtils.toTypeName(valueType), InternalUtils .joinSorted(names))); } return result; } TranslatorSourceImpl(Map<Class, Translator> configuration);  TranslatorSourceImpl(Map<Class, Translator> configuration, Map<String, Translator> alternates); Translator get(String name); Translator getByType(Class valueType); Translator findByType(Class valueType); void run();  }