{
public BindHandler createHandler(Annotation annotation, Method getterMethod, Converter converter, ConversionHandler conversionHandler)
{
BindSimple bindAnnotation = (BindSimple) annotation;
BindSimpleHandler handler = new BindSimpleHandler();
String expression = bindAnnotation.expression();
String beanLocatingExpression = null;
String propertyName = null;
int lastDot = expression.lastIndexOf('.');
if (lastDot == -1)
{
propertyName = expression;
}
else
{
beanLocatingExpression = expression.substring(0, lastDot);
propertyName = expression.substring(lastDot + 1);
}
handler.setBeanLocatingExpression(beanLocatingExpression);
handler.setBeanPropertyName(propertyName);
if (converter != null)
{
handler.setConverter(converter);
}
else
{
Class<? extends Converter> converterClass = bindAnnotation.converter();
converter = ReflectHelper.createInstance(converterClass, Converter.class);
handler.setConverter(converter);
}
PropertyDescriptor property = BeanUtils.findPropertyForMethod(getterMethod);