KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > pageload > ComponentClassProviderContext


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 JavaDoc _name;
32
33     private IComponentSpecification _specification;
34
35     public ComponentClassProviderContext(String JavaDoc pageName,
36             IComponentSpecification pageSpecification, INamespace namespace)
37     {
38         Defense.notNull(pageName, "pageName");
39         Defense.notNull(pageSpecification, "pageSpecification");
40         Defense.notNull(namespace, "namespace");
41
42         _name = pageName;
43         _specification = pageSpecification;
44         _namespace = namespace;
45     }
46
47     /**
48      * Returns the simple, unqualifed name of the page, or the type of the component. There will not
49      * be a namespace prefix, but there may be one or more folders (i.e., "admin/Menu").
50      */

51
52     public String JavaDoc getName()
53     {
54         return _name;
55     }
56
57     /**
58      * Returns the namespace containing the page.
59      */

60
61     public INamespace getNamespace()
62     {
63         return _namespace;
64     }
65
66     /**
67      * Returns the specification defining the page.
68      */

69     public IComponentSpecification getSpecification()
70     {
71         return _specification;
72     }
73
74 }
Popular Tags