/** * Gets the converterId for the binding with the specified name. Returns null if either a binding or a converterId * for the given name is not found. * * @param name the name of the binding. * @return the binding */ public String getConverterId(String name) { Binding binding = getBinding(name); if (binding != null) { return binding.getConverter(); } else { return null; } }
/** * Gets the converterId for the binding with the specified name. Returns null if either a binding or a converterId * for the given name is not found. * * @param name the name of the binding. * @return the binding */ public String getConverterId(String name) { Binding binding = getBinding(name); if (binding != null) { return binding.getConverter(); } else { return null; } }
private ConversionExecutor getConverter(Expression fieldExpression) { if (conversionService != null) { Class valueType = fieldExpression.getValueType(boundObject); // special handling for array, collection, map types // necessary as getFieldValue is called by form tags for non-formattable properties, too // TODO - investigate how to improve this in Spring MVC if (valueType == null || valueType.isArray() || Collection.class.isAssignableFrom(valueType) || Map.class.isAssignableFrom(valueType)) { return null; } if (binderConfiguration != null) { Binding binding = binderConfiguration.getBinding(fieldExpression.getExpressionString()); if (binding != null) { String converterId = binding.getConverter(); if (converterId != null) { return conversionService.getConversionExecutor(converterId, valueType, String.class); } } } return conversionService.getConversionExecutor(valueType, String.class); } else { return null; } }