Package org.apache.tapestry.spec

Examples of org.apache.tapestry.spec.IAssetSpecification


        while(i.hasNext())
        {
            String name = (String) i.next();

            IAssetSpecification assetSpec = specification.getAsset(name);

            IAsset asset = convertAsset(assetSpec);

            component.addAsset(name, asset);
        }
View Full Code Here


        String propertyName = getValidatedAttribute(
                "property",
                PROPERTY_NAME_PATTERN,
                "invalid-property-name");

        IAssetSpecification ia = _factory.createAssetSpecification();

        ia.setPath(prefix == null ? path : prefix + path);
        ia.setPropertyName(propertyName);

        IComponentSpecification cs = (IComponentSpecification) peekObject();

        cs.addAsset(name, ia);
View Full Code Here

   
    public void performEnhancement(EnhancementOperation op, IComponentSpecification spec, Method method, Location location)
    {
        InjectAsset as = method.getAnnotation(InjectAsset.class);
       
        IAssetSpecification asset = spec.getAsset(as.value());
        if (asset == null) {
           
            throw new ApplicationRuntimeException(AnnotationMessages.unknownAsset(as.value(), location));
        }
       
View Full Code Here

            Method method, Location location)
    {
        Asset asset = method.getAnnotation(Asset.class);
        String propertyName = AnnotationUtils.getPropertyName(method);

        IAssetSpecification as = new AssetSpecification();
        as.setPath(asset.value());
        as.setPropertyName(propertyName);

        // Very important for assets, as they need a location (really, the Resource
        // of a location) to figure out what kind of asset they are.

        //Resource specResource = spec.getSpecificationLocation();
        //Location assetLocation = new DescribedLocation(specResource, location.toString());
       
        as.setLocation(location);

        spec.addAsset(propertyName, as);
    }
View Full Code Here

        Iterator i = names.iterator();

        while (i.hasNext())
        {
            String name = (String) i.next();
            IAssetSpecification assetSpec = specification.getAsset(name);
            IAsset asset = convert(name, component, assetSpec, specLocation);

            component.addAsset(name, asset);
        }
    }
View Full Code Here

            Method method)
    {
        Asset asset = method.getAnnotation(Asset.class);
        String propertyName = AnnotationUtils.getPropertyName(method);

        IAssetSpecification as = new AssetSpecification();
        as.setPath(asset.value());
        as.setPropertyName(propertyName);

        spec.addAsset(propertyName, as);
    }
View Full Code Here

        while (i.hasNext())
        {
            String name = (String) i.next();

            IAssetSpecification assetSpec = specification.getAsset(name);

            IAsset asset = convertAsset(assetSpec);

            component.addAsset(name, asset);
        }
View Full Code Here

    {
        Location l = newLocation();
        EnhancementOperation op = newOp();
        IComponentSpecification spec = newSpec();
        InjectAssetWorker delegate = new InjectAssetWorker();
        IAssetSpecification asset = newMock(IAssetSpecification.class);
       
        Method m = findMethod(AnnotatedPage.class, "getStylesheetAsset");
       
        expect(spec.getAsset("stylesheet")).andReturn(asset);
       
View Full Code Here

        new AssetAnnotationWorker().performEnhancement(op, spec, m, l);

        verify();

        IAssetSpecification as = spec.getAsset("globalStylesheet");

        assertEquals("/style/global.css", as.getPath());
        assertEquals(as.getLocation(), l);
        assertEquals("globalStylesheet", as.getPropertyName());
    }
View Full Code Here

        new AssetAnnotationWorker().performEnhancement(op, spec, m, l);

        verify();

        IAssetSpecification as = spec.getAsset("textAsset");

        assertEquals("images/test-asset.txt", as.getPath());
        assertEquals(as.getLocation(), l);
        assertEquals("textAsset", as.getPropertyName());
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.spec.IAssetSpecification

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.