Package com.sun.jersey.api.model

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


            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


        ReflectionHelper.ClassTypePair ct = getGenericType(concreteClass, declaringClass, paramClass, paramType);
        paramType = ct.t;
        paramClass = ct.c;

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

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

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

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

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

       
        while (c != Object.class) {
             for (final Field f : c.getDeclaredFields()) {
                if (f.getDeclaredAnnotations().length > 0) {
                    final AbstractField af = new AbstractField(f);
                    Parameter p = createParameter(
                            resource.getResourceClass(),
                            f.getDeclaringClass(),
                            isEncoded,
                            f.getType(),
                            f.getGenericType(),
View Full Code Here

                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

        ReflectionHelper.ClassTypePair ct = getGenericType(concreteClass, declaringClass, paramClass, paramType);
        paramType = ct.t;
        paramClass = ct.c;

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

                // element.
                // The problem here is that (1) we don't have the original program
                // element any more and (2) a single DiscoveredParameter may have
                // been encountered in multiple places with different annotations

                Parameter jerseyParameter = new Parameter(
                                                    new Annotation[]{ annotation },
                                                    annotation,
                                                    paramQualifiersMap.get(annotation.annotationType()),
                                                    parameter.getValue(),
                                                    parameter.getType(),
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);
           
            if (p.getAnnotation() == null) continue;

            if (s == ComponentScope.PerRequest) {
                // Find a per request injectable with Parameter
                Injectable i = ipc.getInjectable(
                        p.getAnnotation().annotationType(),
                        aoc,
                        p.getAnnotation(),
                        p,
                        ComponentScope.PerRequest);
                if (i != null) {
                    configureField(af.getField());
                    perRequest.put(af.getField(), i);
                } else {
                    i = ipc.getInjectable(
                            p.getAnnotation().annotationType(),
                            aoc,
                            p.getAnnotation(),
                            p.getParameterType(),
                            ComponentScope.PERREQUEST_UNDEFINED
                            );
                    if (i != null) {
                        configureField(af.getField());
                        perRequest.put(af.getField(), i);                       
                    } else {
                        i = ipc.getInjectable(
                                p.getAnnotation().annotationType(),
                                aoc,
                                p.getAnnotation(),
                                p.getParameterType(),
                                ComponentScope.Singleton
                                );
                        if (i != null) {
                            configureField(af.getField());
                            singletons.put(af.getField(), i);                       
                        }
                    }
                }
            } else {
                Injectable i = ipc.getInjectable(
                        p.getAnnotation().annotationType(),
                        aoc,
                        p.getAnnotation(),
                        p.getParameterType(),
                        ComponentScope.UNDEFINED_SINGLETON
                        );           
                if (i != null) {
                    configureField(af.getField());
                    singletons.put(af.getField(), 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.