code: public UrlPatternRegexpBox toRegexp(Method executeMethod, String urlPattern, List<Class<?>> pathParamTypeList,
              Map<Integer, Class<?>> optionalGenericTypeMap) {
          final StringBuilder sb = new StringBuilder(32);
          final char[] chars = urlPattern.toCharArray();
          final int length = chars.length;
          List<String> varList = null;
          int parameterIndex = -1;
          int index = -1;
          for (int i = 0; i < length; i++) {
              final char currentChar = chars[i];
              if (currentChar == '{') { // begin brace
                  index = i;
              } else if (currentChar == '}') { // end brace
                  assertBeginBraceExists(executeMethod, urlPattern, index, i);
                  ++parameterIndex;
                  setupParameterPattern(sb, pathParamTypeList, optionalGenericTypeMap, parameterIndex);
                  final String elementName = urlPattern.substring(index + 1, i);
                  assertNoNameParameter(executeMethod, urlPattern, elementName);
                  if (varList == null) {
                      varList = new ArrayList<String>(4);
                  }
                  varList.add(buildParamName(executeMethod, urlPattern, varList, elementName));
                  index = -1;
              } else if (index < 0) {
                  sb.append(currentChar);
              }
          }
          assertEndBraceExists(executeMethod, urlPattern, index);
          return new UrlPatternRegexpBox(buildRegexpPattern(sb.toString()), varList);
      }
docs: =========