1 package org.andromda.core.configuration;
2
3 import java.io.Serializable;
4 import org.apache.commons.lang.StringUtils;
5 import org.apache.commons.lang.builder.ToStringBuilder;
6
7 /**
8 * This class represents properties which are used to configure Namespace objects which are made available to configure
9 * Plugin instances.
10 *
11 * @author Chad Brandon
12 * @see org.andromda.core.configuration.Namespace
13 * @see org.andromda.core.configuration.Namespaces
14 */
15 public class Property
16 implements Serializable
17 {
18 private static final long serialVersionUID = 34L;
19
20 /**
21 * The property name.
22 */
23 private String name;
24
25 /**
26 * Returns the name. This is used by Namespaces to find this property.
27 *
28 * @return String
29 */
30 public String getName()
31 {
32 return name;
33 }
34
35 /**
36 * Sets the name.
37 *
38 * @param name The name to set
39 */
40 public void setName(final String name)
41 {
42 this.name = StringUtils.trimToEmpty(name);
43 }
44
45 /**
46 * The property value.
47 */
48 private String value;
49
50 /**
51 * Returns the value. This is the value that is stored in this property.
52 *
53 * @return the value as a String
54 */
55 public String getValue()
56 {
57 return value;
58 }
59
60 /**
61 * Sets the value.
62 *
63 * @param value The value to set
64 */
65 public void setValue(final String value)
66 {
67 this.value = StringUtils.trimToEmpty(value);
68 }
69
70 /**
71 * Stores whether or not this property should be ignored.
72 */
73 private boolean ignore = false;
74
75 /**
76 * If a property is set to ignore then Namespaces will ignore it if it doesn't exist on lookup (otherwise errors
77 * messages are output). This is useful if you have a plugin on a classpath (its unavoidable), but you don't want to
78 * see the errors messages (since it really isn't an error). Another use of it would be to ignore outlet entires for
79 * cartridges if you wanted to generate some from the cartridge outlets, but not others.
80 *
81 * @return Returns the ignore value true/false.
82 */
83 public boolean isIgnore()
84 {
85 return ignore;
86 }
87
88 /**
89 * @param ignore The ignore to set.
90 * @see #isIgnore()
91 */
92 public void setIgnore(final boolean ignore)
93 {
94 this.ignore = ignore;
95 }
96
97 /**
98 * @see Object#toString()
99 */
100 public String toString()
101 {
102 return ToStringBuilder.reflectionToString(this);
103 }
104 }