| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| AssetFactory |
|
| 1.0;1 |
| 1 | // Copyright 2006, 2007, 2008 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.tapestry5.services; | |
| 16 | ||
| 17 | import org.apache.tapestry5.Asset; | |
| 18 | import org.apache.tapestry5.ioc.Resource; | |
| 19 | ||
| 20 | /** | |
| 21 | * Used by {@link AssetSource} to create new {@link Asset}s as needed. | |
| 22 | * | |
| 23 | * @see org.apache.tapestry5.services.AssetSource | |
| 24 | */ | |
| 25 | public interface AssetFactory | |
| 26 | { | |
| 27 | /** | |
| 28 | * Returns the Resource representing the root folder of the domain this factory is responsible for. | |
| 29 | */ | |
| 30 | Resource getRootResource(); | |
| 31 | ||
| 32 | /** | |
| 33 | * Creates an instance of an asset. Starting with 5.1.0.0, it is preferred (but not required) that the factory | |
| 34 | * return an instance of {@link org.apache.tapestry5.Asset2}. | |
| 35 | * | |
| 36 | * @param resource a resource within this factories domain (derived from the {@linkplain #getRootResource() root | |
| 37 | * resource}) | |
| 38 | * @return an Asset for the resource | |
| 39 | */ | |
| 40 | Asset createAsset(Resource resource); | |
| 41 | } |