1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.jelly.impl;
17
18 import org.apache.commons.jelly.expression.Expression;
19
20 /***
21 * Represents the attribute definition used by dynamic tags, such as whether the attribute is required
22 * or any default values etc.
23 *
24 * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
25 * @version $Revision: 155420 $
26 */
27 public class Attribute {
28
29 /*** the name of the attribute */
30 private String name;
31
32 /*** the default value expression */
33 private Expression defaultValue;
34
35 /*** whether this attribute is required */
36 private boolean required;
37
38 public Attribute() {
39 }
40
41
42
43
44 /***
45 * Returns whether this attribute is required.
46 * @return boolean
47 */
48 public boolean isRequired() {
49 return required;
50 }
51
52 /***
53 * Sets whether this attribute is required.
54 * @param required is true if this attribute is a mandatory attribute
55 */
56 public void setRequired(boolean required) {
57 this.required = required;
58 }
59
60 /***
61 * Returns the name.
62 * @return String
63 */
64 public String getName() {
65 return name;
66 }
67
68 /***
69 * Sets the name.
70 * @param name The name to set
71 */
72 public void setName(String name) {
73 this.name = name;
74 }
75
76 /***
77 * Returns the defaultValue.
78 * @return Expression
79 */
80 public Expression getDefaultValue() {
81 return defaultValue;
82 }
83
84 /***
85 * Sets the defaultValue.
86 * @param defaultValue The defaultValue to set
87 */
88 public void setDefaultValue(Expression defaultValue) {
89 this.defaultValue = defaultValue;
90 }
91
92 }