Package org.apache.tapestry.annotations

Examples of org.apache.tapestry.annotations.Path


        Asset asset = mockAsset();
        String path = "${foo}";
        String expanded = "foo/bar/baz.gif";
        AnnotationProvider annotationProvider = mockAnnotationProvider();
        TypeCoercer typeCoercer = mockTypeCoercer();
        Path pathAnnotation = mockPath();
        SymbolSource symbolSource = mockSymbolSource();

        train_getAnnotation(annotationProvider, Path.class, pathAnnotation);
        train_value(pathAnnotation, path);
        train_expandSymbols(symbolSource, path, expanded);
View Full Code Here


        SymbolSource symbolSource = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();
        ObjectLocator locator = mockObjectLocator();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        Path annotation = mockPath();

        String fieldName = "myField";
        String fieldType = "java.lang.Object";
        String value = "${foo}";
        String expanded = "foo.gif";
View Full Code Here

        SymbolSource symbolSource = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();
        ObjectLocator locator = mockObjectLocator();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        Path annotation = mockPath();

        String fieldName = "myField";
        Class fieldType = Object.class;
        String value = "${foo}";
        String expanded = "foo.gif";
View Full Code Here

    }

    public boolean provideInjection(String fieldName, String fieldType, ObjectLocator locator,
            ClassTransformation transformation, MutableComponentModel componentModel)
    {
        Path path = transformation.getFieldAnnotation(fieldName, Path.class);

        if (path == null) return false;

        String expanded = _symbolSource.expandSymbols(path.value());

        String sourceFieldName = transformation.addInjectedField(
                AssetSource.class,
                "assetSource",
                _assetSource);
View Full Code Here

     *            not used
     */
    public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider,
            ObjectLocator locator)
    {
        Path path = annotationProvider.getAnnotation(Path.class);

        if (path == null) return null;

        String expanded = _symbolSource.expandSymbols(path.value());

        Asset asset = _source.findAsset(null, expanded, null);

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

        Asset asset = mockAsset();
        String path = "${foo}";
        String expanded = "foo/bar/baz.gif";
        AnnotationProvider annotationProvider = mockAnnotationProvider();
        TypeCoercer typeCoercer = mockTypeCoercer();
        Path pathAnnotation = mockPath();
        SymbolSource symbolSource = mockSymbolSource();

        train_getAnnotation(annotationProvider, Path.class, pathAnnotation);
        train_value(pathAnnotation, path);
        train_expandSymbols(symbolSource, path, expanded);
View Full Code Here

     * @param objectType the type of object (which must be Object or Asset)
     * @param locator    not used
     */
    public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator)
    {
        Path path = annotationProvider.getAnnotation(Path.class);

        if (path == null) return null;

        String expanded = _symbolSource.expandSymbols(path.value());

        Asset asset = _source.getAsset(null, expanded, null);

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

        SymbolSource symbolSource = mockSymbolSource();
        AssetSource assetSource = mockAssetSource();
        ObjectLocator locator = mockObjectLocator();
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        Path annotation = mockPath();
        Resource baseResource = mockResource();

        String fieldName = "myField";
        Class fieldType = Object.class;
        String value = "${foo}";
View Full Code Here

    }

    public boolean provideInjection(String fieldName, Class fieldType, ObjectLocator locator,
                                    ClassTransformation transformation, MutableComponentModel componentModel)
    {
        Path path = transformation.getFieldAnnotation(fieldName, Path.class);

        if (path == null) return false;

        String expanded = _symbolSource.expandSymbols(path.value());

        String sourceFieldName = transformation.addInjectedField(AssetSource.class, "assetSource", _assetSource);

        String baseResourceFieldName = transformation.addInjectedField(Resource.class, "baseResource",
                                                                       componentModel.getBaseResource());
View Full Code Here

    }

    public boolean provideInjection(String fieldName, Class fieldType, ObjectLocator locator,
            ClassTransformation transformation, MutableComponentModel componentModel)
    {
        Path path = transformation.getFieldAnnotation(fieldName, Path.class);

        if (path == null) return false;

        String expanded = _symbolSource.expandSymbols(path.value());

        String sourceFieldName = transformation.addInjectedField(
                AssetSource.class,
                "assetSource",
                _assetSource);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.annotations.Path

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.