Package org.apache.tapestry.ioc.annotations

Examples of org.apache.tapestry.ioc.annotations.Inject


            String serviceId = is.value();

            return locator.getService(serviceId, parameterType);
        }

        Inject i = findAnnotation(parameterAnnotations, Inject.class);

        if (i != null)
        {
            String reference = i.value();

            return locator.getObject(reference, parameterType);
        }

        // See if we have any "pre-determined" parameter type to object mappings
View Full Code Here


    @Test
    public void anonymous_injection()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();

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

    @Test
    public void anonymous_injection_not_provided()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();

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

    @Test
    public void injection_provider_threw_exception()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        RuntimeException failure = new RuntimeException("Oops.");

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

    public final void transform(ClassTransformation transformation, MutableComponentModel model)
    {
        for (String fieldName : transformation.findFieldsWithAnnotation(Inject.class))
        {
            Inject annotation = transformation.getFieldAnnotation(fieldName, Inject.class);

            try
            {
                String fieldType = transformation.getFieldType(fieldName);
View Full Code Here

    @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

    @Test
    public void anonymous_injection()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();

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

    @Test
    public void anonymous_injection_not_provided()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();

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

    @Test
    public void injection_provider_threw_exception()
    {
        ObjectLocator locator = mockObjectLocator();
        InjectionProvider ip = newMock(InjectionProvider.class);
        Inject annotation = newInject();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        RuntimeException failure = new RuntimeException("Oops.");

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

    public void transform(ClassTransformation transformation, MutableComponentModel model)
    {
        for (String fieldName : transformation.findFieldsWithAnnotation(Inject.class))
        {
            Inject annotation = transformation.getFieldAnnotation(fieldName, Inject.class);

            inject(fieldName, transformation, model);

            transformation.claimField(fieldName, annotation);
        }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.annotations.Inject

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.