Package org.strecks.bind.annotation

Examples of org.strecks.bind.annotation.BindSimple


{

  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);
View Full Code Here

TOP

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

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.