1 package org.andromda.core.namespace;
2
3 /**
4 * Represents a property definition.
5 *
6 * @author Chad Brandon
7 */
8 public class PropertyDefinition
9 {
10 private String name;
11
12 /**
13 * Gets the name of this property definition.
14 *
15 * @return Returns the name.
16 */
17 public String getName()
18 {
19 return name;
20 }
21
22 /**
23 * Sets the name of this property definition.
24 *
25 * @param name The name to set.
26 */
27 public void setName(final String name)
28 {
29 this.name = name;
30 }
31
32 /**
33 * Stores the default value.
34 */
35 private String defaultValue;
36
37 /**
38 * Gets the default for this property definition.
39 *
40 * @return Returns the defaultValue.
41 */
42 public String getDefaultValue()
43 {
44 return this.defaultValue;
45 }
46
47 /**
48 * Sets the default for the property definition.
49 *
50 * @param defaultValue The defaultValue to set.
51 */
52 public void setDefaultValue(final String defaultValue)
53 {
54 this.defaultValue = defaultValue;
55 }
56
57 /**
58 * The flag indicating whether or not this property is required.
59 */
60 private boolean required = true;
61
62 /**
63 * Sets this property is required, by default
64 * this flag is <code>true</code>.
65 *
66 * @param required true/false
67 */
68 public void setRequired(final boolean required)
69 {
70 this.required = required;
71 }
72
73 /**
74 * Indicates of this property is required, by default
75 * this flag is <code>true</code>.
76 *
77 * @return true/false
78 */
79 public boolean isRequired()
80 {
81 return this.required;
82 }
83 }