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