public void setOpenSearchUrlAdapter(OpenSearchUrlAdapter openSearchUrlAdapter) {
this.openSearchUrlAdapter = openSearchUrlAdapter;
}
public Url asUrlElement(RequestContext request) {
Url element = new Url(request.getAbdera());
element.setType(ATOM_CONTENT_TYPE);
StringBuilder template = new StringBuilder();
template.append(this.getTemplateUrl(request));
if (this.searchParameters != null) {
template.append("?");
for (int i = 0; i < this.searchParameters.length; i++) {
OpenSearchUrlParameterInfo param = this.searchParameters[i];
template.append(param.getName()).append("=").append("{").append(param.getValue());
if (param.isOptional()) {
template.append("?");
}
template.append("}");
if (i < this.searchParameters.length - 1) {
template.append("&");
}
}
}
element.setTemplate(template.toString());
return element;
}