KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > core > xml > ObjElement


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Core License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: ObjElement.java,v 1.2 2002/08/27 08:32:26 per_nyfelt Exp $
8

9 package org.ozoneDB.core.xml;
10
11 import org.xml.sax.*;
12
13 /**
14  * This class saves all attributes of the objElement.
15  *
16  * @version $Revision: 1.2 $
17  * @author <a HREF="http://www.softwarebuero.de">SMB</a>
18  */

19 public class ObjElement implements Consts {
20
21     //
22
// member
23
//
24

25     /**
26      * The type of the obj.
27      */

28     private String JavaDoc className;
29
30     /**
31      * The id of the obj.
32      */

33     private String JavaDoc id;
34
35     /**
36      * The object!!
37      */

38     private Object JavaDoc obj;
39
40     /**
41      * The name of the OzoneObject (if the object is an OzoneObject).
42      */

43     private String JavaDoc ozoneObjectName;
44
45     /**
46      * The id of the OzoneObject (if the object is an OzoneObject).
47      */

48     private String JavaDoc ozoneObjectId;
49
50     //
51
// construcor
52
//
53

54     /**
55      */

56     public ObjElement () {
57     }
58
59     /**
60      * The constructor creates a new instance of the obj with this className.
61      *
62      * @param atts (the attributes)
63      */

64     public ObjElement (Attributes atts)
65     throws ClassNotFoundException JavaDoc, InstantiationException JavaDoc, IllegalAccessException JavaDoc {
66
67         className = atts.getValue(ATTR_TYPE);
68         id = atts.getValue(ATTR_ID);
69
70         ozoneObjectName = atts.getValue(OzoneObjAttsFactory.ATTR_OBJNAME);
71         ozoneObjectId = atts.getValue(OzoneObjAttsFactory.ATTR_OBJID);
72
73         Class JavaDoc objClass = Thread.currentThread().getContextClassLoader().loadClass(className);
74         obj = objClass.newInstance();
75
76     }
77
78     //
79
// methods
80
//
81

82     /**
83      */

84     public String JavaDoc getClassName() {
85         return className;
86     }
87
88     /**
89      */

90     public String JavaDoc getId() {
91         return id;
92     }
93
94     /**
95      */

96     public Object JavaDoc getObject() {
97         return obj;
98     }
99
100     /**
101      */

102     public Object JavaDoc getOzoneObjectName() {
103         return ozoneObjectName;
104     }
105
106     /**
107      */

108     public Object JavaDoc getOzoneObjectId() {
109         return ozoneObjectId;
110     }
111
112     /**
113      */

114     public String JavaDoc toString() {
115         return ("ObjElement: " + className);
116     }
117 }
118
119
Popular Tags