protected String resolveExpression(Expression expression, Map<String, ?> variables) {
    String resolved = null;
    Object value = variables.get(expression.getName());
    if (value != null) {
      String expanded = expression.expand(value, this.encode.isEncodingRequired());
      if (expanded != null) {
        if (!this.encodeSlash) {
          logger.fine("Explicit slash decoding specified, decoding all slashes in uri");
          expanded = expanded.replaceAll("%2F", "/");
        }
        resolved = expanded;
      }
    } else {
      if (this.allowUnresolved) {
        /* unresolved variables are treated as literals */
        resolved = encodeLiteral(expression.toString());
      }
    }
    return resolved;
  }
Expand the template.

@param variables containing the values for expansion.
@return a fully qualified URI with the variables expanded.
core/src/main/java/feign/template/Template.java