Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
NamespaceResources |
|
| 1.0;1 |
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.services; | |
16 | ||
17 | import org.apache.hivemind.Location; | |
18 | import org.apache.hivemind.Resource; | |
19 | import org.apache.tapestry.spec.IComponentSpecification; | |
20 | import org.apache.tapestry.spec.ILibrarySpecification; | |
21 | ||
22 | /** | |
23 | * Companion to the standard {@link org.apache.tapestry.engine.Namespace implementation} of | |
24 | * {@link org.apache.tapestry.INamespace}. Defines resources needed by the Namespace instance to | |
25 | * operate (these have grown numerous!) | |
26 | * | |
27 | * @author Howard M. Lewis Ship | |
28 | * @since 4.0 | |
29 | */ | |
30 | public interface NamespaceResources | |
31 | { | |
32 | /** | |
33 | * Finds a child library specification for some parent library specification. | |
34 | * | |
35 | * @param libraryResource | |
36 | * the {@link Resource} from which the parent library (or application) specification | |
37 | * was loaded | |
38 | * @param path | |
39 | * the relative path from the parent specification resource to the library | |
40 | * specification. As a special case, a path starting with a leading slash is assumed | |
41 | * to be on the classpath. | |
42 | * @param location TODO | |
43 | * @return the library specification. | |
44 | */ | |
45 | ILibrarySpecification findChildLibrarySpecification(Resource libraryResource, String path, Location location); | |
46 | ||
47 | /** | |
48 | * Retrieves a page specification, parsing it as necessary. | |
49 | * | |
50 | * @param libraryResource | |
51 | * the base resource for resolving the path to the page specification; this will be | |
52 | * the resource for the library (or application) specification | |
53 | * @param specificationPath | |
54 | * the path to the specification to be parsed | |
55 | * @param location | |
56 | * used to report errors | |
57 | * @throws org.apache.hivemind.ApplicationRuntimeException | |
58 | * if the specification doesn't exist, is unreadable or invalid. | |
59 | * @see org.apache.tapestry.engine.ISpecificationSource#getPageSpecification(Resource) | |
60 | */ | |
61 | ||
62 | IComponentSpecification getPageSpecification(Resource libraryResource, | |
63 | String specificationPath, Location location); | |
64 | ||
65 | /** | |
66 | * Retrieves a component specification, parsing it as necessary. | |
67 | * | |
68 | * @param libraryResource | |
69 | * the base resource for resolving the path to the page specification; this will be | |
70 | * the resource for the library (or application) specification | |
71 | * @param specificationPath | |
72 | * the path to the specification to be parsed | |
73 | * @param location | |
74 | * used to report errors | |
75 | * @throws org.apache.hivemind.ApplicationRuntimeException | |
76 | * if the specification doesn't exist, is unreadable or invalid. | |
77 | */ | |
78 | ||
79 | IComponentSpecification getComponentSpecification(Resource libraryResource, | |
80 | String specificationPath, Location location); | |
81 | ||
82 | } |