01: // ResourceHelperFactory.java
02: // $Id: ResourceHelperFactory.java,v 1.8 2000/08/16 21:37:27 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1997.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigadm.editors;
07:
08: import org.w3c.jigadm.PropertyManager;
09: import org.w3c.jigadm.RemoteResourceWrapper;
10:
11: public class ResourceHelperFactory {
12:
13: public static synchronized ResourceHelper[] getHelpers(
14: RemoteResourceWrapper rrw) {
15: PropertyManager pm = PropertyManager.getPropertyManager();
16: String classes[] = pm.getHelperClasses(rrw);
17: ResourceHelper helpers[] = null;
18:
19: if (classes != null) {
20: // Create the helpers (skip impedance mismatch):
21: helpers = new ResourceHelper[classes.length];
22: if (helpers.length == 0)
23: return null;
24: for (int i = 0; i < classes.length; i++) {
25: try {
26: Class c = Class.forName(classes[i]);
27: helpers[i] = (ResourceHelper) c.newInstance();
28: } catch (Exception ex) {
29: // FIXME: should have an object to report that to...
30: System.out.println("cannot create helper: \""
31: + classes[i] + " for \"" + rrw);
32: }
33: }
34: }
35: return helpers;
36: }
37:
38: }
|