Examples of Injectable


Examples of com.sun.jersey.spi.inject.Injectable

        final Providers p;
        final Injectable i;

        private ProvidersInjectableProviderContext(final Providers p) {
            this.p = p;
            this.i = new Injectable() {

                @Override
                public Object getValue() {
                    return p;
                }
View Full Code Here

Examples of com.sun.jersey.spi.inject.Injectable

                Type type = pType.getActualTypeArguments()[0];
                // TODO check if concrete type
               
                final ContextResolver cr = getResolver(ic, type);
                if (cr == null) {
                    return new Injectable() {
                        public Object getValue() {
                            return null;
                        }                   
                    };
                } else {
                    return new Injectable() {
                        public Object getValue() {
                            return cr;
                        }
                    };
                }
View Full Code Here

Examples of com.sun.jersey.spi.inject.Injectable

            ComponentContext ic,
            A a,
            C c,
            ComponentScope s) {
        for (MetaInjectableProvider mip : findInjectableProviders(ac, c.getClass(), s)) {
            Injectable i = mip.ip.getInjectable(ic, a, c);
            if (i != null)
                return i;
        }
        return null;
    }
View Full Code Here

Examples of com.sun.jersey.spi.inject.Injectable

            ComponentContext ic,
            A a,
            C c,
            List<ComponentScope> ls) {
        for (ComponentScope s : ls) {
            Injectable i = getInjectable(ac, ic, a, c, s);
            if (i != null)
                return i;
            else {
            }
        }
View Full Code Here

Examples of com.sun.jersey.spi.inject.Injectable

            ComponentContext ic,
            A a,
            C c,
            List<ComponentScope> ls) {
        for (ComponentScope s : ls) {
            Injectable i = getInjectable(ac, ic, a, c, s);
            if (i != null)
                return new InjectableScopePair(i, s);
        }
        return null;
    }
View Full Code Here

Examples of com.sun.jersey.spi.inject.Injectable

                aoc.setAccessibleObject(f);
                final Annotation[] as = f.getAnnotations();
                aoc.setAnnotations(as);
                boolean missingDependency = false;
                for (Annotation a : as) {
                    Injectable i = ipc.getInjectable(
                            a.annotationType(), aoc, a, f.getGenericType(),
                            ComponentScope.UNDEFINED_SINGLETON);
                    if (i != null) {
                        missingDependency = false;
                        setFieldValue(t, f, i.getValue());
                        break;
                    } else if (ipc.isAnnotationRegistered(a.annotationType(), f.getGenericType().getClass())) {
                        missingDependency = true;
                    }
                }

                if (missingDependency) {
                    Errors.missingDependency(f);
                }

            }
            oClass = oClass.getSuperclass();
        }

        MethodList ml = new MethodList(c.getMethods());
        int methodIndex = 0;
        for (AnnotatedMethod m : ml.
                hasNotMetaAnnotation(HttpMethod.class).
                hasNotAnnotation(Path.class).
                hasNumParams(1).
                hasReturnType(void.class).
                nameStartsWith("set")) {
            final Annotation[] as = m.getAnnotations();
            aoc.setAccessibleObject(m.getMethod());
            aoc.setAnnotations(as);
            final Type gpt = m.getGenericParameterTypes()[0];

            boolean missingDependency = false;
            for (Annotation a : as) {
                Injectable i = ipc.getInjectable(
                        a.annotationType(), aoc, a, gpt,
                        ComponentScope.UNDEFINED_SINGLETON);
                if (i != null) {
                    missingDependency = false;
                    setMethodValue(t, m, i.getValue());
                    break;
                } else if (ipc.isAnnotationRegistered(a.annotationType(), gpt.getClass())) {
                    missingDependency = true;
                }
            }
View Full Code Here

Examples of com.sun.jersey.spi.inject.Injectable

            aoc.setAccessibleObject(con);
            for (int p = 0; p < ps; p++) {
                Type pgtype = con.getGenericParameterTypes()[p];
                Annotation[] as = con.getParameterAnnotations()[p];
                aoc.setAnnotations(as);
                Injectable i = null;
                for (Annotation a : as) {
                    i = ipc.getInjectable(
                            a.annotationType(), aoc, a, pgtype,
                            ComponentScope.UNDEFINED_SINGLETON);
                }
View Full Code Here

Examples of com.sun.jersey.spi.inject.Injectable

                    list.add(new FormDataContentDispositionMultiPartInjectable(p.getSourceName()));
                } else {
                    list.add(new FormDataMultiPartParamInjectable(p));
                }
            } else {
                Injectable injectable = getInjectableProviderContext().getInjectable(p, ComponentScope.PerRequest);
                list.add(injectable);
            }
        }
        return list;
    }
View Full Code Here

Examples of com.sun.jersey.spi.inject.Injectable

            @Override
            public Injectable getInjectable(ComponentContext ic, Context a, Type c) {
                final Object o = m.get(c);
                if (o != null) {
                    return new Injectable() {
                        @Override
                        public Object getValue() {
                            return o;
                        }
                    };
View Full Code Here

Examples of com.sun.jersey.spi.inject.Injectable

                    is.add(new FormEntityInjectable(p.getParameterClass(),
                            p.getParameterType(), p.getAnnotations()));
                } else
                    is.add(null);
            } else {
                Injectable injectable = getInjectableProviderContext().
                        getInjectable(method.getMethod(), p, ComponentScope.PerRequest);
                is.add(injectable);
            }
        }
        return is;
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.