Package org.strecks.injection.annotation

Examples of org.strecks.injection.annotation.InjectRequestParameter


{

  public InjectionHandler createInjectionHandler(Annotation annotation, Class clazz, PropertyDescriptor propertyDescriptor)
  {

    InjectRequestParameter input = (InjectRequestParameter) annotation;

    Class converterClass = input.converter();
    Converter converter = RequestParameterFactory.createConverter(propertyDescriptor.getPropertyType(), converterClass);
    String parameterName = AnnotationFactoryUtils.getAttributeName(propertyDescriptor.getName(), input.name());
    boolean required = input.required();

    // make sure that converter has String generic type
    boolean ok = ReflectHelper.checkGenericType(converterClass, Converter.class, String.class);
    if (!ok)
    {
      Class sourceType = ReflectHelper.getGenericType(converterClass, Converter.class);
     
      throw new ApplicationConfigurationException("@" + input.annotationType().getSimpleName() + " in "
          + clazz.getName() + " uses converter " + converterClass.getName()
          + " whose conversion source type is " + sourceType.getName() + ", and not "
          + String.class.getName());
     
    }
View Full Code Here

TOP

Related Classes of org.strecks.injection.annotation.InjectRequestParameter

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.