View Javadoc

1   /***
2   *
3   * The owl-s matcher software is subject to the GNU Lesser General
4   * Public License Version 2.1 (the "License"). You may not copy or use this
5   * file, in either source code or executable form, except in compliance
6   * with the License. You may obtain a copy of the License at
7   * http://www.fsf.org/licenses/lgpl.txt or http://www.opensource.org/.
8   *
9   * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied without
11  * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  * PURPOSE. See the License for the specific language governing rights and
13  * limitations under the License.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this distribution; if not, write to the
17  *
18  * Free Software Foundation, Inc.,
19  * 59 Temple Place, Suite 330,
20  * Boston, MA  02111-1307 USA
21  *
22  * Copyright (C) 2003-2004
23  * TU Berlin, FG IVS
24  * Stefan Tang,
25  * Christoph Liebetruth,
26  * Michael C. Jaeger, 
27  *
28  * More information available at http://ivs.tu-berlin.de/
29  *
30  * $Id$
31  *
32  */
33  package de.tuberlin.ivs.owl.matching.config;
34  
35  import java.util.Vector;
36  
37  /***
38   * Represents the configuration of the matching algorithm.
39   *
40   * @author Stefan Tang (steftang@stanford.edu)
41   * @version 1.1
42   */
43  public class Configuration {
44    /***
45     * The list that contains all loaded plug-ins.
46     */
47    private Vector plugIns;
48  
49    /***
50     * Default constructor.
51     */
52    public Configuration() {
53    }
54  
55    /***
56     * Returns the list of all plug-ins.
57     * @return A vector containing all plug-ins where each element is of type
58     * de.tuberlin.ivs.owl.matching.config.PlugInConfiguration.
59     */
60    public Vector getPlugIns() {
61      return plugIns;
62    }
63  
64    /***
65     * Adds a plug-in to the plug-in list.
66     * @param plugIn The new plug-in to add.
67     */
68    public void addPlugIn(PlugInConfiguration plugIn) {
69      if (plugIns==null) {
70        plugIns = new Vector();
71      }
72      plugIns.addElement(plugIn);
73    }
74  
75    /***
76     * Determines if a given plug-in is active.
77     * @param plugInName The full name of the plug-in, including package path.
78     * @return True if the plug-in is active, false otherwise.
79     */
80    public boolean isActivePlugIn(String plugInName) {
81      if (plugIns==null) {
82        return false;
83      }
84      for (int i=0; i<plugIns.size(); i++) {
85        PlugInConfiguration plugIn = (PlugInConfiguration)plugIns.elementAt(i);
86        if (plugIn.getClassName().equals(plugInName) && plugIn.isActive()) {
87          return true;
88        }
89      }
90      return false;
91    }
92  
93  }