public static Class<?> determineCustomConverter(FieldMap fieldMap, Cache converterByDestTypeCache, CustomConverterContainer customConverterContainer, Class<?> srcClass, Class<?> destClass) { if (customConverterContainer == null) { return null; } // This method is messy. Just trying to isolate the junk into this one method instead of spread across the mapping // processor until a better solution can be put into place // For indexed mapping, need to use the actual class at index to determine the custom converter. if (fieldMap != null && fieldMap.isDestFieldIndexed()) { if (destClass.isArray()) { destClass = destClass.getComponentType(); } else if (destClass.isAssignableFrom(Collection.class) && fieldMap.getDestHintContainer() != null && !fieldMap.getDestHintContainer().hasMoreThanOneHint()) { // use hint when trying to find a custom converter destClass = fieldMap.getDestHintContainer().getHint(); } } return findCustomConverter(converterByDestTypeCache, customConverterContainer, srcClass, destClass); }
return findCustomConverter(converterByDestTypeCache, customConverterObjects, customConverterContainer,
return findCustomConverter(converterByDestTypeCache, customConverterObjects, customConverterContainer,
Class<?> converterClass = MappingUtils.findCustomConverter(converterByDestTypeCache, classMap.getCustomConverters(), srcClass, destClass); if (converterClass != null) {
CustomConverter converter = MappingUtils.findCustomConverter(converterByDestTypeCache, customConverterObjects, classMap.getCustomConverters(), srcClass, destClass); if (converter != null) {
CustomConverter converter = MappingUtils.findCustomConverter(converterByDestTypeCache, customConverterObjects, classMap.getCustomConverters(),
CustomConverter converter = MappingUtils.findCustomConverter(converterByDestTypeCache, customConverterObjects, fieldMapping.getClassMap().getCustomConverters(), value.getClass(), fieldMapping.getDestHintContainer().getHint());
Class<?> converterClass = MappingUtils.findCustomConverter(converterByDestTypeCache, classMap.getCustomConverters(), srcObj .getClass(), destType);
CustomConverter converter = MappingUtils.findCustomConverter(converterByDestTypeCache, customConverterObjects, fieldMapping.getClassMap().getCustomConverters(),
CustomConverter converter = MappingUtils.findCustomConverter(converterByDestTypeCache, customConverterObjects, classMap.getCustomConverters(),
CustomConverter converter = MappingUtils.findCustomConverter(converterByDestTypeCache, customConverterObjects, classMap.getCustomConverters(), srcObj.getClass(), destType);