01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.plugin.manifest;
18:
19: import java.io.File;
20: import java.net.MalformedURLException;
21: import java.net.URL;
22: import java.util.ArrayList;
23: import java.util.List;
24: import java.util.Map;
25: import java.util.Properties;
26:
27: import org.kuali.rice.config.BaseConfig;
28: import org.kuali.rice.config.Config;
29:
30: /**
31: * Class representing a plugin's manifest, containing configuration
32: * settings parsed from the manifest.
33: *
34: * @see Config
35: *
36: * @author ewestfal
37: */
38: public class PluginManifest extends BaseConfig {
39:
40: private String resourceLoaderClassname;
41: private List listeners = new ArrayList();
42: private Properties parentProperties;
43: private Map parentObjects;
44:
45: public PluginManifest(URL url, Config parentConfig) {
46: super (url.toString());
47: this .parentProperties = parentConfig.getProperties();
48: this .parentObjects = parentConfig.getObjects();
49: }
50:
51: public PluginManifest(File manifestFile, Config parentConfig)
52: throws MalformedURLException {
53: this (manifestFile.toURL(), parentConfig);
54: }
55:
56: public Properties getBaseProperties() {
57: return this .parentProperties;
58: }
59:
60: public Map getBaseObjects() {
61: return this .parentObjects;
62: }
63:
64: public void addListener(String listenerClass) {
65: listeners.add(listenerClass);
66: }
67:
68: public List getListeners() {
69: return listeners;
70: }
71:
72: public void setResourceLoaderClassname(
73: String resourceLoaderClassname) {
74: this .resourceLoaderClassname = resourceLoaderClassname;
75: }
76:
77: public String getResourceLoaderClassname() {
78: return resourceLoaderClassname;
79: }
80:
81: public String toString() {
82: return "[PluginManifest: resourceLoaderClassname: "
83: + getResourceLoaderClassname() + "]";
84: }
85: }
|