/** * Sets the {@code rel} attribute for this element. * * <p>If this is a {@code link}} element, and {@code href} has been set from a {@link SafeUrl}, * then {@code value} has to be an allowed value. See {@link #setHref(SafeHtml)}. * * @throws IllegalArgumentException if this is a {@code link} element and this value of {@code * rel} is not allowed */ public SafeHtmlBuilder setRel(String value) { checkLinkDependentAttributes(value, hrefValueContract); return setAttribute("rel", value); }
/** * Appends the given {@code htmls} as this element's content, in sequence. * * @throws IllegalStateException if this builder represents a void element */ public SafeHtmlBuilder appendContent(SafeHtml... htmls) { checkNotVoidElement(); Collections.addAll(contents, htmls); return this; }
/** Sets the {@code maxlength} attribute for this element. */ public SafeHtmlBuilder setMaxlength(String value) { return setAttribute("maxlength", value); }
/** * HTML-escapes and appends {@code text} to this element's content. * * @throws IllegalStateException if this builder represents a void element */ public SafeHtmlBuilder escapeAndAppendContent(String text) { // htmlEscape() unicode coerces in non-portable version. return appendContent(SafeHtmls.htmlEscape(text)); }
/** Sets the {@code placeholder} attribute for this element. */ public SafeHtmlBuilder setPlaceholder(String value) { return setAttribute("placeholder", value); }
/** Sets the {@code rows} attribute for this element. */ public SafeHtmlBuilder setRows(String value) { return setAttribute("rows", value); }
checkLinkDependentAttributes(attributes.get("rel"), AttributeContract.SAFE_URL); return setAttribute("href", value.getSafeUrlString());
/** * Appends the given {@code htmls} as this element's content, in the sequence the Iterable returns * them. * * @throws IllegalStateException if this builder represents a void element */ public SafeHtmlBuilder appendContent(Iterable<SafeHtml> htmls) { checkNotVoidElement(); for (SafeHtml html : htmls) { contents.add(html); } return this; }
/** Sets the {@code translate} attribute for this element. */ public SafeHtmlBuilder setTranslate(String value) { return setAttribute("translate", value); }
/** * Appends the given {@code htmls} as this element's content, in the sequence the Iterator returns * them. * * @throws IllegalStateException if this builder represents a void element */ public SafeHtmlBuilder appendContent(Iterator<SafeHtml> htmls) { checkNotVoidElement(); while (htmls.hasNext()) { contents.add(htmls.next()); } return this; }
/** Sets the {@code alt} attribute for this element. */ public SafeHtmlBuilder setAlt(String value) { return setAttribute("alt", value); }
/** Sets the {@code autofocus} attribute for this element. */ public SafeHtmlBuilder setAutofocus(String value) { return setAttribute("autofocus", value); }
/** Sets the {@code border} attribute for this element. */ public SafeHtmlBuilder setBorder(String value) { return setAttribute("border", value); }
/** Sets the {@code cols} attribute for this element. */ public SafeHtmlBuilder setCols(String value) { return setAttribute("cols", value); }
/** Sets the {@code disabled} attribute for this element. */ public SafeHtmlBuilder setDisabled(String value) { return setAttribute("disabled", value); }
/** Sets the {@code multiple} attribute for this element. */ public SafeHtmlBuilder setMultiple(String value) { return setAttribute("multiple", value); }
/** Sets the {@code value} attribute for this element. */ public SafeHtmlBuilder setValue(String value) { return setAttribute("value", value); }
/** Sets the {@code wrap} attribute for this element. */ public SafeHtmlBuilder setWrap(String value) { return setAttribute("wrap", value); }
/** Sets the {@code autocomplete} attribute for this element. */ public SafeHtmlBuilder setAutocomplete(String value) { return setAttribute("autocomplete", value); }
/** Sets the {@code checked} attribute for this element. */ public SafeHtmlBuilder setChecked(String value) { return setAttribute("checked", value); }