1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package javax.faces.component;
20
21 import java.io.Serializable;
22 import java.util.Collection;
23 import java.util.Collections;
24 import java.util.Map;
25 import java.util.Set;
26
27 class _PassThroughAttributesMap implements Map<String, Object>, Serializable
28 {
29 private static final long serialVersionUID = -9106932179394257866L;
30
31 private UIComponentBase _component;
32
33 _PassThroughAttributesMap(UIComponentBase component)
34 {
35 _component = component;
36 }
37
38
39
40
41
42
43
44
45 Map<String, Object> getUnderlyingMap()
46 {
47 StateHelper stateHelper = _component.getStateHelper(false);
48 Map<String, Object> attributes = null;
49 if (stateHelper != null)
50 {
51 attributes = (Map<String, Object>) stateHelper.get(UIComponentBase.PropertyKeys.passThroughAttributesMap);
52 }
53 return attributes == null ? Collections.EMPTY_MAP : attributes;
54 }
55
56 @Override
57 public boolean equals(Object obj)
58 {
59 return getUnderlyingMap().equals(obj);
60 }
61
62 @Override
63 public int hashCode()
64 {
65 return getUnderlyingMap().hashCode();
66 }
67
68 public int size()
69 {
70 return getUnderlyingMap().size();
71 }
72
73 public boolean isEmpty()
74 {
75 return getUnderlyingMap().isEmpty();
76 }
77
78 public boolean containsKey(Object key)
79 {
80 return getUnderlyingMap().containsKey(key);
81 }
82
83 public boolean containsValue(Object value)
84 {
85 return getUnderlyingMap().containsValue(value);
86 }
87
88 public Object get(Object key)
89 {
90 return getUnderlyingMap().get(key);
91 }
92
93 public Object put(String key, Object value)
94 {
95 return _component.getStateHelper().put(
96 UIComponentBase.PropertyKeys.passThroughAttributesMap, key, value);
97 }
98
99 public Object remove(Object key)
100 {
101 return _component.getStateHelper().remove(
102 UIComponentBase.PropertyKeys.passThroughAttributesMap, key);
103 }
104
105
106
107
108 public void putAll(Map<? extends String, ?> t)
109 {
110 for (Map.Entry<? extends String, ?> entry : t.entrySet())
111 {
112 put(entry.getKey(), entry.getValue());
113 }
114 }
115
116
117
118
119
120 public Set<Map.Entry<String, Object>> entrySet()
121 {
122 return getUnderlyingMap().entrySet();
123 }
124
125 public Set<String> keySet()
126 {
127 return getUnderlyingMap().keySet();
128 }
129
130 public void clear()
131 {
132 getUnderlyingMap().clear();
133 }
134
135 public Collection<Object> values()
136 {
137 return getUnderlyingMap().values();
138 }
139 }