Package javax.ws.rs

Examples of javax.ws.rs.PathParam


        boolean isEncoded = AnnotationUtils.getAnnotation(anns, Encoded.class) != null;
        String dValue = AnnotationUtils.getDefaultParameterValue(anns);
       
        Parameter p = null;
       
        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);
View Full Code Here


            return new Parameter(ParameterType.BEAN, index, null, isEncoded, null);
        }
       
        String dValue = AnnotationUtils.getDefaultParameterValue(anns);
       
        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);
        }
View Full Code Here

            return new Parameter(ParameterType.BEAN, index, null, isEncoded, null);
        }
       
        String dValue = AnnotationUtils.getDefaultParameterValue(anns);
       
        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);
        }
View Full Code Here

      Object[] argValues = new Object[0];
      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(
View Full Code Here

    Annotation[][] annos = meth.getParameterAnnotations();

    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[]?
View Full Code Here

            return new Parameter(ParameterType.BEAN, index, null, isEncoded, null);
        }
       
        String dValue = AnnotationUtils.getDefaultParameterValue(anns);
       
        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);
        }
View Full Code Here

   }

   private Multimap<String, Object> getPathParamKeyValues(Invocation invocation) {
      Multimap<String, Object> pathParamValues = LinkedHashMultimap.create();
      for (Parameter param : parametersWithAnnotation(invocation.getInvokable(), PathParam.class)) {
         PathParam pathParam = param.getAnnotation(PathParam.class);
         String paramKey = pathParam.value();
         Optional<?> paramValue = getParamValue(invocation, param.getAnnotation(ParamParser.class), param.hashCode(),
               paramKey);
         if (paramValue.isPresent())
            pathParamValues.put(paramKey, paramValue.get().toString());
      }
View Full Code Here

        // Assume that an un-annotated parameter is the main entity type
        desc.setEntity(paramType);
      } else {
        for (Annotation annotation : annotations[i]) {
          if (PathParam.class.equals(annotation.annotationType())) {
            PathParam pathParam = (PathParam) annotation;
            ParameterDescription param = new ParameterDescription(desc, pathParam.value(),
                paramType);
            String docString = getDocStrings(declaringClass).get(methodKey + "[" + i + "]");
            param.setDocString(replaceLinks(docString));
            pathParams.add(param);
          } else if (QueryParam.class.equals(annotation.annotationType())) {
View Full Code Here

TOP

Related Classes of javax.ws.rs.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.