private Class findConverter(Class src, Class dest) { // Otherwise, loop through custom converters and look for a match. Also, store the result in the cache for (CustomConverterDescription customConverter : converters) { final Class classA = customConverter.getClassA(); final Class classB = customConverter.getClassB(); // we check to see if the destination class is the same as classA defined in the converter mapping xml. // we next check if the source class is the same as classA defined in the converter mapping xml. // we also to check to see if it is assignable to either. We then perform these checks in the other direction for classB if ((classA.isAssignableFrom(dest) && classB.isAssignableFrom(src)) || (classA.isAssignableFrom(src) && classB.isAssignableFrom(dest))) { return customConverter.getType(); } } return null; }
private CustomConverterDescription findConverter(Class<?> src, Class<?> dest) { // Otherwise, loop through custom converters and look for a match. // for (CustomConverterDescription customConverter : converters) { final Class<?> classA = ClassUtils.primitiveToWrapper(customConverter.getClassA()); final Class<?> classB = ClassUtils.primitiveToWrapper(customConverter.getClassB()); // we check to see if the destination class is the same as classA // defined in the converter mapping xml. // we next check if the source class is the same as classA defined // in the converter mapping xml. // we also to check to see if it is assignable to either. We then // perform these checks in the other direction for classB if ((classA.isAssignableFrom(dest) && classB.isAssignableFrom(src)) || (classA .isAssignableFrom(src) && classB.isAssignableFrom(dest))) { return customConverter; } } return null; }
private CustomConverterDescription findConverter(Class<?> src, Class<?> dest) { // Otherwise, loop through custom converters and look for a match. // for (CustomConverterDescription customConverter : converters) { final Class<?> classA = ClassUtils.primitiveToWrapper(customConverter.getClassA()); final Class<?> classB = ClassUtils.primitiveToWrapper(customConverter.getClassB()); // we check to see if the destination class is the same as classA // defined in the converter mapping xml. // we next check if the source class is the same as classA defined // in the converter mapping xml. // we also to check to see if it is assignable to either. We then // perform these checks in the other direction for classB if ((classA.isAssignableFrom(dest) && classB.isAssignableFrom(src)) || (classA.isAssignableFrom(src) && classB .isAssignableFrom(dest))) { return customConverter; } } return null; }