01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Library License version 1 published by ozone-db.org.
03: //
04: // The original code and portions created by SMB are
05: // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
06: //
07: // $Id: DxClassLoader.java,v 1.1 2001/12/18 10:31:30 per_nyfelt Exp $
08:
09: package org.ozoneDB.DxLib;
10:
11: /**
12: */
13: class DxClass extends DxObject {
14: final static long serialVersionUID = 1L;
15:
16: Class clazz;
17: DxString name;
18:
19: DxClass(DxString clazzName) throws ClassNotFoundException {
20: name = clazzName;
21: clazz = Class.forName(clazzName.toString());
22: }
23:
24: Class clazz() {
25: return clazz;
26: }
27:
28: DxString name() {
29: return name;
30: }
31: }
32:
33: /**
34: *
35: *
36: * @author <a href="http://www.softwarebuero.de/">SMB</a>
37: * @version $Revision: 1.1 $Date: 2001/12/18 10:31:30 $
38: */
39: public class DxClassLoader extends Object {
40: static DxMap clazzes = new DxHashMap();
41:
42: public DxClassLoader() {
43: }
44:
45: public static Class classForName(String name)
46: throws ClassNotFoundException {
47: return classForName(new DxString(name));
48: }
49:
50: public static Class classForName(DxString name)
51: throws ClassNotFoundException {
52: DxClass c = (DxClass) clazzes.elementForKey(name);
53: if (c == null) {
54: c = new DxClass(name);
55: clazzes.addForKey(c, c.name());
56: }
57:
58: return c.clazz();
59: }
60:
61: public static void registerClass(DxString fileName) {
62: }
63: }
|