Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
ComponentSpecificationResolver |
|
| 1.0;1 |
1 | // Copyright 2004, 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.resolver; |
|
16 | ||
17 | import org.apache.hivemind.ApplicationRuntimeException; |
|
18 | import org.apache.hivemind.Location; |
|
19 | import org.apache.tapestry.INamespace; |
|
20 | import org.apache.tapestry.IRequestCycle; |
|
21 | import org.apache.tapestry.spec.IComponentSpecification; |
|
22 | ||
23 | /** |
|
24 | * Service interface for locating component specifications. |
|
25 | * |
|
26 | * @author Howard Lewis Ship |
|
27 | * @since 4.0 |
|
28 | */ |
|
29 | public interface ComponentSpecificationResolver |
|
30 | { |
|
31 | /** |
|
32 | * Passed the namespace of a container (to resolve the type in) and the type to resolve, |
|
33 | * performs the processing. A "bare type" (without a library prefix) may be in the |
|
34 | * containerNamespace, or the framework namespace (a search occurs in that order). |
|
35 | * |
|
36 | * @param cycle |
|
37 | * current request cycle |
|
38 | * @param containerNamespace |
|
39 | * namespace that may contain a library referenced in the type |
|
40 | * @param type |
|
41 | * the component specification to find, either a simple name, or prefixed with a |
|
42 | * library id (defined for the container namespace) |
|
43 | * @see #getNamespace() |
|
44 | * @see #getSpecification() |
|
45 | */ |
|
46 | void resolve(IRequestCycle cycle, INamespace containerNamespace, String type, |
|
47 | Location location); |
|
48 | ||
49 | /** |
|
50 | * Like |
|
51 | * {@link #resolve(org.apache.tapestry.IRequestCycle, org.apache.tapestry.INamespace, java.lang.String, Location)}, |
|
52 | * but used when the type has already been parsed into a library id and a simple type. |
|
53 | * |
|
54 | * @param cycle |
|
55 | * current request cycle |
|
56 | * @param containerNamespace |
|
57 | * namespace that may contain a library referenced in the type |
|
58 | * @param libraryId |
|
59 | * the library id within the container namespace, or null |
|
60 | * @param type |
|
61 | * the component specification to find as a simple name (without a library prefix) |
|
62 | * @param location |
|
63 | * of reference to be resolved |
|
64 | * @throws ApplicationRuntimeException |
|
65 | * if the type cannot be resolved |
|
66 | */ |
|
67 | void resolve(IRequestCycle cycle, INamespace containerNamespace, String libraryId, |
|
68 | String type, Location location); |
|
69 | ||
70 | /** |
|
71 | * The specification resolved by the resolve() method. |
|
72 | */ |
|
73 | IComponentSpecification getSpecification(); |
|
74 | ||
75 | /** |
|
76 | * The namespace containing the resolved component. |
|
77 | */ |
|
78 | INamespace getNamespace(); |
|
79 | ||
80 | /** |
|
81 | * Returns the unqualified type of the component (i.e., with any namespace prefix stripped off). |
|
82 | */ |
|
83 | String getType(); |
|
84 | } |