Package com.sun.jersey.api.model

Examples of com.sun.jersey.api.model.Parameter


                hasNumParams(1).
                hasReturnType(void.class).
                nameStartsWith("set")) {
           
            final AbstractSetterMethod asm = new AbstractSetterMethod(resource, m.getMethod(), m.getAnnotations());
            Parameter p = createParameter(
                    resource.getResourceClass(),
                    m.getMethod().getDeclaringClass(),
                    isEncoded,
                    m.getParameterTypes()[0],
                    m.getGenericParameterTypes()[0],
View Full Code Here


            Class[] parameterTypes,
            Type[] genericParameterTypes,
            Annotation[][] parameterAnnotations) {

        for (int i = 0; i < parameterTypes.length; i++) {
            Parameter parameter = createParameter(
                    concreteClass, declaringClass,
                    isEncoded, parameterTypes[i],
                    genericParameterTypes[i],
                    parameterAnnotations[i]);
            if (null != parameter) {
View Full Code Here

                paramType = ct.t;
                paramClass = ct.c;
            }
        }

        return new Parameter(
                annotations, paramAnnotation,
                paramSource,
                paramName, paramType, paramClass,
                paramEncoded, paramDefault);
    }
View Full Code Here

            return null;
        }
       
        boolean hasFormParam = false;
        for (int i = 0; i < method.getParameters().size(); i++) {
            Parameter parameter = method.getParameters().get(i);
            if (parameter.getAnnotation() != null)
                hasFormParam |= parameter.getAnnotation().annotationType() == FormParam.class;           
        }
        if (!hasFormParam)
            return null;
       
        return getInjectables(method);
View Full Code Here

    }

    protected List<Injectable> getInjectables(AbstractResourceMethod method) {
        List<Injectable> is = new ArrayList<Injectable>(method.getParameters().size());
        for (int i = 0; i < method.getParameters().size(); i++) {
            Parameter p = method.getParameters().get(i);
           
            if (Parameter.Source.ENTITY == p.getSource()) {
                if (MultivaluedMap.class.isAssignableFrom(p.getParameterClass())) {
                    is.add(new FormEntityInjectable(p.getParameterClass(),
                            p.getParameterType(), p.getAnnotations()));
                } else
                    is.add(null);
            } else {
                Injectable injectable = getInjectableProviderContext().
                        getInjectable(p, ComponentScope.PerRequest);
View Full Code Here

        }

        boolean hasEntity = false;
        final List<Injectable> is = new ArrayList<Injectable>(method.getParameters().size());
        for (int i = 0; i < method.getParameters().size(); i++) {
            final Parameter parameter = method.getParameters().get(i);
           
            if (Parameter.Source.ENTITY == parameter.getSource()) {
                hasEntity = true;
                is.add(processEntityParameter(
                        parameter,
                        method.getMethod().getParameterAnnotations()[i]));
            } else {
                is.add(getInjectableProviderContext().
                        getInjectable(parameter, ComponentScope.PerRequest));
            }
        }

        if (hasEntity)
            return is;

        if (Collections.frequency(is, null) == 1) {
            final int i = is.lastIndexOf(null);
            final Parameter parameter = method.getParameters().get(i);
            if (Parameter.Source.UNKNOWN == parameter.getSource()) {
                final Injectable ij = processEntityParameter(
                    parameter,
                    method.getMethod().getParameterAnnotations()[i]);
                is.set(i, ij);
            }
View Full Code Here

    }
       
    @Override
    protected List<Injectable> getInjectables(AbstractResourceMethod method) {
        for (int i = 0; i < method.getParameters().size(); i++) {
            Parameter p = method.getParameters().get(i);
           
            if (p.getAnnotation().annotationType() == FormParam.class) {
                LOGGER.severe("Resource methods utilizing @FormParam "
                        + "and consuming \"multipart/form-data\" are no longer supported. See @FormDataParam.");
            }
        }
        return null;
View Full Code Here

        Map<Field, Injectable<?>> perRequest = new HashMap<Field, Injectable<?>>();
       
        AccessibleObjectContext aoc = new AccessibleObjectContext();
        for (AbstractField af : fields) {
            aoc.setAccesibleObject(af.getField());
            Parameter p = af.getParameters().get(0);

            InjectableScopePair isp = ipc.getInjectableiWithScope(p, s);
            if (isp != null) {
                configureField(af.getField());
                if (s == ComponentScope.PerRequest && isp.cs != ComponentScope.Singleton) {
View Full Code Here

        Map<Method, Injectable<?>> perRequest = new HashMap<Method, Injectable<?>>();
       
        AccessibleObjectContext aoc = new AccessibleObjectContext();
        int methodIndex = 0;
        for (AbstractSetterMethod sm : setterMethods) {
            Parameter p = sm.getParameters().get(0);
            aoc.setAccesibleObject(sm.getMethod(), p.getAnnotations());

            InjectableScopePair isp = ipc.getInjectableiWithScope(p, s);
            if (isp != null) {
                if (s == ComponentScope.PerRequest && isp.cs != ComponentScope.Singleton) {
                    perRequest.put(sm.getMethod(), isp.i);
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.model.Parameter

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.