clean up and reformat code, integrate javapoet, lift tests to java modules

This commit is contained in:
Jörg Prante 2024-03-04 22:29:32 +01:00
parent f5d00d8913
commit b2fda364b5
327 changed files with 9031 additions and 2068 deletions

View file

@ -16,14 +16,31 @@ jar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE duplicatesStrategy = DuplicatesStrategy.INCLUDE
} }
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
options.fork = true doFirst {
options.forkOptions.jvmArgs += ['-Duser.language=en','-Duser.country=US'] options.fork = true
options.compilerArgs.add('-Xlint:all') options.forkOptions.jvmArgs += ['-Duser.language=en','-Duser.country=US']
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
options.compilerArgs.add('-Xlint:all')
// enforce presence of module-info.java
options.compilerArgs.add("--module-path")
options.compilerArgs.add(classpath.asPath)
classpath = files()
}
} }
tasks.withType(Javadoc) { tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet') doFirst {
options.encoding = 'UTF-8' options.addStringOption('Xdoclint:none', '-quiet')
options.encoding = 'UTF-8'
}
}
tasks.withType(JavaExec) {
doFirst {
jvmArguments.add("--module-path")
jvmArguments.add(classpath.asPath)
classpath = files()
}
} }

View file

@ -8,17 +8,11 @@ dependencies {
test { test {
useJUnitPlatform() useJUnitPlatform()
failFast = false failFast = false
jvmArgs '--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED', // for mockito
'--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED', jvmArgs '--add-modules=jdk.unsupported',
'--add-exports=java.base/sun.nio.ch=ALL-UNNAMED', '--add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED',
'--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED', '--add-opens=jdk.unsupported/sun.reflect=ALL-UNNAMED'
'--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac=ALL-UNNAMED',
'--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.lang.reflect=ALL-UNNAMED',
'--add-opens=java.base/java.io=ALL-UNNAMED',
'--add-opens=java.base/java.nio=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED'
systemProperty 'java.util.logging.config.file', 'src/test/resources/logging.properties' systemProperty 'java.util.logging.config.file', 'src/test/resources/logging.properties'
testLogging { testLogging {
events 'STARTED', 'PASSED', 'FAILED', 'SKIPPED' events 'STARTED', 'PASSED', 'FAILED', 'SKIPPED'

View file

@ -1,5 +1,16 @@
dependencies { dependencies {
implementation libs.jsoup implementation libs.jsoup
implementation libs.javapoet implementation project(':javapoet')
testImplementation testLibs.mockito.core testImplementation testLibs.mockito.core
} }
def moduleName = 'org.xbib.j2html.codegen.test'
def patchArgs = ['--patch-module', "$moduleName=" + files(sourceSets.test.resources.srcDirs).asPath ]
tasks.named('compileTestJava') {
options.compilerArgs += patchArgs
}
tasks.named('test') {
jvmArgs += patchArgs
}

View file

@ -0,0 +1,7 @@
module org.xbib.j2html.codegen {
requires org.xbib.javapoet;
requires java.compiler;
exports org.xbib.j2html.codegen;
exports org.xbib.j2html.codegen.generators;
exports org.xbib.j2html.codegen.model;
}

View file

@ -1,12 +1,12 @@
package org.xbib.j2html.codegen; package org.xbib.j2html.codegen;
import com.squareup.javapoet.ClassName; import org.xbib.javapoet.ClassName;
import com.squareup.javapoet.JavaFile; import org.xbib.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec; import org.xbib.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName; import org.xbib.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeName; import org.xbib.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec; import org.xbib.javapoet.TypeSpec;
import com.squareup.javapoet.TypeVariableName; import org.xbib.javapoet.TypeVariableName;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.HashMap; import java.util.HashMap;

View file

@ -0,0 +1,12 @@
module org.xbib.j2html.codegen.test {
requires transitive org.junit.jupiter.api;
requires org.jsoup;
requires org.mockito;
requires org.xbib.javapoet;
requires java.compiler;
requires org.xbib.j2html.codegen;
exports org.xbib.j2html.codegen.test;
exports org.xbib.j2html.codegen.test.wattsi;
opens org.xbib.j2html.codegen.test;
opens org.xbib.j2html.codegen.test.wattsi;
}

View file

@ -1,4 +1,4 @@
package org.xbib.j2html.codegen; package org.xbib.j2html.codegen.test;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -6,12 +6,15 @@ import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.xbib.j2html.codegen.Generator;
import org.xbib.j2html.codegen.Model;
import org.xbib.j2html.codegen.Parser;
public class GenerateTest { public class GenerateTest {
@Test @Test
public void generate() throws IOException { public void generate() throws IOException {
try (InputStream inputStream = getClass().getResourceAsStream("/html.model")) { try (InputStream inputStream = getClass().getResourceAsStream("html.model")) {
String definitions = new String(inputStream.readAllBytes()); String definitions = new String(inputStream.readAllBytes());
Model model = new Model(); Model model = new Model();
Parser.parse(definitions, model); Parser.parse(definitions, model);

View file

@ -1,4 +1,4 @@
package org.xbib.j2html.codegen; package org.xbib.j2html.codegen.test;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.mockito.InOrder; import org.mockito.InOrder;

View file

@ -1,4 +1,4 @@
package org.xbib.j2html.codegen.wattsi; package org.xbib.j2html.codegen.test.wattsi;
public interface AttributeDefinition { public interface AttributeDefinition {

View file

@ -1,17 +1,14 @@
package org.xbib.j2html.codegen; package org.xbib.j2html.codegen.test.wattsi;
import org.xbib.j2html.codegen.wattsi.WattsiSource; import java.io.InputStream;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.xbib.j2html.codegen.generators.TagCreatorCodeGenerator; import org.xbib.j2html.codegen.generators.TagCreatorCodeGenerator;
import org.xbib.j2html.codegen.wattsi.ElementDefinition;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -26,8 +23,8 @@ public class CodeGeneratorComplianceTests {
@BeforeAll @BeforeAll
public static void setUp() throws IOException { public static void setUp() throws IOException {
Path source = Paths.get("src","test","resources","2022-01.wattsi"); InputStream inputStream = CodeGeneratorComplianceTests.class.getResourceAsStream("2022-01.wattsi");
Document doc = Jsoup.parse(source.toFile(), "UTF-8", "https://html.spec.whatwg.org/"); Document doc = Jsoup.parse(inputStream, "UTF-8", "https://html.spec.whatwg.org/");
specification = new WattsiSource(doc); specification = new WattsiSource(doc);
} }

View file

@ -1,4 +1,4 @@
package org.xbib.j2html.codegen.wattsi; package org.xbib.j2html.codegen.test.wattsi;
public interface ElementDefinition { public interface ElementDefinition {

View file

@ -1,8 +1,8 @@
package org.xbib.j2html.codegen.wattsi; package org.xbib.j2html.codegen.test.wattsi;
import com.squareup.javapoet.ClassName; import org.xbib.javapoet.ClassName;
import com.squareup.javapoet.MethodSpec; import org.xbib.javapoet.MethodSpec;
import com.squareup.javapoet.TypeSpec; import org.xbib.javapoet.TypeSpec;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
@ -21,7 +21,7 @@ public class WattsiGenerator {
List<AttributeDefinition> attributes = wattsi.attributeDefinitions(); List<AttributeDefinition> attributes = wattsi.attributeDefinitions();
for (ElementDefinition element : elements) { for (ElementDefinition element : elements) {
ClassName className = ClassName.get( ClassName className = ClassName.get(
"com.j2html", "org.xbib.j2html",
capitalize(element.name()) + "Tag" capitalize(element.name()) + "Tag"
); );
TypeSpec.Builder type = TypeSpec.classBuilder(className) TypeSpec.Builder type = TypeSpec.classBuilder(className)

View file

@ -1,4 +1,4 @@
package org.xbib.j2html.codegen.wattsi; package org.xbib.j2html.codegen.test.wattsi;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;

View file

@ -3,3 +3,14 @@ dependencies {
testImplementation testLibs.velocity testImplementation testLibs.velocity
testImplementation testLibs.junit.benchmarks testImplementation testLibs.junit.benchmarks
} }
def moduleName = 'org.xbib.j2html.test'
def patchArgs = ['--patch-module', "$moduleName=" + files(sourceSets.test.resources.srcDirs).asPath ]
tasks.named('compileTestJava') {
options.compilerArgs += patchArgs
}
tasks.named('test') {
jvmArgs += patchArgs
}

View file

@ -1,5 +1,6 @@
package org.xbib.j2html; package org.xbib.j2html;
import java.util.Collections;
import org.xbib.j2html.utils.CSSMin; import org.xbib.j2html.utils.CSSMin;
import org.xbib.j2html.utils.EscapeUtil; import org.xbib.j2html.utils.EscapeUtil;
import org.xbib.j2html.utils.Indenter; import org.xbib.j2html.utils.Indenter;
@ -7,8 +8,6 @@ import org.xbib.j2html.utils.JSMin;
import org.xbib.j2html.utils.Minifier; import org.xbib.j2html.utils.Minifier;
import org.xbib.j2html.utils.TextEscaper; import org.xbib.j2html.utils.TextEscaper;
import java.util.Collections;
public class Config { public class Config {
/** /**
@ -51,11 +50,11 @@ public class Config {
private Config( private Config(
TextEscaper _textEscaper, TextEscaper _textEscaper,
Minifier _cssMinifier, Minifier _cssMinifier,
Minifier _jsMinifier, Minifier _jsMinifier,
boolean _closeEmptyTags, boolean _closeEmptyTags,
Indenter _indenter Indenter _indenter
) { ) {
this._textEscaper = _textEscaper; this._textEscaper = _textEscaper;
this._cssMinifier = _cssMinifier; this._cssMinifier = _cssMinifier;
@ -97,42 +96,42 @@ public class Config {
return _indenter; return _indenter;
} }
public Config withTextEscaper(TextEscaper textEscaper){ public Config withTextEscaper(TextEscaper textEscaper) {
Config copy = new Config(this); Config copy = new Config(this);
copy._textEscaper = textEscaper; copy._textEscaper = textEscaper;
return copy; return copy;
} }
public Config withCssMinifier(Minifier cssMinifier){ public Config withCssMinifier(Minifier cssMinifier) {
Config copy = new Config(this); Config copy = new Config(this);
copy._cssMinifier = cssMinifier; copy._cssMinifier = cssMinifier;
return copy; return copy;
} }
public Config withJsMinifier(Minifier jsMinifier){ public Config withJsMinifier(Minifier jsMinifier) {
Config copy = new Config(this); Config copy = new Config(this);
copy._jsMinifier = jsMinifier; copy._jsMinifier = jsMinifier;
return copy; return copy;
} }
public Config withEmptyTagsClosed(boolean closeEmptyTags){ public Config withEmptyTagsClosed(boolean closeEmptyTags) {
Config copy = new Config(this); Config copy = new Config(this);
copy._closeEmptyTags = closeEmptyTags; copy._closeEmptyTags = closeEmptyTags;
return copy; return copy;
} }
public Config withIndenter(Indenter indenter){ public Config withIndenter(Indenter indenter) {
Config copy = new Config(this); Config copy = new Config(this);
copy._indenter = indenter; copy._indenter = indenter;
return copy; return copy;
} }
private static final Config DEFAULTS = new Config( private static final Config DEFAULTS = new Config(
EscapeUtil::escape, EscapeUtil::escape,
CSSMin::compressCss, CSSMin::compressCss,
JSMin::compressJs, JSMin::compressJs,
false, false,
(level, text) -> String.join("", Collections.nCopies(level, FOUR_SPACES)) + text (level, text) -> String.join("", Collections.nCopies(level, FOUR_SPACES)) + text
); );
public static Config defaults() { public static Config defaults() {
@ -141,11 +140,11 @@ public class Config {
public static Config global() { public static Config global() {
return new Config( return new Config(
textEscaper, textEscaper,
cssMinifier, cssMinifier,
jsMinifier, jsMinifier,
closeEmptyTags, closeEmptyTags,
indenter indenter
); );
} }

File diff suppressed because it is too large Load diff

View file

@ -1,13 +1,12 @@
package org.xbib.j2html.attributes; package org.xbib.j2html.attributes;
import java.io.IOException;
import org.xbib.j2html.Config; import org.xbib.j2html.Config;
import org.xbib.j2html.rendering.TagBuilder; import org.xbib.j2html.rendering.TagBuilder;
import org.xbib.j2html.tags.Renderable; import org.xbib.j2html.tags.Renderable;
import java.io.IOException;
public class Attribute implements Renderable { public class Attribute implements Renderable {
private String name; private final String name;
private String value; private String value;
public Attribute(String name, String value) { public Attribute(String name, String value) {

View file

@ -1,10 +1,9 @@
package org.xbib.j2html.rendering; package org.xbib.j2html.rendering;
import java.io.IOException;
import org.xbib.j2html.Config; import org.xbib.j2html.Config;
import org.xbib.j2html.utils.TextEscaper; import org.xbib.j2html.utils.TextEscaper;
import java.io.IOException;
/** /**
* Composes HTML without any extra line breaks or indentation. * Composes HTML without any extra line breaks or indentation.
* *
@ -50,6 +49,7 @@ public class FlatHtml<T extends Appendable> implements HtmlBuilder<T> {
/** /**
* Returns an HtmlBuilder that will generate flat HTML in memory * Returns an HtmlBuilder that will generate flat HTML in memory
* using the given Config. * using the given Config.
*
* @param config The Config which will specify text escapement, tag closing, etc. * @param config The Config which will specify text escapement, tag closing, etc.
* @return An HtmlBuilder for flat HTML. * @return An HtmlBuilder for flat HTML.
*/ */
@ -135,10 +135,10 @@ public class FlatHtml<T extends Appendable> implements HtmlBuilder<T> {
@Override @Override
public TagBuilder appendAttribute(String name, String value) throws IOException { public TagBuilder appendAttribute(String name, String value) throws IOException {
out.append(" ") out.append(" ")
.append(name) .append(name)
.append("=\"") .append("=\"")
.append(textEscaper.escape(value)) .append(textEscaper.escape(value))
.append("\""); .append("\"");
return this; return this;
} }

View file

@ -1,12 +1,11 @@
package org.xbib.j2html.rendering; package org.xbib.j2html.rendering;
import org.xbib.j2html.Config;
import org.xbib.j2html.utils.Indenter;
import org.xbib.j2html.utils.TextEscaper;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayDeque; import java.util.ArrayDeque;
import java.util.Deque; import java.util.Deque;
import org.xbib.j2html.Config;
import org.xbib.j2html.utils.Indenter;
import org.xbib.j2html.utils.TextEscaper;
/** /**
* Composes HTML with lines breaks and indentation between tags and text. * Composes HTML with lines breaks and indentation between tags and text.
@ -195,10 +194,10 @@ public class IndentedHtml<T extends Appendable> implements HtmlBuilder<T> {
@Override @Override
public TagBuilder appendAttribute(String name, String value) throws IOException { public TagBuilder appendAttribute(String name, String value) throws IOException {
out.append(" ") out.append(" ")
.append(name) .append(name)
.append("=\"") .append("=\"")
.append(textEscaper.escape(value)) .append(textEscaper.escape(value))
.append("\""); .append("\"");
return this; return this;
} }

View file

@ -1,16 +1,15 @@
package org.xbib.j2html.tags; package org.xbib.j2html.tags;
import org.xbib.j2html.Config;
import org.xbib.j2html.attributes.Attribute;
import org.xbib.j2html.rendering.TagBuilder;
import org.xbib.j2html.rendering.FlatHtml;
import org.xbib.j2html.rendering.HtmlBuilder;
import org.xbib.j2html.rendering.IndentedHtml;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
import org.xbib.j2html.Config;
import org.xbib.j2html.attributes.Attribute;
import org.xbib.j2html.rendering.FlatHtml;
import org.xbib.j2html.rendering.HtmlBuilder;
import org.xbib.j2html.rendering.IndentedHtml;
import org.xbib.j2html.rendering.TagBuilder;
public class ContainerTag<T extends ContainerTag<T>> extends Tag<T> { public class ContainerTag<T extends ContainerTag<T>> extends Tag<T> {
@ -148,7 +147,7 @@ public class ContainerTag<T extends ContainerTag<T>> extends Tag<T> {
public String renderFormatted() { public String renderFormatted() {
try { try {
return render(IndentedHtml.into(new StringBuilder(), Config.global())).toString(); return render(IndentedHtml.into(new StringBuilder(), Config.global())).toString();
}catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e.getMessage(), e); throw new RuntimeException(e.getMessage(), e);
} }
} }
@ -157,17 +156,17 @@ public class ContainerTag<T extends ContainerTag<T>> extends Tag<T> {
public <A extends Appendable> A render(HtmlBuilder<A> builder, Object model) throws IOException { public <A extends Appendable> A render(HtmlBuilder<A> builder, Object model) throws IOException {
if (hasTagName()) { if (hasTagName()) {
TagBuilder tagBuilder = builder.appendStartTag(getTagName()); TagBuilder tagBuilder = builder.appendStartTag(getTagName());
for(Attribute attribute : getAttributes()){ for (Attribute attribute : getAttributes()) {
attribute.render(tagBuilder, model); attribute.render(tagBuilder, model);
} }
tagBuilder.completeTag(); tagBuilder.completeTag();
} }
for(DomContent child : children){ for (DomContent child : children) {
child.render(builder, model); child.render(builder, model);
} }
if(hasTagName()) { if (hasTagName()) {
builder.appendEndTag(getTagName()); builder.appendEndTag(getTagName());
} }
@ -178,8 +177,8 @@ public class ContainerTag<T extends ContainerTag<T>> extends Tag<T> {
@Deprecated @Deprecated
public void renderModel(Appendable writer, Object model) throws IOException { public void renderModel(Appendable writer, Object model) throws IOException {
HtmlBuilder<?> builder = (writer instanceof HtmlBuilder) HtmlBuilder<?> builder = (writer instanceof HtmlBuilder)
? (HtmlBuilder<?>) writer ? (HtmlBuilder<?>) writer
: FlatHtml.into(writer, Config.global()); : FlatHtml.into(writer, Config.global());
render(builder, model); render(builder, model);
} }

View file

@ -16,7 +16,7 @@ public class DomContentJoiner {
} else { } else {
throw new RuntimeException("You can only join DomContent and String objects"); throw new RuntimeException("You can only join DomContent and String objects");
} }
if (i < stringOrDomObjects.length-1) { if (i < stringOrDomObjects.length - 1) {
sb.append(delimiter); sb.append(delimiter);
} }
} }

View file

@ -1,12 +1,11 @@
package org.xbib.j2html.tags; package org.xbib.j2html.tags;
import java.io.IOException;
import org.xbib.j2html.Config; import org.xbib.j2html.Config;
import org.xbib.j2html.attributes.Attribute; import org.xbib.j2html.attributes.Attribute;
import org.xbib.j2html.rendering.TagBuilder;
import org.xbib.j2html.rendering.FlatHtml; import org.xbib.j2html.rendering.FlatHtml;
import org.xbib.j2html.rendering.HtmlBuilder; import org.xbib.j2html.rendering.HtmlBuilder;
import org.xbib.j2html.rendering.TagBuilder;
import java.io.IOException;
public class EmptyTag<T extends EmptyTag<T>> extends Tag<T> { public class EmptyTag<T extends EmptyTag<T>> extends Tag<T> {
@ -34,8 +33,8 @@ public class EmptyTag<T extends EmptyTag<T>> extends Tag<T> {
@Deprecated @Deprecated
public void renderModel(Appendable writer, Object model) throws IOException { public void renderModel(Appendable writer, Object model) throws IOException {
HtmlBuilder<?> builder = (writer instanceof HtmlBuilder) HtmlBuilder<?> builder = (writer instanceof HtmlBuilder)
? (HtmlBuilder<?>) writer ? (HtmlBuilder<?>) writer
: FlatHtml.into(writer, Config.global()); : FlatHtml.into(writer, Config.global());
render(builder, model); render(builder, model);
} }

View file

@ -1,43 +1,29 @@
package org.xbib.j2html.tags; package org.xbib.j2html.tags;
import org.xbib.j2html.Config; import java.io.IOException;
import java.io.FileInputStream;
import java.io.InputStream; import java.io.InputStream;
import java.util.Scanner; import java.nio.charset.StandardCharsets;
import org.xbib.j2html.Config;
import static org.xbib.j2html.TagCreator.rawHtml; import static org.xbib.j2html.TagCreator.rawHtml;
import static org.xbib.j2html.TagCreator.script; import static org.xbib.j2html.TagCreator.script;
import static org.xbib.j2html.TagCreator.style; import static org.xbib.j2html.TagCreator.style;
public class InlineStaticResource { public class InlineStaticResource {
public static ContainerTag<? extends Tag<?>> get(String path, TargetFormat format) { public static ContainerTag<? extends Tag<?>> get(InputStream inputStream, TargetFormat format) {
String fileString = getFileAsString(path);
return switch (format) {
case CSS_MIN -> style().with(rawHtml(Config.cssMinifier.minify(fileString)));
case JS_MIN -> script().with(rawHtml(Config.jsMinifier.minify((fileString))));
case CSS -> style().with(rawHtml(fileString));
case JS -> script().with(rawHtml(fileString));
};
}
public static String getFileAsString(String path) {
try { try {
return streamToString(InlineStaticResource.class.getResourceAsStream(path)); String fileString = new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);
} catch (Exception expected) { return switch (format) {
try { case CSS_MIN -> style().with(rawHtml(Config.cssMinifier.minify(fileString)));
return streamToString(new FileInputStream(path)); case JS_MIN -> script().with(rawHtml(Config.jsMinifier.minify((fileString))));
} catch (Exception exception) { case CSS -> style().with(rawHtml(fileString));
throw new RuntimeException("Couldn't find file with path='" + path + "'"); case JS -> script().with(rawHtml(fileString));
} };
} catch (IOException e) {
throw new RuntimeException(e);
} }
} }
private static String streamToString(InputStream inputStream) {
Scanner s = new Scanner(inputStream).useDelimiter("\\A");
return s.hasNext() ? s.next() : "";
}
public enum TargetFormat {CSS_MIN, CSS, JS_MIN, JS} public enum TargetFormat {CSS_MIN, CSS, JS_MIN, JS}
} }

View file

@ -1,11 +1,10 @@
package org.xbib.j2html.tags; package org.xbib.j2html.tags;
import org.xbib.j2html.Config;
import org.xbib.j2html.rendering.FlatHtml;
import org.xbib.j2html.rendering.HtmlBuilder;
import java.io.IOException; import java.io.IOException;
import java.io.UncheckedIOException; import java.io.UncheckedIOException;
import org.xbib.j2html.Config;
import org.xbib.j2html.rendering.FlatHtml;
import org.xbib.j2html.rendering.HtmlBuilder;
public interface Renderable { public interface Renderable {

View file

@ -1,9 +1,9 @@
package org.xbib.j2html.tags; package org.xbib.j2html.tags;
import org.xbib.j2html.attributes.Attr;
import org.xbib.j2html.attributes.Attribute;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import org.xbib.j2html.attributes.Attr;
import org.xbib.j2html.attributes.Attribute;
public abstract class Tag<T extends Tag<T>> extends DomContent implements IInstance<T> { public abstract class Tag<T extends Tag<T>> extends DomContent implements IInstance<T> {
private final String tagName; private final String tagName;
@ -32,7 +32,7 @@ public abstract class Tag<T extends Tag<T>> extends DomContent implements IInsta
* @param name the attribute * @param name the attribute
* @param value the attribute value * @param value the attribute value
*/ */
boolean setAttribute(String name, String value) { public boolean setAttribute(String name, String value) {
if (value == null) { if (value == null) {
return attributes.add(new Attribute(name)); return attributes.add(new Attribute(name));
} }
@ -146,68 +146,132 @@ public abstract class Tag<T extends Tag<T>> extends DomContent implements IInsta
translate translate
*/ */
public T withAccesskey(String accesskey){ return attr(Attr.ACCESSKEY, accesskey); } public T withAccesskey(String accesskey) {
return attr(Attr.ACCESSKEY, accesskey);
}
public T withClass(String className) { return attr(Attr.CLASS, className); } public T withClass(String className) {
return attr(Attr.CLASS, className);
}
public T isContenteditable(){ return attr(Attr.CONTENTEDITABLE, "true"); } public T isContenteditable() {
return attr(Attr.CONTENTEDITABLE, "true");
}
public T withData(String dataAttr, String value) { return attr(Attr.DATA + "-" + dataAttr, value); } public T withData(String dataAttr, String value) {
return attr(Attr.DATA + "-" + dataAttr, value);
}
public T withDir(String dir) { return attr(Attr.DIR, dir); } public T withDir(String dir) {
return attr(Attr.DIR, dir);
}
public T isDraggable(){ return attr(Attr.DRAGGABLE, "true"); } public T isDraggable() {
return attr(Attr.DRAGGABLE, "true");
}
public T isHidden() { return attr(Attr.HIDDEN, null); } public T isHidden() {
return attr(Attr.HIDDEN, null);
}
public T withId(String id) { return attr(Attr.ID, id); } public T withId(String id) {
return attr(Attr.ID, id);
}
public T withIs(String element){ return attr(Attr.IS, element); } public T withIs(String element) {
return attr(Attr.IS, element);
}
public T withLang(String lang) { return attr(Attr.LANG, lang); } public T withLang(String lang) {
return attr(Attr.LANG, lang);
}
public T withSlot(String name){ return attr(Attr.SLOT, name); } public T withSlot(String name) {
return attr(Attr.SLOT, name);
}
public T isSpellcheck(){ return attr(Attr.SPELLCHECK, "true"); } public T isSpellcheck() {
return attr(Attr.SPELLCHECK, "true");
}
public T withStyle(String style) { return attr(Attr.STYLE, style); } public T withStyle(String style) {
return attr(Attr.STYLE, style);
}
public T withTabindex(int index){ return attr(Attr.TABINDEX, index); } public T withTabindex(int index) {
return attr(Attr.TABINDEX, index);
}
public T withTitle(String title) { return attr(Attr.TITLE, title); } public T withTitle(String title) {
return attr(Attr.TITLE, title);
}
public T isTranslate(){ return attr(Attr.TRANSLATE, "yes"); } public T isTranslate() {
return attr(Attr.TRANSLATE, "yes");
}
// ----- start of withCond$ATTR variants ----- // ----- start of withCond$ATTR variants -----
public T withCondAccessKey(boolean condition, String accesskey){ return condAttr(condition, Attr.ACCESSKEY, accesskey); } public T withCondAccessKey(boolean condition, String accesskey) {
return condAttr(condition, Attr.ACCESSKEY, accesskey);
}
public T withCondClass(boolean condition, String className) { return condAttr(condition, Attr.CLASS, className); } public T withCondClass(boolean condition, String className) {
return condAttr(condition, Attr.CLASS, className);
}
public T withCondContenteditable(boolean condition){ return attr(Attr.CONTENTEDITABLE, (condition)?"true":"false");} public T withCondContenteditable(boolean condition) {
return attr(Attr.CONTENTEDITABLE, (condition) ? "true" : "false");
}
public T withCondData(boolean condition, String dataAttr, String value) { return condAttr(condition, Attr.DATA + "-" + dataAttr, value); } public T withCondData(boolean condition, String dataAttr, String value) {
return condAttr(condition, Attr.DATA + "-" + dataAttr, value);
}
public T withCondDir(boolean condition, String dir) { return condAttr(condition, Attr.DIR, dir); } public T withCondDir(boolean condition, String dir) {
return condAttr(condition, Attr.DIR, dir);
}
public T withCondDraggable(boolean condition){ return attr(Attr.DRAGGABLE, (condition)?"true":"false"); } public T withCondDraggable(boolean condition) {
return attr(Attr.DRAGGABLE, (condition) ? "true" : "false");
}
public T withCondHidden(boolean condition) { return condAttr(condition, Attr.HIDDEN, null); } public T withCondHidden(boolean condition) {
return condAttr(condition, Attr.HIDDEN, null);
}
public T withCondId(boolean condition, String id) { return condAttr(condition, Attr.ID, id); } public T withCondId(boolean condition, String id) {
return condAttr(condition, Attr.ID, id);
}
public T withCondIs(boolean condition, String element){ return condAttr(condition, Attr.IS, element); } public T withCondIs(boolean condition, String element) {
return condAttr(condition, Attr.IS, element);
}
public T withCondLang(boolean condition, String lang) { return condAttr(condition, Attr.LANG, lang); } public T withCondLang(boolean condition, String lang) {
return condAttr(condition, Attr.LANG, lang);
}
public T withCondSlot(boolean condition, String name){ return condAttr(condition, Attr.SLOT, name); } public T withCondSlot(boolean condition, String name) {
return condAttr(condition, Attr.SLOT, name);
}
public T withCondSpellcheck(boolean condition){ return attr(Attr.SPELLCHECK, (condition)?"true":"false"); } public T withCondSpellcheck(boolean condition) {
return attr(Attr.SPELLCHECK, (condition) ? "true" : "false");
}
public T withCondStyle(boolean condition, String style) { return condAttr(condition, Attr.STYLE, style); } public T withCondStyle(boolean condition, String style) {
return condAttr(condition, Attr.STYLE, style);
}
public T withCondTabindex(boolean condition, int index){ return condAttr(condition, Attr.TABINDEX, index+""); } public T withCondTabindex(boolean condition, int index) {
return condAttr(condition, Attr.TABINDEX, index + "");
}
public T withCondTitle(boolean condition, String title) { return condAttr(condition, Attr.TITLE, title); } public T withCondTitle(boolean condition, String title) {
return condAttr(condition, Attr.TITLE, title);
}
public T withCondTranslate(boolean condition){ return attr(Attr.TRANSLATE, (condition)?"yes":"no"); } public T withCondTranslate(boolean condition) {
return attr(Attr.TRANSLATE, (condition) ? "yes" : "no");
}
} }

View file

@ -1,11 +1,10 @@
package org.xbib.j2html.tags; package org.xbib.j2html.tags;
import java.io.IOException;
import org.xbib.j2html.Config; import org.xbib.j2html.Config;
import org.xbib.j2html.rendering.FlatHtml; import org.xbib.j2html.rendering.FlatHtml;
import org.xbib.j2html.rendering.HtmlBuilder; import org.xbib.j2html.rendering.HtmlBuilder;
import java.io.IOException;
public class Text extends DomContent { public class Text extends DomContent {
private final String text; private final String text;
@ -24,8 +23,8 @@ public class Text extends DomContent {
@Deprecated @Deprecated
public void renderModel(Appendable writer, Object model) throws IOException { public void renderModel(Appendable writer, Object model) throws IOException {
HtmlBuilder<?> builder = (writer instanceof HtmlBuilder) HtmlBuilder<?> builder = (writer instanceof HtmlBuilder)
? (HtmlBuilder<?>) writer ? (HtmlBuilder<?>) writer
: FlatHtml.into(writer, Config.global()); : FlatHtml.into(writer, Config.global());
render(builder, model); render(builder, model);
} }

View file

@ -1,11 +1,10 @@
package org.xbib.j2html.tags; package org.xbib.j2html.tags;
import java.io.IOException;
import org.xbib.j2html.Config; import org.xbib.j2html.Config;
import org.xbib.j2html.rendering.FlatHtml; import org.xbib.j2html.rendering.FlatHtml;
import org.xbib.j2html.rendering.HtmlBuilder; import org.xbib.j2html.rendering.HtmlBuilder;
import java.io.IOException;
public class UnescapedText extends DomContent { public class UnescapedText extends DomContent {
private final String text; private final String text;
@ -24,8 +23,8 @@ public class UnescapedText extends DomContent {
@Deprecated @Deprecated
public void renderModel(Appendable writer, Object model) throws IOException { public void renderModel(Appendable writer, Object model) throws IOException {
HtmlBuilder<?> builder = (writer instanceof HtmlBuilder) HtmlBuilder<?> builder = (writer instanceof HtmlBuilder)
? (HtmlBuilder<?>) writer ? (HtmlBuilder<?>) writer
: FlatHtml.into(writer, Config.global()); : FlatHtml.into(writer, Config.global());
render(builder, model); render(builder, model);
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IAccept<T extends Tag<T>> extends IInstance<T> { public interface IAccept<T extends Tag<T>> extends IInstance<T> {
default T withAccept(final String accept_) { default T withAccept(final String accept_) {
return self().attr("accept", accept_); return self().attr("accept", accept_);
} }
default T withCondAccept(final boolean enable, final String accept_) { default T withCondAccept(final boolean enable, final String accept_) {
return enable ? self().attr("accept", accept_) : self(); return enable ? self().attr("accept", accept_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IAction<T extends Tag<T>> extends IInstance<T> { public interface IAction<T extends Tag<T>> extends IInstance<T> {
default T withAction(final String action_) { default T withAction(final String action_) {
return self().attr("action", action_); return self().attr("action", action_);
} }
default T withCondAction(final boolean enable, final String action_) { default T withCondAction(final boolean enable, final String action_) {
return enable ? self().attr("action", action_) : self(); return enable ? self().attr("action", action_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IAlt<T extends Tag<T>> extends IInstance<T> { public interface IAlt<T extends Tag<T>> extends IInstance<T> {
default T withAlt(final String alt_) { default T withAlt(final String alt_) {
return self().attr("alt", alt_); return self().attr("alt", alt_);
} }
default T withCondAlt(final boolean enable, final String alt_) { default T withCondAlt(final boolean enable, final String alt_) {
return enable ? self().attr("alt", alt_) : self(); return enable ? self().attr("alt", alt_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IAsync<T extends Tag<T>> extends IInstance<T> { public interface IAsync<T extends Tag<T>> extends IInstance<T> {
default T isAsync() { default T isAsync() {
return self().attr("async"); return self().attr("async");
} }
default T withCondAsync(final boolean enable) { default T withCondAsync(final boolean enable) {
return enable ? self().attr("async") : self(); return enable ? self().attr("async") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IAutocomplete<T extends Tag<T>> extends IInstance<T> { public interface IAutocomplete<T extends Tag<T>> extends IInstance<T> {
default T isAutocomplete() { default T isAutocomplete() {
return self().attr("autocomplete", "on"); return self().attr("autocomplete", "on");
} }
default T withCondAutocomplete(final boolean enable) { default T withCondAutocomplete(final boolean enable) {
return enable ? self().attr("autocomplete", "on") : self(); return enable ? self().attr("autocomplete", "on") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IAutofocus<T extends Tag<T>> extends IInstance<T> { public interface IAutofocus<T extends Tag<T>> extends IInstance<T> {
default T isAutofocus() { default T isAutofocus() {
return self().attr("autofocus"); return self().attr("autofocus");
} }
default T withCondAutofocus(final boolean enable) { default T withCondAutofocus(final boolean enable) {
return enable ? self().attr("autofocus") : self(); return enable ? self().attr("autofocus") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IAutoplay<T extends Tag<T>> extends IInstance<T> { public interface IAutoplay<T extends Tag<T>> extends IInstance<T> {
default T isAutoplay() { default T isAutoplay() {
return self().attr("autoplay"); return self().attr("autoplay");
} }
default T withCondAutoplay(final boolean enable) { default T withCondAutoplay(final boolean enable) {
return enable ? self().attr("autoplay") : self(); return enable ? self().attr("autoplay") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface ICharset<T extends Tag<T>> extends IInstance<T> { public interface ICharset<T extends Tag<T>> extends IInstance<T> {
default T withCharset(final String charset_) { default T withCharset(final String charset_) {
return self().attr("charset", charset_); return self().attr("charset", charset_);
} }
default T withCondCharset(final boolean enable, final String charset_) { default T withCondCharset(final boolean enable, final String charset_) {
return enable ? self().attr("charset", charset_) : self(); return enable ? self().attr("charset", charset_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IChecked<T extends Tag<T>> extends IInstance<T> { public interface IChecked<T extends Tag<T>> extends IInstance<T> {
default T isChecked() { default T isChecked() {
return self().attr("checked"); return self().attr("checked");
} }
default T withCondChecked(final boolean enable) { default T withCondChecked(final boolean enable) {
return enable ? self().attr("checked") : self(); return enable ? self().attr("checked") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface ICite<T extends Tag<T>> extends IInstance<T> { public interface ICite<T extends Tag<T>> extends IInstance<T> {
default T withCite(final String cite_) { default T withCite(final String cite_) {
return self().attr("cite", cite_); return self().attr("cite", cite_);
} }
default T withCondCite(final boolean enable, final String cite_) { default T withCondCite(final boolean enable, final String cite_) {
return enable ? self().attr("cite", cite_) : self(); return enable ? self().attr("cite", cite_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface ICols<T extends Tag<T>> extends IInstance<T> { public interface ICols<T extends Tag<T>> extends IInstance<T> {
default T withCols(final String cols_) { default T withCols(final String cols_) {
return self().attr("cols", cols_); return self().attr("cols", cols_);
} }
default T withCondCols(final boolean enable, final String cols_) { default T withCondCols(final boolean enable, final String cols_) {
return enable ? self().attr("cols", cols_) : self(); return enable ? self().attr("cols", cols_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IColspan<T extends Tag<T>> extends IInstance<T> { public interface IColspan<T extends Tag<T>> extends IInstance<T> {
default T withColspan(final String colspan_) { default T withColspan(final String colspan_) {
return self().attr("colspan", colspan_); return self().attr("colspan", colspan_);
} }
default T withCondColspan(final boolean enable, final String colspan_) { default T withCondColspan(final boolean enable, final String colspan_) {
return enable ? self().attr("colspan", colspan_) : self(); return enable ? self().attr("colspan", colspan_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IContent<T extends Tag<T>> extends IInstance<T> { public interface IContent<T extends Tag<T>> extends IInstance<T> {
default T withContent(final String content_) { default T withContent(final String content_) {
return self().attr("content", content_); return self().attr("content", content_);
} }
default T withCondContent(final boolean enable, final String content_) { default T withCondContent(final boolean enable, final String content_) {
return enable ? self().attr("content", content_) : self(); return enable ? self().attr("content", content_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IControls<T extends Tag<T>> extends IInstance<T> { public interface IControls<T extends Tag<T>> extends IInstance<T> {
default T isControls() { default T isControls() {
return self().attr("controls"); return self().attr("controls");
} }
default T withCondControls(final boolean enable) { default T withCondControls(final boolean enable) {
return enable ? self().attr("controls") : self(); return enable ? self().attr("controls") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface ICoords<T extends Tag<T>> extends IInstance<T> { public interface ICoords<T extends Tag<T>> extends IInstance<T> {
default T withCoords(final String coords_) { default T withCoords(final String coords_) {
return self().attr("coords", coords_); return self().attr("coords", coords_);
} }
default T withCondCoords(final boolean enable, final String coords_) { default T withCondCoords(final boolean enable, final String coords_) {
return enable ? self().attr("coords", coords_) : self(); return enable ? self().attr("coords", coords_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IData<T extends Tag<T>> extends IInstance<T> { public interface IData<T extends Tag<T>> extends IInstance<T> {
default T withData(final String data_) { default T withData(final String data_) {
return self().attr("data", data_); return self().attr("data", data_);
} }
default T withCondData(final boolean enable, final String data_) { default T withCondData(final boolean enable, final String data_) {
return enable ? self().attr("data", data_) : self(); return enable ? self().attr("data", data_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IDatetime<T extends Tag<T>> extends IInstance<T> { public interface IDatetime<T extends Tag<T>> extends IInstance<T> {
default T withDatetime(final String datetime_) { default T withDatetime(final String datetime_) {
return self().attr("datetime", datetime_); return self().attr("datetime", datetime_);
} }
default T withCondDatetime(final boolean enable, final String datetime_) { default T withCondDatetime(final boolean enable, final String datetime_) {
return enable ? self().attr("datetime", datetime_) : self(); return enable ? self().attr("datetime", datetime_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IDefault<T extends Tag<T>> extends IInstance<T> { public interface IDefault<T extends Tag<T>> extends IInstance<T> {
default T isDefault() { default T isDefault() {
return self().attr("default"); return self().attr("default");
} }
default T withCondDefault(final boolean enable) { default T withCondDefault(final boolean enable) {
return enable ? self().attr("default") : self(); return enable ? self().attr("default") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IDefer<T extends Tag<T>> extends IInstance<T> { public interface IDefer<T extends Tag<T>> extends IInstance<T> {
default T isDefer() { default T isDefer() {
return self().attr("defer"); return self().attr("defer");
} }
default T withCondDefer(final boolean enable) { default T withCondDefer(final boolean enable) {
return enable ? self().attr("defer") : self(); return enable ? self().attr("defer") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IDirname<T extends Tag<T>> extends IInstance<T> { public interface IDirname<T extends Tag<T>> extends IInstance<T> {
default T withDirname(final String dirname_) { default T withDirname(final String dirname_) {
return self().attr("dirname", dirname_); return self().attr("dirname", dirname_);
} }
default T withCondDirname(final boolean enable, final String dirname_) { default T withCondDirname(final boolean enable, final String dirname_) {
return enable ? self().attr("dirname", dirname_) : self(); return enable ? self().attr("dirname", dirname_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IDisabled<T extends Tag<T>> extends IInstance<T> { public interface IDisabled<T extends Tag<T>> extends IInstance<T> {
default T isDisabled() { default T isDisabled() {
return self().attr("disabled"); return self().attr("disabled");
} }
default T withCondDisabled(final boolean enable) { default T withCondDisabled(final boolean enable) {
return enable ? self().attr("disabled") : self(); return enable ? self().attr("disabled") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IDownload<T extends Tag<T>> extends IInstance<T> { public interface IDownload<T extends Tag<T>> extends IInstance<T> {
default T isDownload() { default T isDownload() {
return self().attr("download"); return self().attr("download");
} }
default T withCondDownload(final boolean enable) { default T withCondDownload(final boolean enable) {
return enable ? self().attr("download") : self(); return enable ? self().attr("download") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IEnctype<T extends Tag<T>> extends IInstance<T> { public interface IEnctype<T extends Tag<T>> extends IInstance<T> {
default T withEnctype(final String enctype_) { default T withEnctype(final String enctype_) {
return self().attr("enctype", enctype_); return self().attr("enctype", enctype_);
} }
default T withCondEnctype(final boolean enable, final String enctype_) { default T withCondEnctype(final boolean enable, final String enctype_) {
return enable ? self().attr("enctype", enctype_) : self(); return enable ? self().attr("enctype", enctype_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IFor<T extends Tag<T>> extends IInstance<T> { public interface IFor<T extends Tag<T>> extends IInstance<T> {
default T withFor(final String for_) { default T withFor(final String for_) {
return self().attr("for", for_); return self().attr("for", for_);
} }
default T withCondFor(final boolean enable, final String for_) { default T withCondFor(final boolean enable, final String for_) {
return enable ? self().attr("for", for_) : self(); return enable ? self().attr("for", for_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IForm<T extends Tag<T>> extends IInstance<T> { public interface IForm<T extends Tag<T>> extends IInstance<T> {
default T withForm(final String form_) { default T withForm(final String form_) {
return self().attr("form", form_); return self().attr("form", form_);
} }
default T withCondForm(final boolean enable, final String form_) { default T withCondForm(final boolean enable, final String form_) {
return enable ? self().attr("form", form_) : self(); return enable ? self().attr("form", form_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IFormaction<T extends Tag<T>> extends IInstance<T> { public interface IFormaction<T extends Tag<T>> extends IInstance<T> {
default T withFormaction(final String formaction_) { default T withFormaction(final String formaction_) {
return self().attr("formaction", formaction_); return self().attr("formaction", formaction_);
} }
default T withCondFormaction(final boolean enable, final String formaction_) { default T withCondFormaction(final boolean enable, final String formaction_) {
return enable ? self().attr("formaction", formaction_) : self(); return enable ? self().attr("formaction", formaction_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IHeaders<T extends Tag<T>> extends IInstance<T> { public interface IHeaders<T extends Tag<T>> extends IInstance<T> {
default T withHeaders(final String headers_) { default T withHeaders(final String headers_) {
return self().attr("headers", headers_); return self().attr("headers", headers_);
} }
default T withCondHeaders(final boolean enable, final String headers_) { default T withCondHeaders(final boolean enable, final String headers_) {
return enable ? self().attr("headers", headers_) : self(); return enable ? self().attr("headers", headers_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IHeight<T extends Tag<T>> extends IInstance<T> { public interface IHeight<T extends Tag<T>> extends IInstance<T> {
default T withHeight(final String height_) { default T withHeight(final String height_) {
return self().attr("height", height_); return self().attr("height", height_);
} }
default T withCondHeight(final boolean enable, final String height_) { default T withCondHeight(final boolean enable, final String height_) {
return enable ? self().attr("height", height_) : self(); return enable ? self().attr("height", height_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IHigh<T extends Tag<T>> extends IInstance<T> { public interface IHigh<T extends Tag<T>> extends IInstance<T> {
default T withHigh(final String high_) { default T withHigh(final String high_) {
return self().attr("high", high_); return self().attr("high", high_);
} }
default T withCondHigh(final boolean enable, final String high_) { default T withCondHigh(final boolean enable, final String high_) {
return enable ? self().attr("high", high_) : self(); return enable ? self().attr("high", high_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IHref<T extends Tag<T>> extends IInstance<T> { public interface IHref<T extends Tag<T>> extends IInstance<T> {
default T withHref(final String href_) { default T withHref(final String href_) {
return self().attr("href", href_); return self().attr("href", href_);
} }
default T withCondHref(final boolean enable, final String href_) { default T withCondHref(final boolean enable, final String href_) {
return enable ? self().attr("href", href_) : self(); return enable ? self().attr("href", href_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IHreflang<T extends Tag<T>> extends IInstance<T> { public interface IHreflang<T extends Tag<T>> extends IInstance<T> {
default T withHreflang(final String hreflang_) { default T withHreflang(final String hreflang_) {
return self().attr("hreflang", hreflang_); return self().attr("hreflang", hreflang_);
} }
default T withCondHreflang(final boolean enable, final String hreflang_) { default T withCondHreflang(final boolean enable, final String hreflang_) {
return enable ? self().attr("hreflang", hreflang_) : self(); return enable ? self().attr("hreflang", hreflang_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IIsmap<T extends Tag<T>> extends IInstance<T> { public interface IIsmap<T extends Tag<T>> extends IInstance<T> {
default T isIsmap() { default T isIsmap() {
return self().attr("ismap"); return self().attr("ismap");
} }
default T withCondIsmap(final boolean enable) { default T withCondIsmap(final boolean enable) {
return enable ? self().attr("ismap") : self(); return enable ? self().attr("ismap") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IKind<T extends Tag<T>> extends IInstance<T> { public interface IKind<T extends Tag<T>> extends IInstance<T> {
default T withKind(final String kind_) { default T withKind(final String kind_) {
return self().attr("kind", kind_); return self().attr("kind", kind_);
} }
default T withCondKind(final boolean enable, final String kind_) { default T withCondKind(final boolean enable, final String kind_) {
return enable ? self().attr("kind", kind_) : self(); return enable ? self().attr("kind", kind_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface ILabel<T extends Tag<T>> extends IInstance<T> { public interface ILabel<T extends Tag<T>> extends IInstance<T> {
default T withLabel(final String label_) { default T withLabel(final String label_) {
return self().attr("label", label_); return self().attr("label", label_);
} }
default T withCondLabel(final boolean enable, final String label_) { default T withCondLabel(final boolean enable, final String label_) {
return enable ? self().attr("label", label_) : self(); return enable ? self().attr("label", label_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IList<T extends Tag<T>> extends IInstance<T> { public interface IList<T extends Tag<T>> extends IInstance<T> {
default T withList(final String list_) { default T withList(final String list_) {
return self().attr("list", list_); return self().attr("list", list_);
} }
default T withCondList(final boolean enable, final String list_) { default T withCondList(final boolean enable, final String list_) {
return enable ? self().attr("list", list_) : self(); return enable ? self().attr("list", list_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface ILoop<T extends Tag<T>> extends IInstance<T> { public interface ILoop<T extends Tag<T>> extends IInstance<T> {
default T isLoop() { default T isLoop() {
return self().attr("loop"); return self().attr("loop");
} }
default T withCondLoop(final boolean enable) { default T withCondLoop(final boolean enable) {
return enable ? self().attr("loop") : self(); return enable ? self().attr("loop") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface ILow<T extends Tag<T>> extends IInstance<T> { public interface ILow<T extends Tag<T>> extends IInstance<T> {
default T withLow(final String low_) { default T withLow(final String low_) {
return self().attr("low", low_); return self().attr("low", low_);
} }
default T withCondLow(final boolean enable, final String low_) { default T withCondLow(final boolean enable, final String low_) {
return enable ? self().attr("low", low_) : self(); return enable ? self().attr("low", low_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IMax<T extends Tag<T>> extends IInstance<T> { public interface IMax<T extends Tag<T>> extends IInstance<T> {
default T withMax(final String max_) { default T withMax(final String max_) {
return self().attr("max", max_); return self().attr("max", max_);
} }
default T withCondMax(final boolean enable, final String max_) { default T withCondMax(final boolean enable, final String max_) {
return enable ? self().attr("max", max_) : self(); return enable ? self().attr("max", max_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IMaxlength<T extends Tag<T>> extends IInstance<T> { public interface IMaxlength<T extends Tag<T>> extends IInstance<T> {
default T withMaxlength(final String maxlength_) { default T withMaxlength(final String maxlength_) {
return self().attr("maxlength", maxlength_); return self().attr("maxlength", maxlength_);
} }
default T withCondMaxlength(final boolean enable, final String maxlength_) { default T withCondMaxlength(final boolean enable, final String maxlength_) {
return enable ? self().attr("maxlength", maxlength_) : self(); return enable ? self().attr("maxlength", maxlength_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IMedia<T extends Tag<T>> extends IInstance<T> { public interface IMedia<T extends Tag<T>> extends IInstance<T> {
default T withMedia(final String media_) { default T withMedia(final String media_) {
return self().attr("media", media_); return self().attr("media", media_);
} }
default T withCondMedia(final boolean enable, final String media_) { default T withCondMedia(final boolean enable, final String media_) {
return enable ? self().attr("media", media_) : self(); return enable ? self().attr("media", media_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IMethod<T extends Tag<T>> extends IInstance<T> { public interface IMethod<T extends Tag<T>> extends IInstance<T> {
default T withMethod(final String method_) { default T withMethod(final String method_) {
return self().attr("method", method_); return self().attr("method", method_);
} }
default T withCondMethod(final boolean enable, final String method_) { default T withCondMethod(final boolean enable, final String method_) {
return enable ? self().attr("method", method_) : self(); return enable ? self().attr("method", method_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IMin<T extends Tag<T>> extends IInstance<T> { public interface IMin<T extends Tag<T>> extends IInstance<T> {
default T withMin(final String min_) { default T withMin(final String min_) {
return self().attr("min", min_); return self().attr("min", min_);
} }
default T withCondMin(final boolean enable, final String min_) { default T withCondMin(final boolean enable, final String min_) {
return enable ? self().attr("min", min_) : self(); return enable ? self().attr("min", min_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IMultiple<T extends Tag<T>> extends IInstance<T> { public interface IMultiple<T extends Tag<T>> extends IInstance<T> {
default T isMultiple() { default T isMultiple() {
return self().attr("multiple"); return self().attr("multiple");
} }
default T withCondMultiple(final boolean enable) { default T withCondMultiple(final boolean enable) {
return enable ? self().attr("multiple") : self(); return enable ? self().attr("multiple") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IMuted<T extends Tag<T>> extends IInstance<T> { public interface IMuted<T extends Tag<T>> extends IInstance<T> {
default T isMuted() { default T isMuted() {
return self().attr("muted"); return self().attr("muted");
} }
default T withCondMuted(final boolean enable) { default T withCondMuted(final boolean enable) {
return enable ? self().attr("muted") : self(); return enable ? self().attr("muted") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IName<T extends Tag<T>> extends IInstance<T> { public interface IName<T extends Tag<T>> extends IInstance<T> {
default T withName(final String name_) { default T withName(final String name_) {
return self().attr("name", name_); return self().attr("name", name_);
} }
default T withCondName(final boolean enable, final String name_) { default T withCondName(final boolean enable, final String name_) {
return enable ? self().attr("name", name_) : self(); return enable ? self().attr("name", name_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface INovalidate<T extends Tag<T>> extends IInstance<T> { public interface INovalidate<T extends Tag<T>> extends IInstance<T> {
default T isNovalidate() { default T isNovalidate() {
return self().attr("novalidate"); return self().attr("novalidate");
} }
default T withCondNovalidate(final boolean enable) { default T withCondNovalidate(final boolean enable) {
return enable ? self().attr("novalidate") : self(); return enable ? self().attr("novalidate") : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnabort<T extends Tag<T>> extends IInstance<T> { public interface IOnabort<T extends Tag<T>> extends IInstance<T> {
default T withOnabort(final String onabort_) { default T withOnabort(final String onabort_) {
return self().attr("onabort", onabort_); return self().attr("onabort", onabort_);
} }
default T withCondOnabort(final boolean enable, final String onabort_) { default T withCondOnabort(final boolean enable, final String onabort_) {
return enable ? self().attr("onabort", onabort_) : self(); return enable ? self().attr("onabort", onabort_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnafterprint<T extends Tag<T>> extends IInstance<T> { public interface IOnafterprint<T extends Tag<T>> extends IInstance<T> {
default T withOnafterprint(final String onafterprint_) { default T withOnafterprint(final String onafterprint_) {
return self().attr("onafterprint", onafterprint_); return self().attr("onafterprint", onafterprint_);
} }
default T withCondOnafterprint(final boolean enable, final String onafterprint_) { default T withCondOnafterprint(final boolean enable, final String onafterprint_) {
return enable ? self().attr("onafterprint", onafterprint_) : self(); return enable ? self().attr("onafterprint", onafterprint_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnbeforeprint<T extends Tag<T>> extends IInstance<T> { public interface IOnbeforeprint<T extends Tag<T>> extends IInstance<T> {
default T withOnbeforeprint(final String onbeforeprint_) { default T withOnbeforeprint(final String onbeforeprint_) {
return self().attr("onbeforeprint", onbeforeprint_); return self().attr("onbeforeprint", onbeforeprint_);
} }
default T withCondOnbeforeprint(final boolean enable, final String onbeforeprint_) { default T withCondOnbeforeprint(final boolean enable, final String onbeforeprint_) {
return enable ? self().attr("onbeforeprint", onbeforeprint_) : self(); return enable ? self().attr("onbeforeprint", onbeforeprint_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnbeforeunload<T extends Tag<T>> extends IInstance<T> { public interface IOnbeforeunload<T extends Tag<T>> extends IInstance<T> {
default T withOnbeforeunload(final String onbeforeunload_) { default T withOnbeforeunload(final String onbeforeunload_) {
return self().attr("onbeforeunload", onbeforeunload_); return self().attr("onbeforeunload", onbeforeunload_);
} }
default T withCondOnbeforeunload(final boolean enable, final String onbeforeunload_) { default T withCondOnbeforeunload(final boolean enable, final String onbeforeunload_) {
return enable ? self().attr("onbeforeunload", onbeforeunload_) : self(); return enable ? self().attr("onbeforeunload", onbeforeunload_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOncanplay<T extends Tag<T>> extends IInstance<T> { public interface IOncanplay<T extends Tag<T>> extends IInstance<T> {
default T withOncanplay(final String oncanplay_) { default T withOncanplay(final String oncanplay_) {
return self().attr("oncanplay", oncanplay_); return self().attr("oncanplay", oncanplay_);
} }
default T withCondOncanplay(final boolean enable, final String oncanplay_) { default T withCondOncanplay(final boolean enable, final String oncanplay_) {
return enable ? self().attr("oncanplay", oncanplay_) : self(); return enable ? self().attr("oncanplay", oncanplay_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOncanplaythrough<T extends Tag<T>> extends IInstance<T> { public interface IOncanplaythrough<T extends Tag<T>> extends IInstance<T> {
default T withOncanplaythrough(final String oncanplaythrough_) { default T withOncanplaythrough(final String oncanplaythrough_) {
return self().attr("oncanplaythrough", oncanplaythrough_); return self().attr("oncanplaythrough", oncanplaythrough_);
} }
default T withCondOncanplaythrough(final boolean enable, final String oncanplaythrough_) { default T withCondOncanplaythrough(final boolean enable, final String oncanplaythrough_) {
return enable ? self().attr("oncanplaythrough", oncanplaythrough_) : self(); return enable ? self().attr("oncanplaythrough", oncanplaythrough_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOncuechange<T extends Tag<T>> extends IInstance<T> { public interface IOncuechange<T extends Tag<T>> extends IInstance<T> {
default T withOncuechange(final String oncuechange_) { default T withOncuechange(final String oncuechange_) {
return self().attr("oncuechange", oncuechange_); return self().attr("oncuechange", oncuechange_);
} }
default T withCondOncuechange(final boolean enable, final String oncuechange_) { default T withCondOncuechange(final boolean enable, final String oncuechange_) {
return enable ? self().attr("oncuechange", oncuechange_) : self(); return enable ? self().attr("oncuechange", oncuechange_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOndurationchange<T extends Tag<T>> extends IInstance<T> { public interface IOndurationchange<T extends Tag<T>> extends IInstance<T> {
default T withOndurationchange(final String ondurationchange_) { default T withOndurationchange(final String ondurationchange_) {
return self().attr("ondurationchange", ondurationchange_); return self().attr("ondurationchange", ondurationchange_);
} }
default T withCondOndurationchange(final boolean enable, final String ondurationchange_) { default T withCondOndurationchange(final boolean enable, final String ondurationchange_) {
return enable ? self().attr("ondurationchange", ondurationchange_) : self(); return enable ? self().attr("ondurationchange", ondurationchange_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnemptied<T extends Tag<T>> extends IInstance<T> { public interface IOnemptied<T extends Tag<T>> extends IInstance<T> {
default T withOnemptied(final String onemptied_) { default T withOnemptied(final String onemptied_) {
return self().attr("onemptied", onemptied_); return self().attr("onemptied", onemptied_);
} }
default T withCondOnemptied(final boolean enable, final String onemptied_) { default T withCondOnemptied(final boolean enable, final String onemptied_) {
return enable ? self().attr("onemptied", onemptied_) : self(); return enable ? self().attr("onemptied", onemptied_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnended<T extends Tag<T>> extends IInstance<T> { public interface IOnended<T extends Tag<T>> extends IInstance<T> {
default T withOnended(final String onended_) { default T withOnended(final String onended_) {
return self().attr("onended", onended_); return self().attr("onended", onended_);
} }
default T withCondOnended(final boolean enable, final String onended_) { default T withCondOnended(final boolean enable, final String onended_) {
return enable ? self().attr("onended", onended_) : self(); return enable ? self().attr("onended", onended_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnerror<T extends Tag<T>> extends IInstance<T> { public interface IOnerror<T extends Tag<T>> extends IInstance<T> {
default T withOnerror(final String onerror_) { default T withOnerror(final String onerror_) {
return self().attr("onerror", onerror_); return self().attr("onerror", onerror_);
} }
default T withCondOnerror(final boolean enable, final String onerror_) { default T withCondOnerror(final boolean enable, final String onerror_) {
return enable ? self().attr("onerror", onerror_) : self(); return enable ? self().attr("onerror", onerror_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnhashchange<T extends Tag<T>> extends IInstance<T> { public interface IOnhashchange<T extends Tag<T>> extends IInstance<T> {
default T withOnhashchange(final String onhashchange_) { default T withOnhashchange(final String onhashchange_) {
return self().attr("onhashchange", onhashchange_); return self().attr("onhashchange", onhashchange_);
} }
default T withCondOnhashchange(final boolean enable, final String onhashchange_) { default T withCondOnhashchange(final boolean enable, final String onhashchange_) {
return enable ? self().attr("onhashchange", onhashchange_) : self(); return enable ? self().attr("onhashchange", onhashchange_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnload<T extends Tag<T>> extends IInstance<T> { public interface IOnload<T extends Tag<T>> extends IInstance<T> {
default T withOnload(final String onload_) { default T withOnload(final String onload_) {
return self().attr("onload", onload_); return self().attr("onload", onload_);
} }
default T withCondOnload(final boolean enable, final String onload_) { default T withCondOnload(final boolean enable, final String onload_) {
return enable ? self().attr("onload", onload_) : self(); return enable ? self().attr("onload", onload_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnloadeddata<T extends Tag<T>> extends IInstance<T> { public interface IOnloadeddata<T extends Tag<T>> extends IInstance<T> {
default T withOnloadeddata(final String onloadeddata_) { default T withOnloadeddata(final String onloadeddata_) {
return self().attr("onloadeddata", onloadeddata_); return self().attr("onloadeddata", onloadeddata_);
} }
default T withCondOnloadeddata(final boolean enable, final String onloadeddata_) { default T withCondOnloadeddata(final boolean enable, final String onloadeddata_) {
return enable ? self().attr("onloadeddata", onloadeddata_) : self(); return enable ? self().attr("onloadeddata", onloadeddata_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnloadedmetadata<T extends Tag<T>> extends IInstance<T> { public interface IOnloadedmetadata<T extends Tag<T>> extends IInstance<T> {
default T withOnloadedmetadata(final String onloadedmetadata_) { default T withOnloadedmetadata(final String onloadedmetadata_) {
return self().attr("onloadedmetadata", onloadedmetadata_); return self().attr("onloadedmetadata", onloadedmetadata_);
} }
default T withCondOnloadedmetadata(final boolean enable, final String onloadedmetadata_) { default T withCondOnloadedmetadata(final boolean enable, final String onloadedmetadata_) {
return enable ? self().attr("onloadedmetadata", onloadedmetadata_) : self(); return enable ? self().attr("onloadedmetadata", onloadedmetadata_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnloadstart<T extends Tag<T>> extends IInstance<T> { public interface IOnloadstart<T extends Tag<T>> extends IInstance<T> {
default T withOnloadstart(final String onloadstart_) { default T withOnloadstart(final String onloadstart_) {
return self().attr("onloadstart", onloadstart_); return self().attr("onloadstart", onloadstart_);
} }
default T withCondOnloadstart(final boolean enable, final String onloadstart_) { default T withCondOnloadstart(final boolean enable, final String onloadstart_) {
return enable ? self().attr("onloadstart", onloadstart_) : self(); return enable ? self().attr("onloadstart", onloadstart_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnoffline<T extends Tag<T>> extends IInstance<T> { public interface IOnoffline<T extends Tag<T>> extends IInstance<T> {
default T withOnoffline(final String onoffline_) { default T withOnoffline(final String onoffline_) {
return self().attr("onoffline", onoffline_); return self().attr("onoffline", onoffline_);
} }
default T withCondOnoffline(final boolean enable, final String onoffline_) { default T withCondOnoffline(final boolean enable, final String onoffline_) {
return enable ? self().attr("onoffline", onoffline_) : self(); return enable ? self().attr("onoffline", onoffline_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnonline<T extends Tag<T>> extends IInstance<T> { public interface IOnonline<T extends Tag<T>> extends IInstance<T> {
default T withOnonline(final String ononline_) { default T withOnonline(final String ononline_) {
return self().attr("ononline", ononline_); return self().attr("ononline", ononline_);
} }
default T withCondOnonline(final boolean enable, final String ononline_) { default T withCondOnonline(final boolean enable, final String ononline_) {
return enable ? self().attr("ononline", ononline_) : self(); return enable ? self().attr("ononline", ononline_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnpagehide<T extends Tag<T>> extends IInstance<T> { public interface IOnpagehide<T extends Tag<T>> extends IInstance<T> {
default T withOnpagehide(final String onpagehide_) { default T withOnpagehide(final String onpagehide_) {
return self().attr("onpagehide", onpagehide_); return self().attr("onpagehide", onpagehide_);
} }
default T withCondOnpagehide(final boolean enable, final String onpagehide_) { default T withCondOnpagehide(final boolean enable, final String onpagehide_) {
return enable ? self().attr("onpagehide", onpagehide_) : self(); return enable ? self().attr("onpagehide", onpagehide_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnpageshow<T extends Tag<T>> extends IInstance<T> { public interface IOnpageshow<T extends Tag<T>> extends IInstance<T> {
default T withOnpageshow(final String onpageshow_) { default T withOnpageshow(final String onpageshow_) {
return self().attr("onpageshow", onpageshow_); return self().attr("onpageshow", onpageshow_);
} }
default T withCondOnpageshow(final boolean enable, final String onpageshow_) { default T withCondOnpageshow(final boolean enable, final String onpageshow_) {
return enable ? self().attr("onpageshow", onpageshow_) : self(); return enable ? self().attr("onpageshow", onpageshow_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnpause<T extends Tag<T>> extends IInstance<T> { public interface IOnpause<T extends Tag<T>> extends IInstance<T> {
default T withOnpause(final String onpause_) { default T withOnpause(final String onpause_) {
return self().attr("onpause", onpause_); return self().attr("onpause", onpause_);
} }
default T withCondOnpause(final boolean enable, final String onpause_) { default T withCondOnpause(final boolean enable, final String onpause_) {
return enable ? self().attr("onpause", onpause_) : self(); return enable ? self().attr("onpause", onpause_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnplay<T extends Tag<T>> extends IInstance<T> { public interface IOnplay<T extends Tag<T>> extends IInstance<T> {
default T withOnplay(final String onplay_) { default T withOnplay(final String onplay_) {
return self().attr("onplay", onplay_); return self().attr("onplay", onplay_);
} }
default T withCondOnplay(final boolean enable, final String onplay_) { default T withCondOnplay(final boolean enable, final String onplay_) {
return enable ? self().attr("onplay", onplay_) : self(); return enable ? self().attr("onplay", onplay_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnplaying<T extends Tag<T>> extends IInstance<T> { public interface IOnplaying<T extends Tag<T>> extends IInstance<T> {
default T withOnplaying(final String onplaying_) { default T withOnplaying(final String onplaying_) {
return self().attr("onplaying", onplaying_); return self().attr("onplaying", onplaying_);
} }
default T withCondOnplaying(final boolean enable, final String onplaying_) { default T withCondOnplaying(final boolean enable, final String onplaying_) {
return enable ? self().attr("onplaying", onplaying_) : self(); return enable ? self().attr("onplaying", onplaying_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnpopstate<T extends Tag<T>> extends IInstance<T> { public interface IOnpopstate<T extends Tag<T>> extends IInstance<T> {
default T withOnpopstate(final String onpopstate_) { default T withOnpopstate(final String onpopstate_) {
return self().attr("onpopstate", onpopstate_); return self().attr("onpopstate", onpopstate_);
} }
default T withCondOnpopstate(final boolean enable, final String onpopstate_) { default T withCondOnpopstate(final boolean enable, final String onpopstate_) {
return enable ? self().attr("onpopstate", onpopstate_) : self(); return enable ? self().attr("onpopstate", onpopstate_) : self();
} }
} }

View file

@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
import org.xbib.j2html.tags.Tag; import org.xbib.j2html.tags.Tag;
public interface IOnprogress<T extends Tag<T>> extends IInstance<T> { public interface IOnprogress<T extends Tag<T>> extends IInstance<T> {
default T withOnprogress(final String onprogress_) { default T withOnprogress(final String onprogress_) {
return self().attr("onprogress", onprogress_); return self().attr("onprogress", onprogress_);
} }
default T withCondOnprogress(final boolean enable, final String onprogress_) { default T withCondOnprogress(final boolean enable, final String onprogress_) {
return enable ? self().attr("onprogress", onprogress_) : self(); return enable ? self().attr("onprogress", onprogress_) : self();
} }
} }

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