/** * Looks for converter mappings for the specified class, traversing up its class hierarchy and interfaces and adding * any additional mappings it may find. Mappings lower in the hierarchy have priority over those higher in the * hierarcy. * * @param clazz the class to look for converter mappings for * @return the converter mappings */ protected Map<String, Object> buildConverterMapping(Class clazz) throws Exception { Map<String, Object> mapping = new HashMap<String, Object>(); // check for conversion mapping associated with super classes and any implemented interfaces Class curClazz = clazz; while (!curClazz.equals(Object.class)) { // add current class' mappings addConverterMapping(mapping, curClazz); // check interfaces' mappings Class[] interfaces = curClazz.getInterfaces(); for (Class anInterface : interfaces) { addConverterMapping(mapping, anInterface); } curClazz = curClazz.getSuperclass(); } if (mapping.size() > 0) { converterHolder.addMapping(clazz, mapping); } else { converterHolder.addNoMapping(clazz); } return mapping; }
LOG.debug("Got exception trying to resolve convert for class [#0] and property [#1]", t, clazz, property); converterHolder.addNoMapping(clazz);