Examples of QueryParam


Examples of javax.ws.rs.QueryParam

            case QUERY:
                p = new Param();
                p.setStyle(ParamStyle.QUERY);
                for (Annotation a : annotations) {
                    if (QueryParam.class.equals(a.annotationType())) {
                        QueryParam paramAnn = (QueryParam)a;
                        p.setName(paramAnn.value());
                    }
                }
                break;
            case FORM:
                p = new Param();
                p.setStyle(ParamStyle.QUERY);
                for (Annotation a : annotations) {
                    if (FormParam.class.equals(a.annotationType())) {
                        FormParam paramAnn = (FormParam)a;
                        p.setName(paramAnn.value());
                    }
                }
                break;
            case CONTEXT:
                break;
            case COOKIE:
                break;
            case ENTITY:
                break;
        }

        if (p == null) {
            /*
             * The paramtype was never set so return null. This might have been
             * some other type of injectable that shouldn't be created as a
             * Param. This is a preventive measure.
             */
            return null;
        }

        Class<?> memberType = paramMetadata.getType();
        if (memberType.equals(int.class) || memberType.equals(Integer.class)) {
            p.setType(new QName(XML_SCHEMA_NS, "int"));
        } else if (memberType.equals(float.class) || memberType.equals(Float.class)) {
            p.setType(new QName(XML_SCHEMA_NS, "float"));
        } else if (memberType.equals(long.class) || memberType.equals(Long.class)) {
            p.setType(new QName(XML_SCHEMA_NS, "long"));
        } else if (memberType.equals(boolean.class) || memberType.equals(Boolean.class)) {
            p.setType(new QName(XML_SCHEMA_NS, "boolean"));
        } else if (memberType.equals(short.class) || memberType.equals(Short.class)) {
            p.setType(new QName(XML_SCHEMA_NS, "short"));
        } else if (memberType.equals(double.class) || memberType.equals(Double.class)) {
            p.setType(new QName(XML_SCHEMA_NS, "double"));
        } else if (memberType.equals(byte.class) || memberType.equals(Byte.class)) {
            p.setType(new QName(XML_SCHEMA_NS, "byte"));
        }

        for (Annotation a : annotations) {
            if (DefaultValue.class.equals(a.annotationType())) {
                DefaultValue paramAnn = (DefaultValue)a;
                p.setDefault(paramAnn.value());
            }

            if (WADLDoc.class.equals(a.annotationType())) {
                WADLDoc d = (WADLDoc)a;
                p.getDoc().add(getDocument(d));
View Full Code Here

Examples of javax.ws.rs.QueryParam

                             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(Messages
                .getMessage("conflictingParameterAnnotations", member.getName())); //$NON-NLS-1$
        }

        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

Examples of javax.ws.rs.QueryParam

        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

Examples of javax.ws.rs.QueryParam

   }

   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

Examples of javax.ws.rs.QueryParam

   }

   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

Examples of loxia.annotation.QueryParam

    for(int i=0; i < paramAnnos.length; i++){
      for(int j=0; j< paramAnnos[i].length; j++){
        if(paramAnnos[i][j] != null && paramAnnos[i][j] instanceof QueryParam){
          if(args[i] != null && args[i] instanceof Map)
            params.putAll((Map<String,Object>)args[i]);
          QueryParam qp = (QueryParam)paramAnnos[i][j];
          params.put(qp.value(), args[i]);
        }
      }
    }
    return params;
  }
View Full Code Here

Examples of loxia.annotation.QueryParam

              //set to string type if value is null in map params
              params.put(key, HibernateUtil.translateClass(
                  argMap.get(key) == null? String.class: argMap.get(key).getClass()));
            }
          }
          QueryParam qp = (QueryParam)paramAnnos[i][j];
          params.put(qp.value(), HibernateUtil.translateClass(classes[i]));
        }
      }
    }
    return params;
  }
View Full Code Here

Examples of org.apache.deltaspike.data.api.QueryParam

        Annotation[][] annotations = method.getParameterAnnotations();
        for (int i = 0; i < parameters.length; i++)
        {
            if (isParameter(method.getParameterAnnotations()[i]))
            {
                QueryParam qpAnnotation = extractFrom(annotations[i], QueryParam.class);
                if (qpAnnotation != null)
                {
                    result.add(new NamedParameter(qpAnnotation.value(), parameters[i], i));
                }
                else
                {
                    result.add(new IndexedParameter(paramIndex++, parameters[i], i));
                }
View Full Code Here

Examples of org.apache.jetspeed.services.forward.configuration.QueryParam

        if (baseQueryParams != null)
        {
            it = baseQueryParams.values().iterator();
            while (it.hasNext())
            {
                QueryParam qparam = (QueryParam)it.next();
                if (   (null == staticParams || !staticParams.containsKey(qparam.getName()))
                    && (null == dynamicParams || !dynamicParams.containsKey(qparam.getName())))
                {
                    duri.addQueryData(qparam.getName(), qparam.getValue());
                }
            }           
        }

        // Then add the static params
        if (staticParams != null)
        {
            it = staticParams.values().iterator();
            while (it.hasNext())
            {
                QueryParam qparam = (QueryParam)it.next();
                if (null == dynamicParams || !dynamicParams.containsKey(qparam.getName()))
                {              
                    duri.addQueryData(qparam.getName(), qparam.getValue());
                }
            }           
        }
       
        // Then add the dynamic params
View Full Code Here

Examples of org.apache.jetspeed.services.forward.configuration.QueryParam

    {
        System.out.println("----------- MAP: " + mapName);
        Iterator it = map.values().iterator();
        while (it.hasNext())
        {
            QueryParam qparam = (QueryParam)it.next();
            System.out.println("name = " + qparam.getName() + ", value = " + qparam.getValue());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.