KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > api > plugin > PluginMetadata


1 // The contents of this file are subject to the Mozilla Public License Version
2
// 1.1
3
//(the "License"); you may not use this file except in compliance with the
4
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
5
//
6
//Software distributed under the License is distributed on an "AS IS" basis,
7
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
8
//for the specific language governing rights and
9
//limitations under the License.
10
//
11
//The Original Code is "The Columba Project"
12
//
13
//The Initial Developers of the Original Code are Frederik Dietz and Timo
14
// Stich.
15
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
16
//
17
//All Rights Reserved.
18
package org.columba.api.plugin;
19
20 import java.io.File JavaDoc;
21 import java.util.Enumeration JavaDoc;
22 import java.util.Vector JavaDoc;
23
24 public class PluginMetadata {
25
26     private String JavaDoc id;
27
28     private String JavaDoc name;
29
30     private String JavaDoc description;
31
32     private String JavaDoc version;
33
34     private String JavaDoc category;
35
36     private boolean enabled;
37
38     private Vector JavaDoc extensions = new Vector JavaDoc();
39
40     private File JavaDoc directory;
41
42     public PluginMetadata(String JavaDoc id, String JavaDoc name, boolean enabled) {
43         this.id = id;
44         this.name = name;
45         this.enabled = enabled;
46     }
47
48     public PluginMetadata(String JavaDoc id, String JavaDoc name, String JavaDoc description,
49             String JavaDoc version, String JavaDoc category, boolean enabled) {
50         this(id, name, enabled);
51
52         this.description = description;
53         this.version = version;
54         this.category = category;
55
56     }
57
58     public void addExtension(ExtensionMetadata metadata) {
59         extensions.add(metadata);
60     }
61
62     public Enumeration JavaDoc enumExtensions() {
63         return extensions.elements();
64     }
65
66     /**
67      * @return Returns the category.
68      */

69     public String JavaDoc getCategory() {
70         return category;
71     }
72
73     /**
74      * @return Returns the description.
75      */

76     public String JavaDoc getDescription() {
77         return description;
78     }
79
80     /**
81      * @return Returns the directory.
82      */

83     public File JavaDoc getDirectory() {
84         return directory;
85     }
86
87     /**
88      * @return Returns the enabled.
89      */

90     public boolean isEnabled() {
91         return enabled;
92     }
93
94     /**
95      * @return Returns the extensions.
96      */

97     public Vector JavaDoc getExtensions() {
98         return extensions;
99     }
100
101     /**
102      * @return Returns the id.
103      */

104     public String JavaDoc getId() {
105         return id;
106     }
107
108     /**
109      * @return Returns the name.
110      */

111     public String JavaDoc getName() {
112         return name;
113     }
114
115     /**
116      * @return Returns the version.
117      */

118     public String JavaDoc getVersion() {
119         return version;
120     }
121
122     /**
123      * @param enabled
124      * The enabled to set.
125      */

126     public void setEnabled(boolean enabled) {
127         this.enabled = enabled;
128     }
129
130     /**
131      * @param directory
132      * The directory to set.
133      */

134     public void setDirectory(File JavaDoc directory) {
135         this.directory = directory;
136     }
137
138 }
139
Popular Tags