1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.tiles.request.mustache;
18
19 import java.util.Collections;
20 import java.util.Enumeration;
21 import java.util.Map;
22 import java.util.Set;
23
24 import org.apache.tiles.request.attribute.AttributeExtractor;
25
26
27 public final class MustacheScopeExtractor implements AttributeExtractor {
28 private final Map<String,Object> scope;
29
30 public MustacheScopeExtractor(Map<String,Object> scope) {
31 this.scope = scope;
32 }
33
34 @Override
35 public void removeValue(String key) {
36 scope.remove(key);
37 }
38
39 @Override
40 public Enumeration<String> getKeys() {
41 return (Enumeration<String>) Collections.enumeration((Set<?>)scope.keySet());
42 }
43
44 @Override
45 public Object getValue(String key) {
46 return scope.get(key);
47 }
48
49 @Override
50 public void setValue(String key, Object value) {
51 scope.put(key, value);
52 }
53 }