Package javax.ws.rs

Examples of javax.ws.rs.QueryParam


            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


       
        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

       
        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

      List<Object> argVals = new ArrayList<Object>();
      Annotation[][] annos = method.getParameterAnnotations();

      for (Annotation[] ans : annos) {
        PathParam pathParam = null;
        QueryParam queryParam = null;

        for (Annotation an : ans) {
          if (an instanceof PathParam)
            pathParam = (PathParam) an;
          else if (an instanceof QueryParam)
            queryParam = (QueryParam) an;
        }
        if (pathParam != null) {
          Object v = extractedArgs.get(pathParam.value());
          if (v != null)
            argVals.add(v);
          else
            throw new IllegalArgumentException("can not find annotation value for argument "
                + pathParam.value() + "in " + targetClass + "#" + method);
        } else if (queryParam != null) {
          String queryString = r.getQueryString(queryParam.value());
          argVals.add(queryString); // string type conversion?
        } else
          throw new IllegalArgumentException(
              "can not find an appropriate JAX-RC annotation for an argument for method:" + targetClass
                  + "#" + method);
View Full Code Here

    c = 0;
    int pos = 0;
    for (Annotation[] ans : annos) {
      PathParam pathParam = null;
      QueryParam queryParam = null;

      for (Annotation an : ans) {
        if (an instanceof PathParam)
          pathParam = (PathParam) an;
        else if (an instanceof QueryParam)
          queryParam = (QueryParam) an;
      }
      if (pathParam != null) {
        Object v = args.get(pathParam.value());
        if (v != null)
          argVals.add(v);
        else
          throw new IllegalArgumentException("can not find annotation value for argument "
              + pathParam.value() + "in " + meth.getDeclaringClass() + "#" + meth);
      } else if (queryParam != null) {
        String name = queryParam.value();
        String queryString = r.getQueryString(name); // XXX should this
                                // be of
                                // String[]?
        argVals.add(convertArgType(c, name, queryString, meth.getParameterTypes()[c]));
      } else if (autoRouting) {
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

   }

   private Multimap<String, Object> getQueryParamKeyValues(Invocation invocation) {
      Multimap<String, Object> queryParamValues = LinkedHashMultimap.create();
      for (Parameter param : parametersWithAnnotation(invocation.getInvokable(), QueryParam.class)) {
         QueryParam queryParam = param.getAnnotation(QueryParam.class);
         String paramKey = queryParam.value();
         Optional<?> paramValue = getParamValue(invocation, param.getAnnotation(ParamParser.class), param.hashCode(),
               paramKey);
         if (paramValue.isPresent())
            if (paramValue.get() instanceof Iterable) {
               @SuppressWarnings("unchecked")
View Full Code Here

                paramType);
            String docString = getDocStrings(declaringClass).get(methodKey + "[" + i + "]");
            param.setDocString(replaceLinks(docString));
            pathParams.add(param);
          } else if (QueryParam.class.equals(annotation.annotationType())) {
            QueryParam queryParam = (QueryParam) annotation;
            ParameterDescription param = new ParameterDescription(desc, queryParam.value(),
                paramType);
            String docString = getDocStrings(declaringClass).get(methodKey + "[" + i + "]");
            param.setDocString(replaceLinks(docString));
            queryParams.add(param);
          }
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.