Examples of Inject


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

            return getResourceComponentProvider(c);

        if (cc.getAnnotations().length == 1) {
            final Annotation a = cc.getAnnotations()[0];
            if (a.annotationType() == Inject.class) {
                final Inject i = Inject.class.cast(a);
                final String value = (i.value() != null)
                        ? i.value().trim()
                        : "";
                if (value.isEmpty())
                    return getResourceComponentProvider(c);
            } else if (a.annotationType() == InjectParam.class) {
                final InjectParam i = InjectParam.class.cast(a);
                final String value = (i.value() != null)
                        ? i.value().trim()
                        : "";
                if (value.isEmpty())
                    return getResourceComponentProvider(c);
            }
        }
View Full Code Here

Examples of javax.inject.Inject

        return result;
    }

    private <T extends AnnotatedElement> void addAnnotated(T[] elements, Set<T> set) {
        for (T element : elements) {
            Inject injection = getAnnotation(element, Inject.class);
            if (injection != null) {
                set.add(element);
            } else {
                InjectAnnotation modelInject = getAnnotation(element, InjectAnnotation.class);
                if (modelInject != null) {
View Full Code Here

Examples of javax.inject.Inject

    private void autowireViaFields(final Object object, final Class<?> cls) {
        final List<Field> fields = Arrays.asList(cls.getDeclaredFields());
        final Iterable<Field> injectFields = Iterables.filter(fields, new Predicate<Field>() {
            @Override
            public boolean apply(Field input) {
                final Inject annotation = input.getAnnotation(javax.inject.Inject.class);
                return annotation != null;
            }
        });

        for (final Field field : injectFields) {
View Full Code Here

Examples of javax.inject.Inject

    private void autowireViaFields(final Object object, final Class<?> cls) {
        final List<Field> fields = Arrays.asList(cls.getDeclaredFields());
        final Iterable<Field> injectFields = Iterables.filter(fields, new Predicate<Field>() {
            @Override
            public boolean apply(Field input) {
                final Inject annotation = input.getAnnotation(javax.inject.Inject.class);
                return annotation != null;
            }
        });

        for (final Field field : injectFields) {
View Full Code Here

Examples of javax.inject.Inject

    private void autowireViaFields(final Object object, final List<Object> services, final Class<?> cls) {
        final List<Field> fields = Arrays.asList(cls.getDeclaredFields());
        final Iterable<Field> injectFields = Iterables.filter(fields, new Predicate<Field>() {
            @Override
            public boolean apply(Field input) {
                final Inject annotation = input.getAnnotation(javax.inject.Inject.class);
                return annotation != null;
            }
        });

        for (final Field field : injectFields) {
View Full Code Here

Examples of javax.inject.Inject

            Class<?> args[] = retVal.getParameterTypes();
            if (args.length != 0) return retVal;

            // Is zero length, but is it specifically marked?
            Inject i = retVal.getAnnotation(Inject.class);
            if (i != null) {
                return retVal;
            }

            // In this case, the default chose a zero-arg constructor since it could find no other
View Full Code Here

Examples of org.apache.cayenne.di.Inject

            Annotation[] parameterAnnotations = annotations[i];
            for (int j = 0; j < parameterAnnotations.length; j++) {
                Annotation annotation = parameterAnnotations[j];
                if (annotation.annotationType().equals(Inject.class)) {
                    Inject inject = (Inject) annotation;
                    bindingNames[i] = inject.value();
                    break;
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.tapestry.annotations.Inject

    @Test
    public void get_annotation_success()
    {
        Binding inner = mockBinding();
        Location l = mockLocation();
        Inject inject = newMock(Inject.class);

        train_getAnnotation(inner, Inject.class, inject);

        replay();
View Full Code Here

Examples of org.apache.tapestry.annotations.Inject

    @Test
    public void annotation_has_value()
    {
        ObjectProvider provider = mockObjectProvider();
        ObjectLocator locator = mockObjectLocator();
        Inject annotation = newMock(Inject.class);
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        Request injected = mockRequest();

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
View Full Code Here

Examples of org.apache.tapestry.annotations.Inject

    @Test
    public void provide_object_fails()
    {
        ObjectProvider provider = mockObjectProvider();
        ObjectLocator locator = mockObjectLocator();
        Inject annotation = newMock(Inject.class);
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        Throwable cause = new RuntimeException("Injection failed.");

        train_findFieldsWithAnnotation(ct, Inject.class, "myfield");
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.