code: public Object retraceVariable(String variable, int lineNumber, int startPosition) {
      if (StringUtils.isBlank(variable)) {
        return "";
      }
      Variable var = new Variable(this, variable);
      String varName = var.getName();
      Object obj = context.get(varName);
      if (obj != null) {
        if (obj instanceof DeferredValue) {
          throw new DeferredValueException(variable, lineNumber, startPosition);
        }
        obj = var.resolve(obj);
      } else  if (getConfig().isFailOnUnknownTokens()) {
        throw new UnknownTokenException(variable, lineNumber, startPosition);
      }
      return obj;
    }
docs: Resolve a variable from the interpreter context, returning null if not found. This method updates the template error accumulators when a variable is not found.
  
  @param variable
  name of variable in context
  @param lineNumber
  current line number, for error reporting
  @param startPosition
  current line position, for error reporting
  @return resolved value for variable