Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ComponentClassProviderContext |
|
| 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.pageload; | |
16 | ||
17 | import org.apache.hivemind.util.Defense; | |
18 | import org.apache.tapestry.INamespace; | |
19 | import org.apache.tapestry.spec.IComponentSpecification; | |
20 | ||
21 | /** | |
22 | * Contains information needed when trying to determine the name of a page or component class. | |
23 | * | |
24 | * @author Howard M. Lewis Ship | |
25 | * @since 4.0 | |
26 | */ | |
27 | public class ComponentClassProviderContext | |
28 | { | |
29 | private INamespace _namespace; | |
30 | ||
31 | private String _name; | |
32 | ||
33 | private IComponentSpecification _specification; | |
34 | ||
35 | public ComponentClassProviderContext(String pageName, IComponentSpecification pageSpecification, INamespace namespace) | |
36 | 0 | { |
37 | 0 | Defense.notNull(pageName, "pageName"); |
38 | 0 | Defense.notNull(pageSpecification, "pageSpecification"); |
39 | 0 | Defense.notNull(namespace, "namespace"); |
40 | ||
41 | 0 | _name = pageName; |
42 | 0 | _specification = pageSpecification; |
43 | 0 | _namespace = namespace; |
44 | 0 | } |
45 | ||
46 | /** | |
47 | * Returns the simple, unqualifed name of the page, or the type of the component. There will not | |
48 | * be a namespace prefix, but there may be one or more folders (i.e., "admin/Menu"). | |
49 | */ | |
50 | ||
51 | public String getName() | |
52 | { | |
53 | 0 | return _name; |
54 | } | |
55 | ||
56 | /** | |
57 | * Returns the namespace containing the page. | |
58 | */ | |
59 | ||
60 | public INamespace getNamespace() | |
61 | { | |
62 | 0 | return _namespace; |
63 | } | |
64 | ||
65 | /** | |
66 | * Returns the specification defining the page. | |
67 | */ | |
68 | public IComponentSpecification getSpecification() | |
69 | { | |
70 | 0 | return _specification; |
71 | } | |
72 | ||
73 | } |