registerConverterInstance(valueType, entries.getValue());
/** * Register user defined converter associated to value type. Converter class should be instantiable, i.e. not * abstract, interface or void, must have no arguments constructor, even if private and its constructor should of * course execute without exception. Otherwise unchecked exception may arise as described on throws section. There are * no other constrains on value type class. * <p> * Note: it is caller responsibility to enforce proper bound, i.e. given converter class to properly handle requested * value type. Otherwise exception may throw when this particular converter is enacted. * * @param valueType value type class, * @param converterClass specialized converter class. * @throws BugError if converter class is not instantiable. * @throws NoSuchBeingException if converter class has no default constructor. * @throws InvocationException with target exception if converter class construction fails on its execution. */ public void registerConverter(Class<?> valueType, Class<? extends Converter> converterClass) { Converter converter = Classes.newInstance(converterClass); if(Types.isConcrete(valueType)) { registerConverterInstance(valueType, converter); } else { if(abstractConverters.put(valueType, converter) == null) { log.debug("Register abstract converter |%s| for value type |%s|.", converterClass, valueType); } else { log.warn("Override abstract converter |%s| for value type |%s|.", converterClass, valueType); } } }