params.put(parameter.getName(), parameter.get(0));
}
}
//
final RouteMatch match = route.matches(params);
if (match != null) {
return new DispatchBridge() {
public MethodHandle getTarget() {
return target;
}
public Map<String, ResponseParameter> getParameters() {
return parameters;
}
public <T> String checkPropertyValidity(PropertyType<T> propertyType, T propertyValue) {
// For now we don't validate anything
return null;
}
public void renderURL(PropertyMap properties, MimeType mimeType, Appendable appendable) throws IOException {
// Render base URL
http.renderRequestURL(appendable);
// Render path
UriBuilder writer = new UriBuilder(appendable, mimeType);
match.render(writer);
// Retain matched parameters for filtering later
Set<String> matched = match.getMatched().isEmpty() ? Collections.<String>emptySet() : new HashSet<String>(match.getMatched().size());
for (PathParam param : match.getMatched().keySet()) {
matched.add(param.getName());
}
// Render remaining parameters which have not been rendered yet
for (ResponseParameter parameter : parameters.values()) {