Clover coverage report - Code Coverage for tapestry release 4.0-beta-10
Coverage timestamp: Sat Oct 8 2005 19:08:05 EDT
file stats: LOC: 71   Methods: 0
NCLOC: 10   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
AssetFactory.java - - - -
coverage
 1    // Copyright 2005 The Apache Software Foundation
 2    //
 3    // Licensed under the Apache License, Version 2.0 (the "License");
 4    // you may not use this file except in compliance with the License.
 5    // You may obtain a copy of the License at
 6    //
 7    // http://www.apache.org/licenses/LICENSE-2.0
 8    //
 9    // Unless required by applicable law or agreed to in writing, software
 10    // distributed under the License is distributed on an "AS IS" BASIS,
 11    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12    // See the License for the specific language governing permissions and
 13    // limitations under the License.
 14   
 15    package org.apache.tapestry.asset;
 16   
 17    import java.util.Locale;
 18   
 19    import org.apache.hivemind.Location;
 20    import org.apache.hivemind.Resource;
 21    import org.apache.tapestry.IAsset;
 22   
 23    /**
 24    * A service which creates an asset. In some cases, the asset is selected based on the Resource
 25    * (typically of the component or page specification).
 26    *
 27    * @author Howard M. Lewis Ship
 28    * @since 4.0
 29    */
 30    public interface AssetFactory
 31    {
 32    /**
 33    * Creates a new asset relative to an existing asset.
 34    *
 35    * @param baseResource
 36    * the base resource from which an asset path may be calculated. Each type of asset
 37    * is linked to a particular implemenation of {@link Resource}, and generates a
 38    * corresponding implementation of {@link org.apache.tapestry.IAsset}.
 39    * @param path
 40    * the path relative to the resource (if no leading slash), or an absolute path
 41    * within the domain of the asset type (i.e, within the classpath, or within the web
 42    * application).
 43    * @param locale
 44    * the desired locale of the asset; the closest match will be used.
 45    * @param location
 46    * the location to be associated with the returned asset, or null to not attempt to
 47    * localize the asset
 48    * @throws org.apache.hivemind.ApplicationRuntimeException
 49    * if no matching asset may be found.
 50    */
 51    public IAsset createAsset(Resource baseResource, String path, Locale locale, Location location);
 52   
 53    /**
 54    * Creates a new asset relative to the root of the domain defined by the type of asset.
 55    *
 56    * @param path
 57    * the absolute path for the resource
 58    * @param locale
 59    * the locale to localize the asset to, or null for no localization
 60    * @param location
 61    * the location used to report any errors
 62    * @return an {@link IAsset}
 63    */
 64    public IAsset createAbsoluteAsset(String path, Locale locale, Location location);
 65   
 66    /**
 67    * Creates a new asset based on a known resource.
 68    */
 69   
 70    public IAsset createAsset(Resource resource, Location location);
 71    }