Package org.cruxframework.crux.core.shared.rest.annotation

Examples of org.cruxframework.crux.core.shared.rest.annotation.PathParam


      defaultVal = defaultValue.value();
    }

    QueryParam query;
    HeaderParam header;
    PathParam uriParam;
    CookieParam cookie;
    FormParam formParam;

    if ((query = ClassUtils.findAnnotation(annotations, QueryParam.class)) != null)
    {
      return createParameterExtractorForSimpleType(RestParameterType.query, injectTargetClass, type, query.value(), defaultVal);
    }
    else if ((header = ClassUtils.findAnnotation(annotations, HeaderParam.class)) != null)
    {
      return createParameterExtractorForSimpleType(RestParameterType.header, injectTargetClass, type, header.value(), defaultVal);
    }
    else if ((formParam = ClassUtils.findAnnotation(annotations, FormParam.class)) != null)
    {
      return createParameterExtractorForSimpleType(RestParameterType.form, injectTargetClass, type, formParam.value(), defaultVal);
    }
    else if ((cookie = ClassUtils.findAnnotation(annotations, CookieParam.class)) != null)
    {
      return createParameterExtractorForSimpleType(RestParameterType.cookie, injectTargetClass, type, cookie.value(), defaultVal);
    }
    else if ((uriParam = ClassUtils.findAnnotation(annotations, PathParam.class)) != null)
    {
      return createParameterExtractorForSimpleType(RestParameterType.path, injectTargetClass, type, uriParam.value(), defaultVal);
    }
    else
    {
      return createParameterExtractorForSimpleType(RestParameterType.body, injectTargetClass, type, null, null);
    }
View Full Code Here


   */
  protected static ValueInjector createParameterExtractorForComplexType(Class<?> injectTargetClass, Type type, Annotation[] annotations)
  {
    QueryParam query;
    HeaderParam header;
    PathParam uriParam;
    CookieParam cookie;
    FormParam formParam;

    if ((query = ClassUtils.findAnnotation(annotations, QueryParam.class)) != null)
    {
      return new GroupValueInjector(RestParameterType.query, type, query.value());
    }
    else if ((header = ClassUtils.findAnnotation(annotations, HeaderParam.class)) != null)
    {
      return new GroupValueInjector(RestParameterType.header, type, header.value());
    }
    else if ((formParam = ClassUtils.findAnnotation(annotations, FormParam.class)) != null)
    {
      return new GroupValueInjector(RestParameterType.form, type, formParam.value());
    }
    else if ((cookie = ClassUtils.findAnnotation(annotations, CookieParam.class)) != null)
    {
      return new GroupValueInjector(RestParameterType.cookie, type, cookie.value());
    }
    else if ((uriParam = ClassUtils.findAnnotation(annotations, PathParam.class)) != null)
    {
      return new GroupValueInjector(RestParameterType.path, type, uriParam.value());
    }
    else
    {
      return new MessageBodyParamInjector(injectTargetClass, type);
    }
View Full Code Here

TOP

Related Classes of org.cruxframework.crux.core.shared.rest.annotation.PathParam

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.