Package org.apache.tapestry.ioc.annotations

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


    {
        SymbolSource source = mockSymbolSource();
        TypeCoercer coercer = mockTypeCoercer();
        AnnotationProvider annotationProvider = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        Symbol annotation = newMock(Symbol.class);
        String symbolName = "example-symbol";
        String symbolValue = "symbol-value";
        Long coercedValue = 123l;

        train_getAnnotation(annotationProvider, Symbol.class, annotation);

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

        train_valueForSymbol(source, symbolName, symbolValue);

        train_coerce(coercer, symbolValue, Long.class, coercedValue);
View Full Code Here


        AnnotationProvider annotationProvider = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        String symbolName = "example-symbol";
        String symbolValue = "symbol-value";
        Long coercedValue = 123l;
        Symbol annotation = newSymbol(symbolName);

        train_getAnnotation(annotationProvider, Symbol.class, annotation);
        train_getAnnotation(annotationProvider, IntermediateType.class, null);

        train_valueForSymbol(source, symbolName, symbolValue);
View Full Code Here

        AnnotationProvider annotationProvider = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        String symbolName = "example-symbol";
        String symbolValue = "symbol-value";
        Long coercedValue = 123l;
        Symbol annotation = newSymbol(symbolName);
        IntermediateType it = newIntermediateType();
        BigInteger intervalue = new BigInteger("123");

        train_getAnnotation(annotationProvider, Symbol.class, annotation);
        train_getAnnotation(annotationProvider, IntermediateType.class, it);
View Full Code Here

    }

    private Symbol newSymbol(String symbolName)
    {
        Symbol annotation = newMock(Symbol.class);
        expect(annotation.value()).andReturn(symbolName);
        return annotation;
    }
View Full Code Here

        _typeCoercer = typeCoercer;
    }

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

        if (annotation == null) return null;

        Object value = _symbolSource.valueForSymbol(annotation.value());

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

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

    }

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

        if (annotation == null) return null;

        String symbolValue = _symbolSource.valueForSymbol(annotation.value());

        return _typeCoercer.coerce(symbolValue, objectType);
    }
View Full Code Here

TOP

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

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.