private void printURIParams(String uri, PrintWriter writer) { String replacedCurlyURI = PathHelper.replaceEnclosedCurlyBraces(uri); Matcher matcher = PathHelper.URI_PARAM_PATTERN.matcher(replacedCurlyURI); int i = 0; while (matcher.find()) { if (matcher.start() > i) { writer.println(" uri += '" + replacedCurlyURI.substring(i, matcher.start()) + "';"); } String name = matcher.group(1); writer.println(" uri += REST.Encoding.encodePathSegment(params." + name + ");"); i = matcher.end(); } if (i < replacedCurlyURI.length()) writer.println(" uri += '" + replacedCurlyURI.substring(i) + "';"); } }
private void printURIParams(String uri, PrintWriter writer) { String replacedCurlyURI = PathHelper.replaceEnclosedCurlyBraces(uri); Matcher matcher = PathHelper.URI_PARAM_PATTERN.matcher(replacedCurlyURI); int i = 0; while (matcher.find()) { if (matcher.start() > i) { writer.println(" uri += '" + replacedCurlyURI.substring(i, matcher.start()) + "';"); } String name = matcher.group(1); writer.println(" uri += REST.Encoding.encodePathSegment(params." + name + ");"); i = matcher.end(); } if (i < replacedCurlyURI.length()) writer.println(" uri += '" + replacedCurlyURI.substring(i) + "';"); } }