Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
IComponentResourceResolver |
|
| 1.0;1 |
1 | package org.apache.tapestry.resolver; |
|
2 | ||
3 | import org.apache.hivemind.Resource; |
|
4 | import org.apache.tapestry.IComponent; |
|
5 | import org.apache.tapestry.IRequestCycle; |
|
6 | ||
7 | import java.util.Locale; |
|
8 | ||
9 | /** |
|
10 | * Service responsible for finding resources relative or specific to a {@link org.apache.tapestry.IComponent}. |
|
11 | * |
|
12 | */ |
|
13 | public interface IComponentResourceResolver { |
|
14 | ||
15 | /** |
|
16 | * Searches for a resource relative to the specified {@link IComponent}, optionally also attemping to |
|
17 | * find a localized version of the resource using the specified {@link Locale}. |
|
18 | * |
|
19 | * @param component |
|
20 | * The component to find the resource relative to. |
|
21 | * @param cycle |
|
22 | * The current request. |
|
23 | * @param name |
|
24 | * Optional resource name to search for, the default is to use the component name. |
|
25 | * @param extension |
|
26 | * Extension name of the resource, such as <ComponentName>.properties for properties |
|
27 | * / <ComponentName>.html for templates and so on. |
|
28 | * @param locale |
|
29 | * Optional localization specifier. |
|
30 | * |
|
31 | * @return The resolved resource, or null if none could be found. The returned {@link Resource} may |
|
32 | * also be not null but still not valid. To ensure validity check {@link org.apache.hivemind.Resource#getResourceURL()} for |
|
33 | * a not null value. |
|
34 | */ |
|
35 | Resource findComponentResource(IComponent component, IRequestCycle cycle, String name, String extension, Locale locale); |
|
36 | } |