KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > acl > Property


1 package de.webman.acl;
2
3 import com.teamkonzept.lib.TKException;
4 import com.teamkonzept.lib.TKVector;
5 import de.webman.acl.db.PropertyDBData;
6
7 /**
8  * A property holds a configuration value associated to a login.
9  *
10  * @version 1.0
11  * @since 1.0
12  * @author © 2001 Webman AG
13  */

14 public class Property
15     extends WMObject
16 {
17
18     // $Header: /cvsroot/webman-cms/source/webman/de/webman/acl/Property.java,v 1.1 2001/08/20 08:25:07 mischa Exp $
19

20     // Attributes
21

22     /**
23      * The login of the property.
24      */

25     private Integer JavaDoc login = null;
26
27     /**
28      * The name of the property.
29      */

30     private String JavaDoc name = null;
31
32     /**
33      * The value of the property.
34      */

35     private String JavaDoc value = null;
36
37
38     // Constructors
39

40     /**
41      * Provide instantion only to package classes or subclasses.
42      *
43      * @param data the initial property data.
44      */

45     protected Property (PropertyDBData data)
46     {
47         super(data);
48
49         this.login = data.getLogin();
50         this.name = data.getName();
51         this.value = data.getValue();
52     }
53
54
55     // Method implementations
56

57     /**
58      * Returns the factory of the object.
59      *
60      * @return the factory of the object.
61      * @exception com.teamkonzept.lib.TKException if an error occured during factory retrieval.
62      */

63     public final ObjectFactory getFactory ()
64         throws TKException
65     {
66         return PropertyFactory.getInstance();
67     }
68
69     /**
70      * Returns the name of the property.
71      *
72      * @return the name of the property.
73      */

74     public final String JavaDoc getName ()
75     {
76         return name;
77     }
78
79     /**
80      * Assigns the name of the property.
81      *
82      * @param name the name of the property.
83      */

84     public final void setName (String JavaDoc name)
85     {
86         super.modifyAttribute(this.name, name);
87         this.name = name;
88     }
89
90     /**
91      * Returns the value of the property.
92      *
93      * @return the value of the property.
94      */

95     public final String JavaDoc getValue ()
96     {
97         return value;
98     }
99
100     /**
101      * Assigns the value of the property.
102      *
103      * @param value the value of the property.
104      */

105     public final void setValue (String JavaDoc value)
106     {
107         super.modifyAttribute(this.value, value);
108         this.value = value;
109     }
110
111     /**
112      * Returns the ID of the login of the property.
113      *
114      * @return the ID of the login of the property.
115      */

116     public final Integer JavaDoc getLoginID ()
117     {
118         return login;
119     }
120
121     /**
122      * Returns the login of the property.
123      *
124      * @return the login of the property.
125      * @exception com.teamkonzept.lib.TKException if an error occured during login retrieval.
126      */

127     public final Login getLogin ()
128         throws TKException
129     {
130         return login != null
131                        ? (Login) LoginFactory.getInstance().getObject(login)
132                        : null;
133     }
134
135 }
136
Popular Tags