Implementation of Attributes-per-Tag via Interfaces (#156)

This commit is contained in:
pointbazaar
2020-08-31 16:24:00 +02:00
committed by GitHub
parent f091000bbe
commit 312cabe69c
249 changed files with 4608 additions and 2549 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -114,6 +114,7 @@ public abstract class Attr {
public static final String VALUE = "value";
public static final String WIDTH = "width";
public static final String WRAP = "wrap";
public static final String TRANSLATE = "translate";
public static ShortForm shortFormFromAttrsString(String attrs) {
if (!attrs.contains(".") && !attrs.contains(("#"))) {

View File

@@ -6,7 +6,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
public class ContainerTag extends Tag<ContainerTag> {
public class ContainerTag<T extends ContainerTag<T>> extends Tag<T> {
//public class ContainerTag extends Tag<ContainerTag> {
private List<DomContent> children;
@@ -22,15 +23,15 @@ public class ContainerTag extends Tag<ContainerTag> {
* @param child DomContent-object to be appended
* @return itself for easy chaining
*/
public ContainerTag with(DomContent child) {
public T with(DomContent child) {
if (this == child) {
throw new RuntimeException("Cannot append a tag to itself.");
}
if (child == null) {
return this; // in some cases, like when using iff(), we ignore null children
return (T)this; // in some cases, like when using iff(), we ignore null children
}
children.add(child);
return this;
return (T)this;
}
@@ -42,8 +43,8 @@ public class ContainerTag extends Tag<ContainerTag> {
* @param child DomContent-object to be appended if condition met
* @return itself for easy chaining
*/
public ContainerTag condWith(boolean condition, DomContent child) {
return condition ? this.with(child) : this;
public T condWith(boolean condition, DomContent child) {
return condition ? this.with(child) : (T)this;
}
@@ -53,13 +54,13 @@ public class ContainerTag extends Tag<ContainerTag> {
* @param children DomContent-objects to be appended
* @return itself for easy chaining
*/
public ContainerTag with(Iterable<? extends DomContent> children) {
public T with(Iterable<? extends DomContent> children) {
if (children != null) {
for (DomContent child : children) {
this.with(child);
}
}
return this;
return (T)this;
}
@@ -71,8 +72,8 @@ public class ContainerTag extends Tag<ContainerTag> {
* @param children DomContent-objects to be appended if condition met
* @return itself for easy chaining
*/
public ContainerTag condWith(boolean condition, Iterable<? extends DomContent> children) {
return condition ? this.with(children) : this;
public T condWith(boolean condition, Iterable<? extends DomContent> children) {
return condition ? this.with(children) : (T)this;
}
@@ -82,11 +83,11 @@ public class ContainerTag extends Tag<ContainerTag> {
* @param children DomContent-objects to be appended
* @return itself for easy chaining
*/
public ContainerTag with(DomContent... children) {
public T with(DomContent... children) {
for (DomContent child : children) {
with(child);
}
return this;
return (T)this;
}
@@ -96,9 +97,9 @@ public class ContainerTag extends Tag<ContainerTag> {
* @param children Stream of DomContent-objects to be appended
* @return itself for easy chaining
*/
public ContainerTag with(Stream<DomContent> children) {
public T with(Stream<DomContent> children) {
children.forEach(this::with);
return this;
return (T)this;
}
@@ -110,8 +111,8 @@ public class ContainerTag extends Tag<ContainerTag> {
* @param children DomContent-objects to be appended if condition met
* @return itself for easy chaining
*/
public ContainerTag condWith(boolean condition, DomContent... children) {
return condition ? this.with(children) : this;
public T condWith(boolean condition, DomContent... children) {
return condition ? this.with(children) : (T)this;
}
@@ -121,7 +122,7 @@ public class ContainerTag extends Tag<ContainerTag> {
* @param text the text to be appended
* @return itself for easy chaining
*/
public ContainerTag withText(String text) {
public T withText(String text) {
return with(new Text(text));
}

View File

@@ -4,7 +4,8 @@ import j2html.Config;
import j2html.attributes.Attribute;
import java.io.IOException;
public class EmptyTag extends Tag<EmptyTag> {
public class EmptyTag<T extends EmptyTag<T>> extends Tag<T> {
//public class EmptyTag extends Tag<EmptyTag> {
public EmptyTag(String tagName) {
super(tagName);

View File

@@ -157,203 +157,82 @@ public abstract class Tag<T extends Tag<T>> extends DomContent {
return attr(Attr.CLASS, sb.toString().trim());
}
public T isAutoComplete() {
return attr(Attr.AUTOCOMPLETE, null);
}
/*
Tag.java contains all Global Attributes, Attributes which are
valid on all HTML Tags. Reference:
https://www.w3schools.com/tags/ref_standardattributes.asp
Attributes:
public T isAutoFocus() {
return attr(Attr.AUTOFOCUS, null);
}
accesskey
class
contenteditable
data-*
dir
draggable
hidden
id
lang
spellcheck
style
tabindex
title
translate
*/
public T isHidden() {
return attr(Attr.HIDDEN, null);
}
public T withAccesskey(String accesskey){ return attr(Attr.ACCESSKEY, accesskey); }
public T isRequired() {
return attr(Attr.REQUIRED, null);
}
public T withClass(String className) { return attr(Attr.CLASS, className); }
public T withAlt(String alt) {
return attr(Attr.ALT, alt);
}
public T isContenteditable(){ return attr(Attr.CONTENTEDITABLE, "true"); }
public T withAction(String action) {
return attr(Attr.ACTION, action);
}
public T withData(String dataAttr, String value) { return attr(Attr.DATA + "-" + dataAttr, value); }
public T withCharset(String charset) {
return attr(Attr.CHARSET, charset);
}
public T withDir(String dir) { return attr(Attr.DIR, dir); }
public T withClass(String className) {
return attr(Attr.CLASS, className);
}
public T isDraggable(){ return attr(Attr.DRAGGABLE, "true"); }
public T withContent(String content) {
return attr(Attr.CONTENT, content);
}
public T isHidden() { return attr(Attr.HIDDEN, null); }
public T withDir(String dir) {
return attr(Attr.DIR, dir);
}
public T withId(String id) { return attr(Attr.ID, id); }
public T withHref(String href) {
return attr(Attr.HREF, href);
}
public T withLang(String lang) { return attr(Attr.LANG, lang); }
public T withId(String id) {
return attr(Attr.ID, id);
}
public T isSpellcheck(){ return attr(Attr.SPELLCHECK, "true"); }
public T withData(String dataAttr, String value) {
return attr(Attr.DATA + "-" + dataAttr, value);
}
public T withStyle(String style) { return attr(Attr.STYLE, style); }
public T withLang(String lang) {
return attr(Attr.LANG, lang);
}
public T withTabindex(int index){ return attr(Attr.TABINDEX, index); }
public T withMethod(String method) {
return attr(Attr.METHOD, method);
}
public T withTitle(String title) { return attr(Attr.TITLE, title); }
public T withName(String name) {
return attr(Attr.NAME, name);
}
public T isTranslate(){ return attr(Attr.TRANSLATE, "yes"); }
public T withPlaceholder(String placeholder) {
return attr(Attr.PLACEHOLDER, placeholder);
}
// ----- start of withCond$ATTR variants -----
public T withCondAccessKey(boolean condition, String accesskey){ return condAttr(condition, Attr.ACCESSKEY, accesskey); }
public T withTarget(String target) {
return attr(Attr.TARGET, target);
}
public T withCondClass(boolean condition, String className) { return condAttr(condition, Attr.CLASS, className); }
public T withTitle(String title) {
return attr(Attr.TITLE, title);
}
public T withCondContenteditable(boolean condition){ return attr(Attr.CONTENTEDITABLE, (condition)?"true":"false");}
public T withType(String type) {
return attr(Attr.TYPE, type);
}
public T withCondData(boolean condition, String dataAttr, String value) { return condAttr(condition, Attr.DATA + "-" + dataAttr, value); }
public T withRel(String rel) {
return attr(Attr.REL, rel);
}
public T withCondDir(boolean condition, String dir) { return condAttr(condition, Attr.DIR, dir); }
public T withRole(String role) {
return attr(Attr.ROLE, role);
}
public T withCondDraggable(boolean condition){ return attr(Attr.DRAGGABLE, (condition)?"true":"false"); }
public T withSrc(String src) {
return attr(Attr.SRC, src);
}
public T withCondHidden(boolean condition) { return condAttr(condition, Attr.HIDDEN, null); }
public T withStyle(String style) {
return attr(Attr.STYLE, style);
}
public T withCondId(boolean condition, String id) { return condAttr(condition, Attr.ID, id); }
public T withStep(String step) {
return attr(Attr.STEP, step);
}
public T withCondLang(boolean condition, String lang) { return condAttr(condition, Attr.LANG, lang); }
public T withValue(String value) {
return attr(Attr.VALUE, value);
}
public T withCondSpellcheck(boolean condition){ return attr(Attr.SPELLCHECK, (condition)?"true":"false"); }
public T withCondAutoComplete(boolean condition) {
return condAttr(condition, Attr.AUTOCOMPLETE, null);
}
public T withCondStyle(boolean condition, String style) { return condAttr(condition, Attr.STYLE, style); }
public T withCondAutoFocus(boolean condition) {
return condAttr(condition, Attr.AUTOFOCUS, null);
}
public T withCondTabindex(boolean condition, int index){ return condAttr(condition, Attr.TABINDEX, index+""); }
public T withCondHidden(boolean condition) {
return condAttr(condition, Attr.HIDDEN, null);
}
public T withCondTitle(boolean condition, String title) { return condAttr(condition, Attr.TITLE, title); }
public T withCondRequired(boolean condition) {
return condAttr(condition, Attr.REQUIRED, null);
}
public T withCondAlt(boolean condition, String alt) {
return condAttr(condition, Attr.ALT, alt);
}
public T withCondAction(boolean condition, String action) {
return condAttr(condition, Attr.ACTION, action);
}
public T withCharset(boolean condition, String charset) {
return condAttr(condition, Attr.CHARSET, charset);
}
public T withCondClass(boolean condition, String className) {
return condAttr(condition, Attr.CLASS, className);
}
public T withCondContent(boolean condition, String content) {
return condAttr(condition, Attr.CONTENT, content);
}
public T withCondDir(boolean condition, String dir) {
return condAttr(condition, Attr.DIR, dir);
}
public T withCondHref(boolean condition, String href) {
return condAttr(condition, Attr.HREF, href);
}
public T withCondId(boolean condition, String id) {
return condAttr(condition, Attr.ID, id);
}
public T withCondData(boolean condition, String dataAttr, String value) {
return condAttr(condition, Attr.DATA + "-" + dataAttr, value);
}
public T withCondLang(boolean condition, String lang) {
return condAttr(condition, Attr.LANG, lang);
}
public T withCondMethod(boolean condition, String method) {
return condAttr(condition, Attr.METHOD, method);
}
public T withCondName(boolean condition, String name) {
return condAttr(condition, Attr.NAME, name);
}
public T withCondPlaceholder(boolean condition, String placeholder) {
return condAttr(condition, Attr.PLACEHOLDER, placeholder);
}
public T withCondTarget(boolean condition, String target) {
return condAttr(condition, Attr.TARGET, target);
}
public T withCondTitle(boolean condition, String title) {
return condAttr(condition, Attr.TITLE, title);
}
public T withCondType(boolean condition, String type) {
return condAttr(condition, Attr.TYPE, type);
}
public T withCondRel(boolean condition, String rel) {
return condAttr(condition, Attr.REL, rel);
}
public T withCondSrc(boolean condition, String src) {
return condAttr(condition, Attr.SRC, src);
}
public T withCondStyle(boolean condition, String style) {
return condAttr(condition, Attr.STYLE, style);
}
public T withCondValue(boolean condition, String value) {
return condAttr(condition, Attr.VALUE, value);
}
public T withCondTranslate(boolean condition){ return attr(Attr.TRANSLATE, (condition)?"yes":"no"); }
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IAccept<T extends Tag> extends IInstance<T> {
default T withAccept(final String accept_) {
get().attr("accept", accept_);
return get();
}
default T withCondAccept(final boolean enable, final String accept_) {
if (enable) {
get().attr("accept", accept_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IAction<T extends Tag> extends IInstance<T> {
default T withAction(final String action_) {
get().attr("action", action_);
return get();
}
default T withCondAction(final boolean enable, final String action_) {
if (enable) {
get().attr("action", action_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IAlt<T extends Tag> extends IInstance<T> {
default T withAlt(final String alt_) {
get().attr("alt", alt_);
return get();
}
default T withCondAlt(final boolean enable, final String alt_) {
if (enable) {
get().attr("alt", alt_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IAsync<T extends Tag> extends IInstance<T> {
default T isAsync() {
get().attr("async");
return get();
}
default T withCondAsync(final boolean enable) {
if (enable) {
get().attr("async");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IAutocomplete<T extends Tag> extends IInstance<T> {
default T isAutocomplete() {
get().attr("autocomplete", "on");
return get();
}
default T withCondAutocomplete(final boolean enable) {
if (enable) {
get().attr("autocomplete", "on");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IAutofocus<T extends Tag> extends IInstance<T> {
default T isAutofocus() {
get().attr("autofocus");
return get();
}
default T withCondAutofocus(final boolean enable) {
if (enable) {
get().attr("autofocus");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IAutoplay<T extends Tag> extends IInstance<T> {
default T isAutoplay() {
get().attr("autoplay");
return get();
}
default T withCondAutoplay(final boolean enable) {
if (enable) {
get().attr("autoplay");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface ICharset<T extends Tag> extends IInstance<T> {
default T withCharset(final String charset_) {
get().attr("charset", charset_);
return get();
}
default T withCondCharset(final boolean enable, final String charset_) {
if (enable) {
get().attr("charset", charset_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IChecked<T extends Tag> extends IInstance<T> {
default T isChecked() {
get().attr("checked");
return get();
}
default T withCondChecked(final boolean enable) {
if (enable) {
get().attr("checked");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface ICite<T extends Tag> extends IInstance<T> {
default T withCite(final String cite_) {
get().attr("cite", cite_);
return get();
}
default T withCondCite(final boolean enable, final String cite_) {
if (enable) {
get().attr("cite", cite_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface ICols<T extends Tag> extends IInstance<T> {
default T withCols(final String cols_) {
get().attr("cols", cols_);
return get();
}
default T withCondCols(final boolean enable, final String cols_) {
if (enable) {
get().attr("cols", cols_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IColspan<T extends Tag> extends IInstance<T> {
default T withColspan(final String colspan_) {
get().attr("colspan", colspan_);
return get();
}
default T withCondColspan(final boolean enable, final String colspan_) {
if (enable) {
get().attr("colspan", colspan_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IContent<T extends Tag> extends IInstance<T> {
default T withContent(final String content_) {
get().attr("content", content_);
return get();
}
default T withCondContent(final boolean enable, final String content_) {
if (enable) {
get().attr("content", content_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IControls<T extends Tag> extends IInstance<T> {
default T isControls() {
get().attr("controls");
return get();
}
default T withCondControls(final boolean enable) {
if (enable) {
get().attr("controls");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface ICoords<T extends Tag> extends IInstance<T> {
default T withCoords(final String coords_) {
get().attr("coords", coords_);
return get();
}
default T withCondCoords(final boolean enable, final String coords_) {
if (enable) {
get().attr("coords", coords_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IData<T extends Tag> extends IInstance<T> {
default T withData(final String data_) {
get().attr("data", data_);
return get();
}
default T withCondData(final boolean enable, final String data_) {
if (enable) {
get().attr("data", data_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IDatetime<T extends Tag> extends IInstance<T> {
default T withDatetime(final String datetime_) {
get().attr("datetime", datetime_);
return get();
}
default T withCondDatetime(final boolean enable, final String datetime_) {
if (enable) {
get().attr("datetime", datetime_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IDefault<T extends Tag> extends IInstance<T> {
default T isDefault() {
get().attr("default");
return get();
}
default T withCondDefault(final boolean enable) {
if (enable) {
get().attr("default");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IDefer<T extends Tag> extends IInstance<T> {
default T isDefer() {
get().attr("defer");
return get();
}
default T withCondDefer(final boolean enable) {
if (enable) {
get().attr("defer");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IDirname<T extends Tag> extends IInstance<T> {
default T withDirname(final String dirname_) {
get().attr("dirname", dirname_);
return get();
}
default T withCondDirname(final boolean enable, final String dirname_) {
if (enable) {
get().attr("dirname", dirname_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IDisabled<T extends Tag> extends IInstance<T> {
default T isDisabled() {
get().attr("disabled");
return get();
}
default T withCondDisabled(final boolean enable) {
if (enable) {
get().attr("disabled");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IDownload<T extends Tag> extends IInstance<T> {
default T isDownload() {
get().attr("download");
return get();
}
default T withCondDownload(final boolean enable) {
if (enable) {
get().attr("download");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IEnctype<T extends Tag> extends IInstance<T> {
default T withEnctype(final String enctype_) {
get().attr("enctype", enctype_);
return get();
}
default T withCondEnctype(final boolean enable, final String enctype_) {
if (enable) {
get().attr("enctype", enctype_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IFor<T extends Tag> extends IInstance<T> {
default T withFor(final String for_) {
get().attr("for", for_);
return get();
}
default T withCondFor(final boolean enable, final String for_) {
if (enable) {
get().attr("for", for_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IForm<T extends Tag> extends IInstance<T> {
default T withForm(final String form_) {
get().attr("form", form_);
return get();
}
default T withCondForm(final boolean enable, final String form_) {
if (enable) {
get().attr("form", form_);
}
return get();
}
}

View File

@@ -0,0 +1,12 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IFormAction<T extends Tag> extends IInstance<T> {
default T withFormAction(String formAction) {
get().attr("formaction", formAction);
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IFormaction<T extends Tag> extends IInstance<T> {
default T withFormaction(final String formaction_) {
get().attr("formaction", formaction_);
return get();
}
default T withCondFormaction(final boolean enable, final String formaction_) {
if (enable) {
get().attr("formaction", formaction_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IHeaders<T extends Tag> extends IInstance<T> {
default T withHeaders(final String headers_) {
get().attr("headers", headers_);
return get();
}
default T withCondHeaders(final boolean enable, final String headers_) {
if (enable) {
get().attr("headers", headers_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IHeight<T extends Tag> extends IInstance<T> {
default T withHeight(final String height_) {
get().attr("height", height_);
return get();
}
default T withCondHeight(final boolean enable, final String height_) {
if (enable) {
get().attr("height", height_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IHigh<T extends Tag> extends IInstance<T> {
default T withHigh(final String high_) {
get().attr("high", high_);
return get();
}
default T withCondHigh(final boolean enable, final String high_) {
if (enable) {
get().attr("high", high_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IHref<T extends Tag> extends IInstance<T> {
default T withHref(final String href_) {
get().attr("href", href_);
return get();
}
default T withCondHref(final boolean enable, final String href_) {
if (enable) {
get().attr("href", href_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IHreflang<T extends Tag> extends IInstance<T> {
default T withHreflang(final String hreflang_) {
get().attr("hreflang", hreflang_);
return get();
}
default T withCondHreflang(final boolean enable, final String hreflang_) {
if (enable) {
get().attr("hreflang", hreflang_);
}
return get();
}
}

View File

@@ -0,0 +1,19 @@
package j2html.tags.attributes;
public interface IInstance<T> {
//to get the actual instance
// (every implementing class would have to implement: { return this; }
// public T get();
// this method shows up in autocomplete.
// this is really undesireable as it does not do anything.
default T get() {
//we know that the implementing class will supply
//its own type as the type argument.
//therefore every instance of IInstance can assume it
//is also of type T
return (T) this;
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IIsmap<T extends Tag> extends IInstance<T> {
default T isIsmap() {
get().attr("ismap");
return get();
}
default T withCondIsmap(final boolean enable) {
if (enable) {
get().attr("ismap");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IKind<T extends Tag> extends IInstance<T> {
default T withKind(final String kind_) {
get().attr("kind", kind_);
return get();
}
default T withCondKind(final boolean enable, final String kind_) {
if (enable) {
get().attr("kind", kind_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface ILabel<T extends Tag> extends IInstance<T> {
default T withLabel(final String label_) {
get().attr("label", label_);
return get();
}
default T withCondLabel(final boolean enable, final String label_) {
if (enable) {
get().attr("label", label_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IList<T extends Tag> extends IInstance<T> {
default T withList(final String list_) {
get().attr("list", list_);
return get();
}
default T withCondList(final boolean enable, final String list_) {
if (enable) {
get().attr("list", list_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface ILoop<T extends Tag> extends IInstance<T> {
default T isLoop() {
get().attr("loop");
return get();
}
default T withCondLoop(final boolean enable) {
if (enable) {
get().attr("loop");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface ILow<T extends Tag> extends IInstance<T> {
default T withLow(final String low_) {
get().attr("low", low_);
return get();
}
default T withCondLow(final boolean enable, final String low_) {
if (enable) {
get().attr("low", low_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IMax<T extends Tag> extends IInstance<T> {
default T withMax(final String max_) {
get().attr("max", max_);
return get();
}
default T withCondMax(final boolean enable, final String max_) {
if (enable) {
get().attr("max", max_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IMaxlength<T extends Tag> extends IInstance<T> {
default T withMaxlength(final String maxlength_) {
get().attr("maxlength", maxlength_);
return get();
}
default T withCondMaxlength(final boolean enable, final String maxlength_) {
if (enable) {
get().attr("maxlength", maxlength_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IMedia<T extends Tag> extends IInstance<T> {
default T withMedia(final String media_) {
get().attr("media", media_);
return get();
}
default T withCondMedia(final boolean enable, final String media_) {
if (enable) {
get().attr("media", media_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IMethod<T extends Tag> extends IInstance<T> {
default T withMethod(final String method_) {
get().attr("method", method_);
return get();
}
default T withCondMethod(final boolean enable, final String method_) {
if (enable) {
get().attr("method", method_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IMin<T extends Tag> extends IInstance<T> {
default T withMin(final String min_) {
get().attr("min", min_);
return get();
}
default T withCondMin(final boolean enable, final String min_) {
if (enable) {
get().attr("min", min_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IMultiple<T extends Tag> extends IInstance<T> {
default T isMultiple() {
get().attr("multiple");
return get();
}
default T withCondMultiple(final boolean enable) {
if (enable) {
get().attr("multiple");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IMuted<T extends Tag> extends IInstance<T> {
default T isMuted() {
get().attr("muted");
return get();
}
default T withCondMuted(final boolean enable) {
if (enable) {
get().attr("muted");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IName<T extends Tag> extends IInstance<T> {
default T withName(final String name_) {
get().attr("name", name_);
return get();
}
default T withCondName(final boolean enable, final String name_) {
if (enable) {
get().attr("name", name_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface INovalidate<T extends Tag> extends IInstance<T> {
default T isNovalidate() {
get().attr("novalidate");
return get();
}
default T withCondNovalidate(final boolean enable) {
if (enable) {
get().attr("novalidate");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnabort<T extends Tag> extends IInstance<T> {
default T withOnabort(final String onabort_) {
get().attr("onabort", onabort_);
return get();
}
default T withCondOnabort(final boolean enable, final String onabort_) {
if (enable) {
get().attr("onabort", onabort_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnafterprint<T extends Tag> extends IInstance<T> {
default T withOnafterprint(final String onafterprint_) {
get().attr("onafterprint", onafterprint_);
return get();
}
default T withCondOnafterprint(final boolean enable, final String onafterprint_) {
if (enable) {
get().attr("onafterprint", onafterprint_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnbeforeprint<T extends Tag> extends IInstance<T> {
default T withOnbeforeprint(final String onbeforeprint_) {
get().attr("onbeforeprint", onbeforeprint_);
return get();
}
default T withCondOnbeforeprint(final boolean enable, final String onbeforeprint_) {
if (enable) {
get().attr("onbeforeprint", onbeforeprint_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnbeforeunload<T extends Tag> extends IInstance<T> {
default T withOnbeforeunload(final String onbeforeunload_) {
get().attr("onbeforeunload", onbeforeunload_);
return get();
}
default T withCondOnbeforeunload(final boolean enable, final String onbeforeunload_) {
if (enable) {
get().attr("onbeforeunload", onbeforeunload_);
}
return get();
}
}

View File

@@ -0,0 +1,10 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnblur<T extends Tag> extends IInstance<T> {
default T withOnblur(final String onblur_) {
get().attr("onblur", onblur_);
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOncanplay<T extends Tag> extends IInstance<T> {
default T withOncanplay(final String oncanplay_) {
get().attr("oncanplay", oncanplay_);
return get();
}
default T withCondOncanplay(final boolean enable, final String oncanplay_) {
if (enable) {
get().attr("oncanplay", oncanplay_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOncanplaythrough<T extends Tag> extends IInstance<T> {
default T withOncanplaythrough(final String oncanplaythrough_) {
get().attr("oncanplaythrough", oncanplaythrough_);
return get();
}
default T withCondOncanplaythrough(final boolean enable, final String oncanplaythrough_) {
if (enable) {
get().attr("oncanplaythrough", oncanplaythrough_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOncuechange<T extends Tag> extends IInstance<T> {
default T withOncuechange(final String oncuechange_) {
get().attr("oncuechange", oncuechange_);
return get();
}
default T withCondOncuechange(final boolean enable, final String oncuechange_) {
if (enable) {
get().attr("oncuechange", oncuechange_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOndurationchange<T extends Tag> extends IInstance<T> {
default T withOndurationchange(final String ondurationchange_) {
get().attr("ondurationchange", ondurationchange_);
return get();
}
default T withCondOndurationchange(final boolean enable, final String ondurationchange_) {
if (enable) {
get().attr("ondurationchange", ondurationchange_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnemptied<T extends Tag> extends IInstance<T> {
default T withOnemptied(final String onemptied_) {
get().attr("onemptied", onemptied_);
return get();
}
default T withCondOnemptied(final boolean enable, final String onemptied_) {
if (enable) {
get().attr("onemptied", onemptied_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnended<T extends Tag> extends IInstance<T> {
default T withOnended(final String onended_) {
get().attr("onended", onended_);
return get();
}
default T withCondOnended(final boolean enable, final String onended_) {
if (enable) {
get().attr("onended", onended_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnerror<T extends Tag> extends IInstance<T> {
default T withOnerror(final String onerror_) {
get().attr("onerror", onerror_);
return get();
}
default T withCondOnerror(final boolean enable, final String onerror_) {
if (enable) {
get().attr("onerror", onerror_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnhashchange<T extends Tag> extends IInstance<T> {
default T withOnhashchange(final String onhashchange_) {
get().attr("onhashchange", onhashchange_);
return get();
}
default T withCondOnhashchange(final boolean enable, final String onhashchange_) {
if (enable) {
get().attr("onhashchange", onhashchange_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnload<T extends Tag> extends IInstance<T> {
default T withOnload(final String onload_) {
get().attr("onload", onload_);
return get();
}
default T withCondOnload(final boolean enable, final String onload_) {
if (enable) {
get().attr("onload", onload_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnloadeddata<T extends Tag> extends IInstance<T> {
default T withOnloadeddata(final String onloadeddata_) {
get().attr("onloadeddata", onloadeddata_);
return get();
}
default T withCondOnloadeddata(final boolean enable, final String onloadeddata_) {
if (enable) {
get().attr("onloadeddata", onloadeddata_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnloadedmetadata<T extends Tag> extends IInstance<T> {
default T withOnloadedmetadata(final String onloadedmetadata_) {
get().attr("onloadedmetadata", onloadedmetadata_);
return get();
}
default T withCondOnloadedmetadata(final boolean enable, final String onloadedmetadata_) {
if (enable) {
get().attr("onloadedmetadata", onloadedmetadata_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnloadstart<T extends Tag> extends IInstance<T> {
default T withOnloadstart(final String onloadstart_) {
get().attr("onloadstart", onloadstart_);
return get();
}
default T withCondOnloadstart(final boolean enable, final String onloadstart_) {
if (enable) {
get().attr("onloadstart", onloadstart_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnoffline<T extends Tag> extends IInstance<T> {
default T withOnoffline(final String onoffline_) {
get().attr("onoffline", onoffline_);
return get();
}
default T withCondOnoffline(final boolean enable, final String onoffline_) {
if (enable) {
get().attr("onoffline", onoffline_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnonline<T extends Tag> extends IInstance<T> {
default T withOnonline(final String ononline_) {
get().attr("ononline", ononline_);
return get();
}
default T withCondOnonline(final boolean enable, final String ononline_) {
if (enable) {
get().attr("ononline", ononline_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnpagehide<T extends Tag> extends IInstance<T> {
default T withOnpagehide(final String onpagehide_) {
get().attr("onpagehide", onpagehide_);
return get();
}
default T withCondOnpagehide(final boolean enable, final String onpagehide_) {
if (enable) {
get().attr("onpagehide", onpagehide_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnpageshow<T extends Tag> extends IInstance<T> {
default T withOnpageshow(final String onpageshow_) {
get().attr("onpageshow", onpageshow_);
return get();
}
default T withCondOnpageshow(final boolean enable, final String onpageshow_) {
if (enable) {
get().attr("onpageshow", onpageshow_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnpause<T extends Tag> extends IInstance<T> {
default T withOnpause(final String onpause_) {
get().attr("onpause", onpause_);
return get();
}
default T withCondOnpause(final boolean enable, final String onpause_) {
if (enable) {
get().attr("onpause", onpause_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnplay<T extends Tag> extends IInstance<T> {
default T withOnplay(final String onplay_) {
get().attr("onplay", onplay_);
return get();
}
default T withCondOnplay(final boolean enable, final String onplay_) {
if (enable) {
get().attr("onplay", onplay_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnplaying<T extends Tag> extends IInstance<T> {
default T withOnplaying(final String onplaying_) {
get().attr("onplaying", onplaying_);
return get();
}
default T withCondOnplaying(final boolean enable, final String onplaying_) {
if (enable) {
get().attr("onplaying", onplaying_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnpopstate<T extends Tag> extends IInstance<T> {
default T withOnpopstate(final String onpopstate_) {
get().attr("onpopstate", onpopstate_);
return get();
}
default T withCondOnpopstate(final boolean enable, final String onpopstate_) {
if (enable) {
get().attr("onpopstate", onpopstate_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnprogress<T extends Tag> extends IInstance<T> {
default T withOnprogress(final String onprogress_) {
get().attr("onprogress", onprogress_);
return get();
}
default T withCondOnprogress(final boolean enable, final String onprogress_) {
if (enable) {
get().attr("onprogress", onprogress_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnratechange<T extends Tag> extends IInstance<T> {
default T withOnratechange(final String onratechange_) {
get().attr("onratechange", onratechange_);
return get();
}
default T withCondOnratechange(final boolean enable, final String onratechange_) {
if (enable) {
get().attr("onratechange", onratechange_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnreset<T extends Tag> extends IInstance<T> {
default T withOnreset(final String onreset_) {
get().attr("onreset", onreset_);
return get();
}
default T withCondOnreset(final boolean enable, final String onreset_) {
if (enable) {
get().attr("onreset", onreset_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnresize<T extends Tag> extends IInstance<T> {
default T withOnresize(final String onresize_) {
get().attr("onresize", onresize_);
return get();
}
default T withCondOnresize(final boolean enable, final String onresize_) {
if (enable) {
get().attr("onresize", onresize_);
}
return get();
}
}

View File

@@ -0,0 +1,10 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnscroll<T extends Tag> extends IInstance<T> {
default T withOnscroll(final String onscroll_) {
get().attr("onscroll", onscroll_);
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnsearch<T extends Tag> extends IInstance<T> {
default T withOnsearch(final String onsearch_) {
get().attr("onsearch", onsearch_);
return get();
}
default T withCondOnsearch(final boolean enable, final String onsearch_) {
if (enable) {
get().attr("onsearch", onsearch_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnseeked<T extends Tag> extends IInstance<T> {
default T withOnseeked(final String onseeked_) {
get().attr("onseeked", onseeked_);
return get();
}
default T withCondOnseeked(final boolean enable, final String onseeked_) {
if (enable) {
get().attr("onseeked", onseeked_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnseeking<T extends Tag> extends IInstance<T> {
default T withOnseeking(final String onseeking_) {
get().attr("onseeking", onseeking_);
return get();
}
default T withCondOnseeking(final boolean enable, final String onseeking_) {
if (enable) {
get().attr("onseeking", onseeking_);
}
return get();
}
}

View File

@@ -0,0 +1,10 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnselect<T extends Tag> extends IInstance<T> {
default T withOnselect(final String onselect_) {
get().attr("onselect", onselect_);
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnstalled<T extends Tag> extends IInstance<T> {
default T withOnstalled(final String onstalled_) {
get().attr("onstalled", onstalled_);
return get();
}
default T withCondOnstalled(final boolean enable, final String onstalled_) {
if (enable) {
get().attr("onstalled", onstalled_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnstorage<T extends Tag> extends IInstance<T> {
default T withOnstorage(final String onstorage_) {
get().attr("onstorage", onstorage_);
return get();
}
default T withCondOnstorage(final boolean enable, final String onstorage_) {
if (enable) {
get().attr("onstorage", onstorage_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnsubmit<T extends Tag> extends IInstance<T> {
default T withOnsubmit(final String onsubmit_) {
get().attr("onsubmit", onsubmit_);
return get();
}
default T withCondOnsubmit(final boolean enable, final String onsubmit_) {
if (enable) {
get().attr("onsubmit", onsubmit_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnsuspend<T extends Tag> extends IInstance<T> {
default T withOnsuspend(final String onsuspend_) {
get().attr("onsuspend", onsuspend_);
return get();
}
default T withCondOnsuspend(final boolean enable, final String onsuspend_) {
if (enable) {
get().attr("onsuspend", onsuspend_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOntimeupdate<T extends Tag> extends IInstance<T> {
default T withOntimeupdate(final String ontimeupdate_) {
get().attr("ontimeupdate", ontimeupdate_);
return get();
}
default T withCondOntimeupdate(final boolean enable, final String ontimeupdate_) {
if (enable) {
get().attr("ontimeupdate", ontimeupdate_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOntoggle<T extends Tag> extends IInstance<T> {
default T withOntoggle(final String ontoggle_) {
get().attr("ontoggle", ontoggle_);
return get();
}
default T withCondOntoggle(final boolean enable, final String ontoggle_) {
if (enable) {
get().attr("ontoggle", ontoggle_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnunload<T extends Tag> extends IInstance<T> {
default T withOnunload(final String onunload_) {
get().attr("onunload", onunload_);
return get();
}
default T withCondOnunload(final boolean enable, final String onunload_) {
if (enable) {
get().attr("onunload", onunload_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnvolumechanged<T extends Tag> extends IInstance<T> {
default T withOnvolumechanged(final String onvolumechanged_) {
get().attr("onvolumechanged", onvolumechanged_);
return get();
}
default T withCondOnvolumechanged(final boolean enable, final String onvolumechanged_) {
if (enable) {
get().attr("onvolumechanged", onvolumechanged_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnwaiting<T extends Tag> extends IInstance<T> {
default T withOnwaiting(final String onwaiting_) {
get().attr("onwaiting", onwaiting_);
return get();
}
default T withCondOnwaiting(final boolean enable, final String onwaiting_) {
if (enable) {
get().attr("onwaiting", onwaiting_);
}
return get();
}
}

View File

@@ -0,0 +1,10 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOnwheel<T extends Tag> extends IInstance<T> {
default T withOnwheel(final String onwheel_) {
get().attr("onwheel", onwheel_);
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOpen<T extends Tag> extends IInstance<T> {
default T isOpen() {
get().attr("open");
return get();
}
default T withCondOpen(final boolean enable) {
if (enable) {
get().attr("open");
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IOptimum<T extends Tag> extends IInstance<T> {
default T withOptimum(final String optimum_) {
get().attr("optimum", optimum_);
return get();
}
default T withCondOptimum(final boolean enable, final String optimum_) {
if (enable) {
get().attr("optimum", optimum_);
}
return get();
}
}

View File

@@ -0,0 +1,17 @@
package j2html.tags.attributes;
import j2html.tags.Tag;
public interface IPattern<T extends Tag> extends IInstance<T> {
default T withPattern(final String pattern_) {
get().attr("pattern", pattern_);
return get();
}
default T withCondPattern(final boolean enable, final String pattern_) {
if (enable) {
get().attr("pattern", pattern_);
}
return get();
}
}

Some files were not shown because too many files have changed in this diff Show More