private void appendLinkWithoutActionDescriptor(Link link) throws IOException { if (link.isTemplated()) { // TODO ensure that template expansion takes place for base uri Link expanded = link.expand(); // remove query variables beginForm(OptionalAttributes.attr("action", expanded.getHref()) .and("method", "GET")); List<TemplateVariable> variables = link.getVariables(); for (TemplateVariable variable : variables) { String variableName = variable.getName(); String label = variable.hasDescription() ? variable.getDescription() : variableName; writeLabelWithDoc(label, variableName, null); // no documentation url input(variableName, Type.TEXT); } } else { String rel = link.getRel(); String title = (rel != null ? rel : link.getHref()); // TODO: write html <link> instead of anchor <a> here? writeAnchor(OptionalAttributes.attr("href", link.getHref()) .and("rel", link.getRel()), title); } }
private void appendLinkWithoutActionDescriptor(Link link) throws IOException { if (link.isTemplated()) { // TODO ensure that template expansion takes place for base uri Link expanded = link.expand(); // remove query variables beginForm(OptionalAttributes.attr("action", expanded.getHref()) .and("method", "GET")); List<TemplateVariable> variables = link.getVariables(); for (TemplateVariable variable : variables) { String variableName = variable.getName(); String label = variable.hasDescription() ? variable.getDescription() : variableName; writeLabelWithDoc(label, variableName, null); // no documentation url input(variableName, Type.TEXT); } } else { String rel = link.getRel(); String title = (rel != null ? rel : link.getHref()); // TODO: write html <link> instead of anchor <a> here? writeAnchor(OptionalAttributes.attr("href", link.getHref()) .and("rel", link.getRel()), title); } }