1/*2 * Copyright 2012 Apache Software Foundation.3 *4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 *8 * http://www.apache.org/licenses/LICENSE-2.09 *10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617package org.apache.tiles.request.mustache;
1819import java.util.Collections;
20import java.util.Enumeration;
21import java.util.Map;
22import java.util.Set;
2324import org.apache.tiles.request.attribute.AttributeExtractor;
252627publicfinalclassMustacheScopeExtractorimplements AttributeExtractor {
28privatefinal Map<String,Object> scope;
2930publicMustacheScopeExtractor(Map<String,Object> scope) {
31this.scope = scope;
32 }
3334 @Override
35publicvoid removeValue(String key) {
36 scope.remove(key);
37 }
3839 @Override
40public Enumeration<String> getKeys() {
41return (Enumeration<String>) Collections.enumeration((Set<?>)scope.keySet());
42 }
4344 @Override
45public Object getValue(String key) {
46return scope.get(key);
47 }
4849 @Override
50publicvoid setValue(String key, Object value) {
51 scope.put(key, value);
52 }
53 }