Package org.apache.tapestry.ioc.annotations

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


        AnnotationProvider annotationProvider = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        String annotationValue = "${foo}";
        String expanded = "Foo";
        Runnable coerced = mockRunnable();
        Value annotation = newMock(Value.class);

        train_getAnnotation(annotationProvider, Value.class, annotation);

        expect(annotation.value()).andReturn(annotationValue);

        train_expandSymbols(symbolSource, annotationValue, expanded);
        train_coerce(coercer, expanded, Runnable.class, coerced);

        replay();
View Full Code Here


        AnnotationProvider annotationProvider = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        String annotationValue = "${foo}";
        String expanded = "Foo";
        Runnable coerced = mockRunnable();
        Value annotation = newMock(Value.class);

        train_getAnnotation(annotationProvider, Value.class, annotation);

        expect(annotation.value()).andReturn(annotationValue);

        train_expandSymbols(symbolSource, annotationValue, expanded);
        train_coerce(coercer, expanded, Runnable.class, coerced);

        replay();
View Full Code Here

    }

    public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider,
            ObjectLocator locator)
    {
        Value annotation = annotationProvider.getAnnotation(Value.class);

        if (annotation == null) return null;

        String value = annotation.value();
        String expanded = _symbolSource.expandSymbols(value);
        T coerced = _typeCoercer.coerce(expanded, objectType);

        return coerced;
    }
View Full Code Here

        _typeCoercer = typeCoercer;
    }

    public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator)
    {
        Value annotation = annotationProvider.getAnnotation(Value.class);

        if (annotation == null) return null;

        String value = annotation.value();
        Object expanded = _symbolSource.expandSymbols(value);

        IntermediateType intermediate = annotationProvider.getAnnotation(IntermediateType.class);

        if (intermediate != null) expanded = _typeCoercer.coerce(expanded, intermediate.value());
View Full Code Here

        AnnotationProvider annotationProvider = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        String annotationValue = "${foo}";
        String expanded = "Foo";
        Runnable coerced = mockRunnable();
        Value annotation = newValue(annotationValue);

        train_getAnnotation(annotationProvider, Value.class, annotation);

        train_getAnnotation(annotationProvider, IntermediateType.class, null);
View Full Code Here

        AnnotationProvider annotationProvider = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        String annotationValue = "${foo}";
        String expanded = "Foo";
        Runnable coerced = mockRunnable();
        Value annotation = newValue(annotationValue);
        IntermediateType it = newIntermediateType();
        BigDecimal intervalue = new BigDecimal("1234");

        train_getAnnotation(annotationProvider, Value.class, annotation);
View Full Code Here

        verify();
    }

    private Value newValue(String value)
    {
        Value annotation = newMock(Value.class);

        expect(annotation.value()).andReturn(value);

        return annotation;
    }
View Full Code Here

    }

    public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider,
            ObjectLocator locator)
    {
        Value annotation = annotationProvider.getAnnotation(Value.class);

        if (annotation == null) return null;

        String value = annotation.value();
        String expanded = _symbolSource.expandSymbols(value);
        T coerced = _typeCoercer.coerce(expanded, objectType);

        return coerced;
    }
View Full Code Here

TOP

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

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.