Package org.strecks.bind.annotation

Examples of org.strecks.bind.annotation.BindSelect


{

  public BindHandler createHandler(Annotation annotation, Method getterMethod, Converter converter, ConversionHandler conversionHandler)
  {

    BindSelect bindAnnotation = (BindSelect) annotation;
    BindSelectHandler handler = new BindSelectHandler();

    String expression = bindAnnotation.targetBeanExpression();
    handler.setTargetBeanExpression(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);
    handler.setBeanPropertyClass(bindAnnotation.idClass());
    handler.setBeanLookupExpression(bindAnnotation.lookupMapExpression());
    handler.setBeanPropertyIdName(bindAnnotation.targetBeanIdProperty());

    if (converter != null)
    {
      handler.setConverter(converter);
    }
    else
    {
      Class<? extends Converter> converterClass = bindAnnotation.idConverter();
      converter = ReflectHelper.createInstance(converterClass, Converter.class);
      converter.setTargetClass(bindAnnotation.idClass());
      handler.setConverter(converter);
    }

    PropertyDescriptor property = BeanUtils.findPropertyForMethod(getterMethod);
View Full Code Here

TOP

Related Classes of org.strecks.bind.annotation.BindSelect

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.