|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| package org.apache.tapestry.spec; |
|
16 |
| |
|
17 |
| import java.util.Collection; |
|
18 |
| import java.util.Collections; |
|
19 |
| import java.util.HashMap; |
|
20 |
| import java.util.Map; |
|
21 |
| |
|
22 |
| |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| public class ContainedComponent extends LocatablePropertyHolder implements IContainedComponent |
|
30 |
| { |
|
31 |
| private String type; |
|
32 |
| |
|
33 |
| private String copyOf; |
|
34 |
| |
|
35 |
| private boolean inheritInformalParameters; |
|
36 |
| |
|
37 |
| protected Map bindings; |
|
38 |
| |
|
39 |
| private static final int MAP_SIZE = 3; |
|
40 |
| |
|
41 |
| |
|
42 |
| private String _propertyName; |
|
43 |
| |
|
44 |
| |
|
45 |
| |
|
46 |
| |
|
47 |
| |
|
48 |
1356
| public IBindingSpecification getBinding(String name)
|
|
49 |
| { |
|
50 |
1356
| if (bindings == null)
|
|
51 |
0
| return null;
|
|
52 |
| |
|
53 |
1356
| return (IBindingSpecification) bindings.get(name);
|
|
54 |
| } |
|
55 |
| |
|
56 |
| |
|
57 |
| |
|
58 |
| |
|
59 |
| |
|
60 |
| |
|
61 |
993
| public Collection getBindingNames()
|
|
62 |
| { |
|
63 |
993
| if (bindings == null)
|
|
64 |
153
| return Collections.EMPTY_LIST;
|
|
65 |
| |
|
66 |
840
| return Collections.unmodifiableCollection(bindings.keySet());
|
|
67 |
| } |
|
68 |
| |
|
69 |
1011
| public String getType()
|
|
70 |
| { |
|
71 |
1011
| return type;
|
|
72 |
| } |
|
73 |
| |
|
74 |
981
| public void setBinding(String name, IBindingSpecification spec)
|
|
75 |
| { |
|
76 |
981
| if (bindings == null)
|
|
77 |
633
| bindings = new HashMap(MAP_SIZE);
|
|
78 |
| |
|
79 |
981
| bindings.put(name, spec);
|
|
80 |
| } |
|
81 |
| |
|
82 |
2433
| public void setType(String value)
|
|
83 |
| { |
|
84 |
2433
| type = value;
|
|
85 |
| } |
|
86 |
| |
|
87 |
| |
|
88 |
| |
|
89 |
| |
|
90 |
| |
|
91 |
| |
|
92 |
| |
|
93 |
747
| public void setCopyOf(String id)
|
|
94 |
| { |
|
95 |
747
| copyOf = id;
|
|
96 |
| } |
|
97 |
| |
|
98 |
| |
|
99 |
| |
|
100 |
| |
|
101 |
| |
|
102 |
| |
|
103 |
| |
|
104 |
0
| public String getCopyOf()
|
|
105 |
| { |
|
106 |
0
| return copyOf;
|
|
107 |
| } |
|
108 |
| |
|
109 |
| |
|
110 |
| |
|
111 |
| |
|
112 |
| |
|
113 |
| |
|
114 |
999
| public boolean getInheritInformalParameters()
|
|
115 |
| { |
|
116 |
999
| return inheritInformalParameters;
|
|
117 |
| } |
|
118 |
| |
|
119 |
| |
|
120 |
| |
|
121 |
| |
|
122 |
| |
|
123 |
| |
|
124 |
747
| public void setInheritInformalParameters(boolean value)
|
|
125 |
| { |
|
126 |
747
| inheritInformalParameters = value;
|
|
127 |
| } |
|
128 |
| |
|
129 |
| |
|
130 |
1458
| public String getPropertyName()
|
|
131 |
| { |
|
132 |
1458
| return _propertyName;
|
|
133 |
| } |
|
134 |
| |
|
135 |
| |
|
136 |
756
| public void setPropertyName(String propertyName)
|
|
137 |
| { |
|
138 |
756
| _propertyName = propertyName;
|
|
139 |
| } |
|
140 |
| } |