Package javax.ws.rs

Examples of javax.ws.rs.QueryParam


        assertFalse(p.getRequired());
    }

    @Test
    public void testBuildBasicQueryParamWithMock() throws Exception {
        QueryParam qp =
            Temp.class.getMethod("setQueryParam", int.class).getAnnotation(QueryParam.class);
        final Annotation[] annArray = new Annotation[] {qp};

        mockContext.checking(new Expectations() {
            {
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

            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) {
                            messageParameters.add(values[0]);
                        } else {
                            messageParameters.add(values);
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) {
            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

        paramValue = this.getPathParamValue(pathParamAnn);
        params[i] = ClassUtil.getParamVal(paramClass, paramValue[0]);
        continue;
      }

      QueryParam queryParamAnn = this.getQueryParamAnn(anns);
      if (queryParamAnn == null)
        continue;

      paramValue = this.getQueryParamValue(queryParamAnn);
View Full Code Here

                paramValue = this.getPathParamValue(pathParamAnn.value());
                params[i] = ClassUtil.getParamVal(paramClass, paramValue[0]);
                continue;
            }

      QueryParam queryParamAnn = this.getQueryParamAnn(anns);

            // 视图模型
            if (queryParamAnn == null && Map.class.isAssignableFrom(paramClass)) {
                    params[i] = this.context.getModel();
                    continue;
            }

            if (queryParamAnn != null) {
              final String fieldName = queryParamAnn.value();
        if (File.class.isAssignableFrom(paramClass)) {
          if (!this.context.getUploadMap().containsKey(fieldName))
            continue;
          List<UploadFile> list = this.context.getUploadMap().get(fieldName);
          if (list == null || list.isEmpty())
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

   }

   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

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.