KickJava   Java API By Example, From Geeks To Geeks.

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


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.ExtensionDefinition;
19 import org.apache.hivemind.definition.ModuleDefinition;
20 import org.apache.hivemind.util.Defense;
21
22 /**
23  * Default implementation of {@link ExtensionDefinition}.
24  *
25  * @author Achim Huegen
26  */

27 public class ExtensionDefinitionImpl implements ExtensionDefinition
28 {
29     private Location _location;
30     private ModuleDefinition _module;
31
32     public ExtensionDefinitionImpl(ModuleDefinition module)
33     {
34         Defense.notNull(module, "module");
35         _module = module;
36     }
37
38     public ExtensionDefinitionImpl(ModuleDefinition module, Location location)
39     {
40         this(module);
41         _location = location;
42     }
43
44     /**
45      * @see org.apache.hivemind.definition.ExtensionDefinition#getModuleId()
46      */

47     public String JavaDoc getModuleId()
48     {
49         return _module.getId();
50     }
51
52     /**
53      * @see org.apache.hivemind.definition.ExtensionDefinition#getModule()
54      */

55     public ModuleDefinition getModule()
56     {
57         return _module;
58     }
59
60     /**
61      * @see org.apache.hivemind.definition.ExtensionDefinition#getLocation()
62      */

63     public Location getLocation()
64     {
65         return _location;
66     }
67
68     /**
69      * Sets the location of the extension.
70      */

71     public void setLocation(Location location)
72     {
73         _location = location;
74     }
75
76 }
77
Popular Tags