Examples of HeaderParam


Examples of javax.ws.rs.HeaderParam

        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

Examples of javax.ws.rs.HeaderParam

        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

Examples of javax.ws.rs.HeaderParam

        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

Examples of javax.ws.rs.HeaderParam

        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);
       
       
        CookieParam c = AnnotationUtils.getAnnotation(anns, CookieParam.class);
        if (c != null) {
            return new Parameter(ParameterType.COOKIE, index, c.value(), isEncoded, dValue);
View Full Code Here

Examples of javax.ws.rs.HeaderParam

        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);
       
       
        CookieParam c = AnnotationUtils.getAnnotation(anns, CookieParam.class);
        if (c != null) {
            return new Parameter(ParameterType.COOKIE, index, c.value(), isEncoded, dValue);
View Full Code Here

Examples of javax.ws.rs.HeaderParam

        FormParam f = AnnotationUtils.getAnnotation(anns, FormParam.class);
        if (f != null) {
            return new Parameter(ParameterType.FORM, index, f.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

Examples of javax.ws.rs.HeaderParam

        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

Examples of javax.ws.rs.HeaderParam

        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

Examples of javax.ws.rs.HeaderParam

        // 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 =
                createCookieParam(cookie.value(), classType, genericType, annotations, member);
        } else if (form != null) {
            injectable = createFormParam(form.value(), classType, genericType, annotations, member);
View Full Code Here

Examples of javax.ws.rs.HeaderParam

                p = new Param();
                p.setStyle(ParamStyle.HEADER);
                if (annotations != null) {
                    for (Annotation a : annotations) {
                        if (HeaderParam.class.equals(a.annotationType())) {
                            HeaderParam paramAnn = (HeaderParam)a;
                            p.setName(paramAnn.value());
                        }
                    }
                }
                break;
            case MATRIX:
                p = new Param();
                p.setStyle(ParamStyle.MATRIX);
                for (Annotation a : annotations) {
                    if (MatrixParam.class.equals(a.annotationType())) {
                        MatrixParam paramAnn = (MatrixParam)a;
                        p.setName(paramAnn.value());
                    }
                }
                break;
            case PATH:
                p = new Param();
                p.setStyle(ParamStyle.TEMPLATE);
                for (Annotation a : annotations) {
                    if (PathParam.class.equals(a.annotationType())) {
                        PathParam paramAnn = (PathParam)a;
                        p.setName(paramAnn.value());
                    }
                }
                break;
            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
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.