Package javax.ws.rs

Examples of javax.ws.rs.HeaderParam


                if (formParam != null) {
                    formParams.put(formParam.value(), arg);
                    continue;
                }

                HeaderParam headerParam = getAnnotation(arg, HeaderParam.class);
                if (headerParam != null) {
                    headerParams.put(headerParam.value(), arg);
                    continue;
                }

                if (!formParams.isEmpty()) {
                    getLogger().log(ERROR, "You can not have both @FormParam parameters and a content parameter: " +
View Full Code Here


      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, providerFactory);
      }
      else if ((header = FindAnnotation.findAnnotation(annotations, HeaderParam.class)) != null)
      {
         return new HeaderParamInjector(type, genericType, injectTarget, header.value(), defaultVal, providerFactory);
      }
      else if ((formParam = FindAnnotation.findAnnotation(annotations, FormParam.class)) != null)
      {
         return new FormParamInjector(type, genericType, injectTarget, formParam.value(), defaultVal, providerFactory);
      }
View Full Code Here

        FormParam f = AnnotationUtils.getAnnotation(anns, FormParam.class);
        if (f != null) {
            return new Parameter(ParameterType.FORM, index, f.value(), isEncoded, dValue);
        }
       
        HeaderParam h = AnnotationUtils.getAnnotation(anns, HeaderParam.class);
        if (h != null) {
            return new Parameter(ParameterType.HEADER, index, h.value(), isEncoded, dValue);
       
       
        p = null;
        CookieParam c = AnnotationUtils.getAnnotation(anns, CookieParam.class);
        if (c != null) {
View Full Code Here

        if (cookie != null) {
            result = processCookieParam(message, cookie.value(), parameterClass, genericParam,
                                        defaultValue);
        }
       
        HeaderParam hp = AnnotationUtils.getAnnotation(anns, HeaderParam.class);
        if (hp != null) {
            result = processHeaderParam(message, hp.value(), parameterClass, genericParam,
                                        defaultValue);
        }

        return result;
    }
View Full Code Here

        if (cookie != null) {
            result = processCookieParam(message, cookie.value(), parameterClass, genericParam,
                                        defaultValue);
        }
       
        HeaderParam hp = AnnotationUtils.getAnnotation(anns, HeaderParam.class);
        if (hp != null) {
            result = processHeaderParam(message, hp.value(), parameterClass, genericParam,
                                        defaultValue);
        }

        return result;
    }
View Full Code Here

        MatrixParam m = AnnotationUtils.getAnnotation(anns, MatrixParam.class);
        if (m != null) {
            return new Parameter(ParameterType.MATRIX, index, m.value());
       
   
        HeaderParam h = AnnotationUtils.getAnnotation(anns, HeaderParam.class);
        if (h != null) {
            return new Parameter(ParameterType.HEADER, index, h.value());
       
       
        Parameter p = null;
        CookieParam c = AnnotationUtils.getAnnotation(anns, CookieParam.class);
        if (c != null) {
View Full Code Here

        mockContext.assertIsSatisfied();
    }

    @Test
    public void testBuildBasicHeaderParamWithMock() throws Exception {
        HeaderParam qp =
            Temp.class.getMethod("setHeaderParam", Integer.class).getAnnotation(HeaderParam.class);
        final Annotation[] annArray = new Annotation[] {qp};

        mockContext.checking(new Expectations() {
            {
View Full Code Here

        mockContext.assertIsSatisfied();
    }

    @Test
    public void testBuildParamWithDefault() throws Exception {
        HeaderParam ann =
            Temp.class.getMethod("setHeaderParamWithDefault", double.class)
                .getAnnotation(HeaderParam.class);
        DefaultValue dvAnn =
            Temp.class.getMethod("setHeaderParamWithDefault", double.class)
                .getAnnotation(DefaultValue.class);
View Full Code Here

        FormParam f = AnnotationUtils.getAnnotation(anns, FormParam.class);
        if (f != null) {
            return new Parameter(ParameterType.FORM, index, f.value(), isEncoded, dValue);
        }
       
        HeaderParam h = AnnotationUtils.getAnnotation(anns, HeaderParam.class);
        if (h != null) {
            return new Parameter(ParameterType.HEADER, index, h.value(), isEncoded, dValue);
       
       
        p = null;
        CookieParam c = AnnotationUtils.getAnnotation(anns, CookieParam.class);
        if (c != null) {
View Full Code Here

            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]);
            }
            FormParam formParam = getAnnotation(annotations, FormParam.class);
            if (formParam != null) {
                isEntity = false;
                formParams.put(formParam.value(), args[i]);
View Full Code Here

TOP

Related Classes of javax.ws.rs.HeaderParam

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.