001package com.hammurapi.common; 002 003import java.util.Map; 004 005import com.hammurapi.common.TokenExpander.TokenSource; 006 007/** 008 * Implementation of token source with tokens stored 009 * in a map. 010 * @author Pavel Vlasov 011 * 012 */ 013public class MapTokenSource implements TokenSource { 014 015 private Map<String, String> map; 016 017 public MapTokenSource(Map<String, String> map) { 018 this.map = map; 019 } 020 021 public String getToken(String name) { 022 return map.get(name); 023 } 024 025}