Source code: com/aendvari/cerberus/component/descriptor/ComponentProperty.java
1 /*
2 * ComponentProperty.java
3 *
4 * Copyright (c) 2001, 2002 Aendvari, Ltd. All Rights Reserved.
5 *
6 * See the file LICENSE for terms of use.
7 *
8 */
9
10 package com.aendvari.cerberus.component.descriptor;
11
12 /**
13 * <p>Describes a property of a component. All properties are named and have an
14 * optional description.</p>
15 *
16 * @author Trevor Milne
17 *
18 */
19
20 public class ComponentProperty
21 {
22 /** The name of the property. */
23 protected String name;
24
25 /**
26 * The description of the property. The description is for documentation purposes
27 * and is optional.
28 *
29 */
30 protected String description;
31
32 /** The accessibility of the property. Either public or private. */
33 protected int access;
34
35
36 /* Constants. */
37
38
39 /** Constants for the access control of the property. */
40 public interface Access
41 {
42 /** This property has unknown access. */
43 public static int Unknown = 0;
44
45 /** This is a public property. */
46 public static int Public = 1;
47
48 /** This is a private property. */
49 public static int Private = 2;
50 }
51
52
53 /* Constructors. */
54
55
56 /**
57 * Constructs a <code>ComponentProperty</code> instance.
58 *
59 */
60
61 public ComponentProperty()
62 {
63 name = null;
64 description = null;
65 access = Access.Unknown;
66 }
67
68 /**
69 * Constructs a <code>ComponentProperty</code> instance as a copy of the one supplied.
70 *
71 * @param property The <code>ComponentProperty</code> to copy.
72 *
73 */
74
75 public ComponentProperty(ComponentProperty property)
76 {
77 name = property.getName();
78 description = property.getDescription();
79 access = property.getAccess();
80 }
81
82
83 /* Accessors. */
84
85
86 /* Name. */
87
88 /**
89 * Sets the name of this property.
90 *
91 * @param setName The property's name.
92 *
93 */
94
95 public void setName(String setName)
96 {
97 name = setName;
98 }
99
100 /**
101 * Returns the name of this property.
102 *
103 * @return The name of this property.
104 *
105 */
106
107 public String getName()
108 {
109 return name;
110 }
111
112 /* Description. */
113
114 /**
115 * Sets the description of this property.
116 *
117 * @param setDescription The property's description.
118 *
119 */
120
121 public void setDescription(String setDescription)
122 {
123 description = setDescription;
124 }
125
126 /**
127 * Returns the description of this property.
128 *
129 * @return The description of this property.
130 *
131 */
132
133 public String getDescription()
134 {
135 return description;
136 }
137
138 /* Access. */
139
140 /**
141 * Sets the access control of this property.
142 *
143 * @param setAccess The property's access type.
144 *
145 */
146
147 public void setAccess(int setAccess)
148 {
149 access = setAccess;
150 }
151
152 /**
153 * Returns the access control of this property.
154 *
155 * @return The access type of this property. See {@link Access}
156 *
157 */
158
159 public int getAccess()
160 {
161 return access;
162 }
163 }
164