Package javax.ws.rs

Examples of javax.ws.rs.QueryParam


      DefaultValue defaultValue = findAnnotation(annotations, DefaultValue.class);
      boolean encode = findAnnotation(annotations, Encoded.class) != null || injectTarget.isAnnotationPresent(Encoded.class) || type.isAnnotationPresent(Encoded.class);
      String defaultVal = null;
      if (defaultValue != null) defaultVal = defaultValue.value();

      QueryParam query;
      HeaderParam header;
      MatrixParam matrix;
      PathParam uriParam;
      CookieParam cookie;
      FormParam formParam;
      Suspend suspend;


      if ((query = findAnnotation(annotations, QueryParam.class)) != null)
      {
         return new QueryParamInjector(type, genericType, injectTarget, query.value(), defaultVal, encode, annotations, providerFactory);
      }
      else if ((header = findAnnotation(annotations, HeaderParam.class)) != null)
      {
         return new HeaderParamInjector(type, genericType, injectTarget, header.value(), defaultVal, annotations, providerFactory);
      }
View Full Code Here


  }

  protected void processMetaData(Class<?> type, Annotation[] annotations,
      boolean useBody)
  {
    QueryParam query;
    HeaderParam header;
    MatrixParam matrix;
    PathParam uriParam;
    CookieParam cookie;
    FormParam formParam;

    // boolean isEncoded = FindAnnotation.findAnnotation(annotations,
    // Encoded.class) != null;

    if ((query = FindAnnotation.findAnnotation(annotations, QueryParam.class)) != null)
    {
      addParameter(type, annotations, MethodParamType.QUERY_PARAMETER, query
          .value());
    } else if ((header = FindAnnotation.findAnnotation(annotations,
        HeaderParam.class)) != null)
    {
      addParameter(type, annotations, MethodParamType.HEADER_PARAMETER,
View Full Code Here

                                             Annotation[] annotations, Type genericType, AccessibleObject target,
                                             boolean ignoreBody)
   {
      Marshaller marshaller = null;

      QueryParam query;
      HeaderParam header;
      MatrixParam matrix;
      PathParam uriParam;
      CookieParam cookie;
      FormParam formParam;
      // Form form;

      boolean isEncoded = FindAnnotation.findAnnotation(annotations,
              Encoded.class) != null;

      if ((query = FindAnnotation.findAnnotation(annotations, QueryParam.class)) != null)
      {
         marshaller = new QueryParamMarshaller(query.value());
      }
      else if ((header = FindAnnotation.findAnnotation(annotations,
              HeaderParam.class)) != null)
      {
         marshaller = new HeaderParamMarshaller(header.value());
View Full Code Here

            MatrixParam matrixParam = getAnnotation(annotations, MatrixParam.class);
            if (matrixParam != null) {
                isEntity = false;
                matrixParams.put(matrixParam.value(), args[i]);
            }
            QueryParam queryParam = getAnnotation(annotations, QueryParam.class);
            if (queryParam != null) {
                isEntity = false;
                queryParams.put(queryParam.value(), args[i]);
            }
            HeaderParam headerParam = getAnnotation(annotations, HeaderParam.class);
            if (headerParam != null) {
                isEntity = false;
                headerParams.put(headerParam.value(), args[i]);
View Full Code Here

            List<Object> messageParameters = new ArrayList<Object>();
            for(int i=0; i<method.getParameterTypes().length; i++) {
                for(Annotation annotation : method.getParameterAnnotations()[i]) {
                    if (annotation instanceof QueryParam) {
                        QueryParam queryParam = (QueryParam) annotation;
                        String name = queryParam.value();
                        String[] values = bindingContext.getHttpRequest().getParameterValues(name);

                        if(values.length == 1) {
                            //process value, making necessary map from string to expected value
                            Class<?> clazz = method.getParameterTypes()[i];
View Full Code Here

                             String defaultValue) {
        Class<?> classType = GenericsUtils.getClassType(genericType);

        MatrixParam matrix = null;
        PathParam path = null;
        QueryParam query = null;
        HeaderParam header = null;
        CookieParam cookie = null;
        FormParam form = null;
        Context context = null;

        Injectable injectable = null;
        int annotationsCounter = 0;
        for (int i = 0; i < annotations.length; ++i) {
            if (annotations[i].annotationType().equals(MatrixParam.class)) {
                matrix = (MatrixParam)annotations[i];
                ++annotationsCounter;
            } else if (annotations[i].annotationType().equals(PathParam.class)) {
                path = (PathParam)annotations[i];
                ++annotationsCounter;
            } else if (annotations[i].annotationType().equals(QueryParam.class)) {
                query = (QueryParam)annotations[i];
                ++annotationsCounter;
            } else if (annotations[i].annotationType().equals(HeaderParam.class)) {
                header = (HeaderParam)annotations[i];
                ++annotationsCounter;
            } else if (annotations[i].annotationType().equals(CookieParam.class)) {
                cookie = (CookieParam)annotations[i];
                ++annotationsCounter;
            } else if (annotations[i].annotationType().equals(FormParam.class)) {
                form = (FormParam)annotations[i];
                ++annotationsCounter;
            } else if (annotations[i].annotationType().equals(Context.class)) {
                context = (Context)annotations[i];
                ++annotationsCounter;
            } else if (annotations[i].annotationType().equals(Encoded.class)) {
                encoded = true;
            } else if (annotations[i].annotationType().equals(DefaultValue.class)) {
                defaultValue = ((DefaultValue)annotations[i]).value();
            }
        }

        if (annotationsCounter > 1) {
            throw new IllegalStateException("Conflicting parameter annotations for " + member
                .getName());
        }

        if (matrix != null) {
            injectable =
                createMatrixParam(matrix.value(), classType, genericType, annotations, member);
        } else if (path != null) {
            injectable = createPathParam(path.value(), classType, genericType, annotations, member);
        } else if (query != null) {
            injectable =
                createQueryParam(query.value(), classType, genericType, annotations, member);
        } else if (header != null) {
            injectable =
                createHeaderParam(header.value(), classType, genericType, annotations, member);
        } else if (cookie != null) {
            injectable =
View Full Code Here

        PathParam a = AnnotationUtils.getAnnotation(anns, PathParam.class);
        if (a != null) {
            p = new Parameter(ParameterType.PATH, index, a.value(), isEncoded, dValue);
        }
        if (p == null) {
            QueryParam q = AnnotationUtils.getAnnotation(anns, QueryParam.class);
            if (q != null) {
                p = new Parameter(ParameterType.QUERY, index, q.value(), isEncoded, dValue);
            }
        }
        if (p != null) {
            return p;
        }
View Full Code Here

       
        PathParam a = AnnotationUtils.getAnnotation(anns, PathParam.class);
        if (a != null) {
            return new Parameter(ParameterType.PATH, index, a.value(), isEncoded, dValue);
        }
        QueryParam q = AnnotationUtils.getAnnotation(anns, QueryParam.class);
        if (q != null) {
            return new Parameter(ParameterType.QUERY, index, q.value(), isEncoded, dValue);
        }
        MatrixParam m = AnnotationUtils.getAnnotation(anns, MatrixParam.class);
        if (m != null) {
            return new Parameter(ParameterType.MATRIX, index, m.value(), isEncoded, dValue);
       
View Full Code Here

      DefaultValue defaultValue = FindAnnotation.findAnnotation(annotations, DefaultValue.class);
      boolean encode = FindAnnotation.findAnnotation(annotations, Encoded.class) != null || injectTarget.isAnnotationPresent(Encoded.class) || type.isAnnotationPresent(Encoded.class);
      String defaultVal = null;
      if (defaultValue != null) defaultVal = defaultValue.value();

      QueryParam query;
      HeaderParam header;
      MatrixParam matrix;
      PathParam uriParam;
      CookieParam cookie;
      FormParam formParam;
      Form form;
      Suspend suspend;


      if ((query = FindAnnotation.findAnnotation(annotations, QueryParam.class)) != null)
      {
         return new QueryParamInjector(type, genericType, injectTarget, query.value(), defaultVal, encode, annotations, providerFactory);
      }
      else if ((header = FindAnnotation.findAnnotation(annotations, HeaderParam.class)) != null)
      {
         return new HeaderParamInjector(type, genericType, injectTarget, header.value(), defaultVal, annotations, providerFactory);
      }
View Full Code Here

      DefaultValue defaultValue = findAnnotation(annotations, DefaultValue.class);
      boolean encode = findAnnotation(annotations, Encoded.class) != null || injectTarget.isAnnotationPresent(Encoded.class) || type.isAnnotationPresent(Encoded.class);
      String defaultVal = null;
      if (defaultValue != null) defaultVal = defaultValue.value();

      QueryParam query;
      HeaderParam header;
      MatrixParam matrix;
      PathParam uriParam;
      CookieParam cookie;
      FormParam formParam;
      Suspend suspend;


      if ((query = findAnnotation(annotations, QueryParam.class)) != null)
      {
         return new QueryParamInjector(type, genericType, injectTarget, query.value(), defaultVal, encode, annotations, providerFactory);
      }
      else if ((header = findAnnotation(annotations, HeaderParam.class)) != null)
      {
         return new HeaderParamInjector(type, genericType, injectTarget, header.value(), defaultVal, annotations, providerFactory);
      }
View Full Code Here

TOP

Related Classes of javax.ws.rs.QueryParam

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.