KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > definition > impl > ExtensionPointDefinitionImpl


1 // Copyright 2007 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.hivemind.definition.impl;
16
17 import org.apache.hivemind.Location;
18 import org.apache.hivemind.definition.ExtensionPointDefinition;
19 import org.apache.hivemind.definition.ModuleDefinition;
20 import org.apache.hivemind.definition.Visibility;
21 import org.apache.hivemind.util.Defense;
22
23 /**
24  * Default implementation of {@link ExtensionPointDefinition}.
25  *
26  * @author Achim Huegen
27  */

28 public class ExtensionPointDefinitionImpl implements ExtensionPointDefinition
29 {
30     private ModuleDefinition _module;
31
32     private String JavaDoc _id;
33
34     private Location _location;
35
36     private Visibility _visibility;
37     
38     public ExtensionPointDefinitionImpl(ModuleDefinition module)
39     {
40         Defense.notNull(module, "module");
41         _module = module;
42     }
43
44     public ExtensionPointDefinitionImpl(ModuleDefinition module, String JavaDoc id, Location location, Visibility visibility)
45     {
46         this(module);
47         _id = id;
48         _location = location;
49         _visibility = visibility;
50     }
51
52     /**
53      * @see org.apache.hivemind.definition.ExtensionPointDefinition#getModuleId()
54      */

55     public String JavaDoc getModuleId()
56     {
57         return _module.getId();
58     }
59
60     /**
61      * @return the module that defined this extension point.
62      */

63     protected ModuleDefinition getModule()
64     {
65         return _module;
66     }
67     
68     /**
69      * @see org.apache.hivemind.definition.ExtensionPointDefinition#getQualifiedId()
70      */

71     public String JavaDoc getQualifiedId()
72     {
73         return getModuleId() + "." + _id;
74     }
75
76     /**
77      * @see org.apache.hivemind.definition.ExtensionPointDefinition#getId()
78      */

79     public String JavaDoc getId()
80     {
81         return _id;
82     }
83
84     /**
85      * Sets the id of the extension point.
86      * @param id the id (unqualified without module id)
87      */

88     public void setId(String JavaDoc id)
89     {
90         _id = id;
91     }
92
93     /**
94      * @see org.apache.hivemind.definition.ExtensionPointDefinition#getLocation()
95      */

96     public Location getLocation()
97     {
98         return _location;
99     }
100
101     /**
102      * Sets the location of the extension point.
103      */

104     public void setLocation(Location location)
105     {
106         _location = location;
107     }
108
109     /**
110      * @see org.apache.hivemind.definition.ExtensionPointDefinition#getVisibility()
111      */

112     public Visibility getVisibility()
113     {
114         return _visibility;
115     }
116
117     /**
118      * Sets the visibility of the extension point.
119      */

120     public void setVisibility(Visibility visibility)
121     {
122         _visibility = visibility;
123     }
124
125 }
126
Popular Tags