1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.apache.struts.tiles;
23
24 /**
25 * Common implementation of attribute definition.
26 */
27 public class UntypedAttribute implements AttributeDefinition {
28
29 /**
30 * Role associated to this attribute.
31 */
32 protected String role = null;
33
34 protected Object value=null;
35
36 /**
37 * Constructor.
38 * @param value Object to store.
39 */
40 public UntypedAttribute(Object value) {
41 this.value = value;
42 }
43
44 /**
45 * Constructor.
46 * @param value Object to store.
47 * @param role Asociated role.
48 */
49 public UntypedAttribute(Object value, String role) {
50 this.value = value;
51 this.role = role;
52 }
53
54 /**
55 * Get role.
56 */
57 public String getRole() {
58 return role;
59 }
60
61 /**
62 * Set role.
63 * @param role Associated role.
64 */
65 public void setRole(String role) {
66 this.role = role;
67 }
68
69 /**
70 * Get value.
71 */
72 public Object getValue() {
73 return value;
74 }
75
76 /**
77 * Set value.
78 * @param value New value.
79 */
80 public void setValue(Object value) {
81 this.value = value;
82 }
83
84 /**
85 * Get String representation of this object.
86 */
87 public String toString() {
88 return value.toString();
89 }
90
91 }