class FromEnvironment extends ResolverImp {

  @Override
  public String resolve(String s) {
    if (s == null) {
      return null;
    }
    String result = s;
    log.trace("Resolving {} from environment variables", s);
    Matcher m = resolverPattern.matcher(s);
    while (m.matches()) {
      String key = m.group(1);
      log.trace("Resolve on {} ", key);
      String envValue = resolve(key, System.getenv());
      String toReplace = "%env{" + key + "}";
      result = result.replace(toReplace, envValue);
      m = resolverPattern.matcher(result);
    }
    return result;
  }

  public  FromEnvironment();

}