clean up and reformat code, integrate javapoet, lift tests to java modules
This commit is contained in:
parent
f5d00d8913
commit
b2fda364b5
327 changed files with 9031 additions and 2068 deletions
|
@ -16,14 +16,31 @@ jar {
|
|||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
}
|
||||
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.fork = true
|
||||
options.forkOptions.jvmArgs += ['-Duser.language=en','-Duser.country=US']
|
||||
options.compilerArgs.add('-Xlint:all')
|
||||
options.encoding = 'UTF-8'
|
||||
doFirst {
|
||||
options.fork = true
|
||||
options.forkOptions.jvmArgs += ['-Duser.language=en','-Duser.country=US']
|
||||
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) {
|
||||
options.addStringOption('Xdoclint:none', '-quiet')
|
||||
options.encoding = 'UTF-8'
|
||||
doFirst {
|
||||
options.addStringOption('Xdoclint:none', '-quiet')
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaExec) {
|
||||
doFirst {
|
||||
jvmArguments.add("--module-path")
|
||||
jvmArguments.add(classpath.asPath)
|
||||
classpath = files()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,17 +8,11 @@ dependencies {
|
|||
test {
|
||||
useJUnitPlatform()
|
||||
failFast = false
|
||||
jvmArgs '--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED',
|
||||
'--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED',
|
||||
'--add-exports=java.base/sun.nio.ch=ALL-UNNAMED',
|
||||
'--add-exports=jdk.unsupported/sun.misc=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'
|
||||
// for mockito
|
||||
jvmArgs '--add-modules=jdk.unsupported',
|
||||
'--add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED',
|
||||
'--add-opens=jdk.unsupported/sun.reflect=ALL-UNNAMED'
|
||||
|
||||
systemProperty 'java.util.logging.config.file', 'src/test/resources/logging.properties'
|
||||
testLogging {
|
||||
events 'STARTED', 'PASSED', 'FAILED', 'SKIPPED'
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
dependencies {
|
||||
implementation libs.jsoup
|
||||
implementation libs.javapoet
|
||||
implementation project(':javapoet')
|
||||
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
|
||||
}
|
||||
|
|
7
j2html-codegen/src/main/java/module-info.java
Normal file
7
j2html-codegen/src/main/java/module-info.java
Normal 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;
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
package org.xbib.j2html.codegen;
|
||||
|
||||
import com.squareup.javapoet.ClassName;
|
||||
import com.squareup.javapoet.JavaFile;
|
||||
import com.squareup.javapoet.MethodSpec;
|
||||
import com.squareup.javapoet.ParameterizedTypeName;
|
||||
import com.squareup.javapoet.TypeName;
|
||||
import com.squareup.javapoet.TypeSpec;
|
||||
import com.squareup.javapoet.TypeVariableName;
|
||||
import org.xbib.javapoet.ClassName;
|
||||
import org.xbib.javapoet.JavaFile;
|
||||
import org.xbib.javapoet.MethodSpec;
|
||||
import org.xbib.javapoet.ParameterizedTypeName;
|
||||
import org.xbib.javapoet.TypeName;
|
||||
import org.xbib.javapoet.TypeSpec;
|
||||
import org.xbib.javapoet.TypeVariableName;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.HashMap;
|
||||
|
|
12
j2html-codegen/src/test/java/module-info.java
Normal file
12
j2html-codegen/src/test/java/module-info.java
Normal 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;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.xbib.j2html.codegen;
|
||||
package org.xbib.j2html.codegen.test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -6,12 +6,15 @@ import java.nio.file.Files;
|
|||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
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 {
|
||||
|
||||
@Test
|
||||
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());
|
||||
Model model = new Model();
|
||||
Parser.parse(definitions, model);
|
|
@ -1,4 +1,4 @@
|
|||
package org.xbib.j2html.codegen;
|
||||
package org.xbib.j2html.codegen.test;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.InOrder;
|
|
@ -1,4 +1,4 @@
|
|||
package org.xbib.j2html.codegen.wattsi;
|
||||
package org.xbib.j2html.codegen.test.wattsi;
|
||||
|
||||
public interface AttributeDefinition {
|
||||
|
|
@ -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.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.xbib.j2html.codegen.generators.TagCreatorCodeGenerator;
|
||||
import org.xbib.j2html.codegen.wattsi.ElementDefinition;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
@ -26,8 +23,8 @@ public class CodeGeneratorComplianceTests {
|
|||
|
||||
@BeforeAll
|
||||
public static void setUp() throws IOException {
|
||||
Path source = Paths.get("src","test","resources","2022-01.wattsi");
|
||||
Document doc = Jsoup.parse(source.toFile(), "UTF-8", "https://html.spec.whatwg.org/");
|
||||
InputStream inputStream = CodeGeneratorComplianceTests.class.getResourceAsStream("2022-01.wattsi");
|
||||
Document doc = Jsoup.parse(inputStream, "UTF-8", "https://html.spec.whatwg.org/");
|
||||
specification = new WattsiSource(doc);
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.xbib.j2html.codegen.wattsi;
|
||||
package org.xbib.j2html.codegen.test.wattsi;
|
||||
|
||||
public interface ElementDefinition {
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package org.xbib.j2html.codegen.wattsi;
|
||||
package org.xbib.j2html.codegen.test.wattsi;
|
||||
|
||||
import com.squareup.javapoet.ClassName;
|
||||
import com.squareup.javapoet.MethodSpec;
|
||||
import com.squareup.javapoet.TypeSpec;
|
||||
import org.xbib.javapoet.ClassName;
|
||||
import org.xbib.javapoet.MethodSpec;
|
||||
import org.xbib.javapoet.TypeSpec;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
@ -21,7 +21,7 @@ public class WattsiGenerator {
|
|||
List<AttributeDefinition> attributes = wattsi.attributeDefinitions();
|
||||
for (ElementDefinition element : elements) {
|
||||
ClassName className = ClassName.get(
|
||||
"com.j2html",
|
||||
"org.xbib.j2html",
|
||||
capitalize(element.name()) + "Tag"
|
||||
);
|
||||
TypeSpec.Builder type = TypeSpec.classBuilder(className)
|
|
@ -1,4 +1,4 @@
|
|||
package org.xbib.j2html.codegen.wattsi;
|
||||
package org.xbib.j2html.codegen.test.wattsi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
|
@ -3,3 +3,14 @@ dependencies {
|
|||
testImplementation testLibs.velocity
|
||||
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
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.xbib.j2html;
|
||||
|
||||
import java.util.Collections;
|
||||
import org.xbib.j2html.utils.CSSMin;
|
||||
import org.xbib.j2html.utils.EscapeUtil;
|
||||
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.TextEscaper;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class Config {
|
||||
|
||||
/**
|
||||
|
@ -51,11 +50,11 @@ public class Config {
|
|||
|
||||
|
||||
private Config(
|
||||
TextEscaper _textEscaper,
|
||||
Minifier _cssMinifier,
|
||||
Minifier _jsMinifier,
|
||||
boolean _closeEmptyTags,
|
||||
Indenter _indenter
|
||||
TextEscaper _textEscaper,
|
||||
Minifier _cssMinifier,
|
||||
Minifier _jsMinifier,
|
||||
boolean _closeEmptyTags,
|
||||
Indenter _indenter
|
||||
) {
|
||||
this._textEscaper = _textEscaper;
|
||||
this._cssMinifier = _cssMinifier;
|
||||
|
@ -97,42 +96,42 @@ public class Config {
|
|||
return _indenter;
|
||||
}
|
||||
|
||||
public Config withTextEscaper(TextEscaper textEscaper){
|
||||
public Config withTextEscaper(TextEscaper textEscaper) {
|
||||
Config copy = new Config(this);
|
||||
copy._textEscaper = textEscaper;
|
||||
return copy;
|
||||
}
|
||||
|
||||
public Config withCssMinifier(Minifier cssMinifier){
|
||||
public Config withCssMinifier(Minifier cssMinifier) {
|
||||
Config copy = new Config(this);
|
||||
copy._cssMinifier = cssMinifier;
|
||||
return copy;
|
||||
}
|
||||
|
||||
public Config withJsMinifier(Minifier jsMinifier){
|
||||
public Config withJsMinifier(Minifier jsMinifier) {
|
||||
Config copy = new Config(this);
|
||||
copy._jsMinifier = jsMinifier;
|
||||
return copy;
|
||||
}
|
||||
|
||||
public Config withEmptyTagsClosed(boolean closeEmptyTags){
|
||||
public Config withEmptyTagsClosed(boolean closeEmptyTags) {
|
||||
Config copy = new Config(this);
|
||||
copy._closeEmptyTags = closeEmptyTags;
|
||||
return copy;
|
||||
}
|
||||
|
||||
public Config withIndenter(Indenter indenter){
|
||||
public Config withIndenter(Indenter indenter) {
|
||||
Config copy = new Config(this);
|
||||
copy._indenter = indenter;
|
||||
return copy;
|
||||
}
|
||||
|
||||
private static final Config DEFAULTS = new Config(
|
||||
EscapeUtil::escape,
|
||||
CSSMin::compressCss,
|
||||
JSMin::compressJs,
|
||||
false,
|
||||
(level, text) -> String.join("", Collections.nCopies(level, FOUR_SPACES)) + text
|
||||
EscapeUtil::escape,
|
||||
CSSMin::compressCss,
|
||||
JSMin::compressJs,
|
||||
false,
|
||||
(level, text) -> String.join("", Collections.nCopies(level, FOUR_SPACES)) + text
|
||||
);
|
||||
|
||||
public static Config defaults() {
|
||||
|
@ -141,11 +140,11 @@ public class Config {
|
|||
|
||||
public static Config global() {
|
||||
return new Config(
|
||||
textEscaper,
|
||||
cssMinifier,
|
||||
jsMinifier,
|
||||
closeEmptyTags,
|
||||
indenter
|
||||
textEscaper,
|
||||
cssMinifier,
|
||||
jsMinifier,
|
||||
closeEmptyTags,
|
||||
indenter
|
||||
);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,13 +1,12 @@
|
|||
package org.xbib.j2html.attributes;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.xbib.j2html.Config;
|
||||
import org.xbib.j2html.rendering.TagBuilder;
|
||||
import org.xbib.j2html.tags.Renderable;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Attribute implements Renderable {
|
||||
private String name;
|
||||
private final String name;
|
||||
private String value;
|
||||
|
||||
public Attribute(String name, String value) {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package org.xbib.j2html.rendering;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.xbib.j2html.Config;
|
||||
import org.xbib.j2html.utils.TextEscaper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* using the given Config.
|
||||
*
|
||||
* @param config The Config which will specify text escapement, tag closing, etc.
|
||||
* @return An HtmlBuilder for flat HTML.
|
||||
*/
|
||||
|
@ -135,10 +135,10 @@ public class FlatHtml<T extends Appendable> implements HtmlBuilder<T> {
|
|||
@Override
|
||||
public TagBuilder appendAttribute(String name, String value) throws IOException {
|
||||
out.append(" ")
|
||||
.append(name)
|
||||
.append("=\"")
|
||||
.append(textEscaper.escape(value))
|
||||
.append("\"");
|
||||
.append(name)
|
||||
.append("=\"")
|
||||
.append(textEscaper.escape(value))
|
||||
.append("\"");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
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.util.ArrayDeque;
|
||||
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.
|
||||
|
@ -195,10 +194,10 @@ public class IndentedHtml<T extends Appendable> implements HtmlBuilder<T> {
|
|||
@Override
|
||||
public TagBuilder appendAttribute(String name, String value) throws IOException {
|
||||
out.append(" ")
|
||||
.append(name)
|
||||
.append("=\"")
|
||||
.append(textEscaper.escape(value))
|
||||
.append("\"");
|
||||
.append(name)
|
||||
.append("=\"")
|
||||
.append(textEscaper.escape(value))
|
||||
.append("\"");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
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.util.ArrayList;
|
||||
import java.util.List;
|
||||
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> {
|
||||
|
||||
|
@ -148,7 +147,7 @@ public class ContainerTag<T extends ContainerTag<T>> extends Tag<T> {
|
|||
public String renderFormatted() {
|
||||
try {
|
||||
return render(IndentedHtml.into(new StringBuilder(), Config.global())).toString();
|
||||
}catch (IOException e) {
|
||||
} catch (IOException 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 {
|
||||
if (hasTagName()) {
|
||||
TagBuilder tagBuilder = builder.appendStartTag(getTagName());
|
||||
for(Attribute attribute : getAttributes()){
|
||||
for (Attribute attribute : getAttributes()) {
|
||||
attribute.render(tagBuilder, model);
|
||||
}
|
||||
tagBuilder.completeTag();
|
||||
}
|
||||
|
||||
for(DomContent child : children){
|
||||
for (DomContent child : children) {
|
||||
child.render(builder, model);
|
||||
}
|
||||
|
||||
if(hasTagName()) {
|
||||
if (hasTagName()) {
|
||||
builder.appendEndTag(getTagName());
|
||||
}
|
||||
|
||||
|
@ -178,8 +177,8 @@ public class ContainerTag<T extends ContainerTag<T>> extends Tag<T> {
|
|||
@Deprecated
|
||||
public void renderModel(Appendable writer, Object model) throws IOException {
|
||||
HtmlBuilder<?> builder = (writer instanceof HtmlBuilder)
|
||||
? (HtmlBuilder<?>) writer
|
||||
: FlatHtml.into(writer, Config.global());
|
||||
? (HtmlBuilder<?>) writer
|
||||
: FlatHtml.into(writer, Config.global());
|
||||
|
||||
render(builder, model);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public class DomContentJoiner {
|
|||
} else {
|
||||
throw new RuntimeException("You can only join DomContent and String objects");
|
||||
}
|
||||
if (i < stringOrDomObjects.length-1) {
|
||||
if (i < stringOrDomObjects.length - 1) {
|
||||
sb.append(delimiter);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package org.xbib.j2html.tags;
|
||||
|
||||
import java.io.IOException;
|
||||
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 java.io.IOException;
|
||||
import org.xbib.j2html.rendering.TagBuilder;
|
||||
|
||||
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
|
||||
public void renderModel(Appendable writer, Object model) throws IOException {
|
||||
HtmlBuilder<?> builder = (writer instanceof HtmlBuilder)
|
||||
? (HtmlBuilder<?>) writer
|
||||
: FlatHtml.into(writer, Config.global());
|
||||
? (HtmlBuilder<?>) writer
|
||||
: FlatHtml.into(writer, Config.global());
|
||||
|
||||
render(builder, model);
|
||||
}
|
||||
|
|
|
@ -1,43 +1,29 @@
|
|||
package org.xbib.j2html.tags;
|
||||
|
||||
import org.xbib.j2html.Config;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
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.script;
|
||||
import static org.xbib.j2html.TagCreator.style;
|
||||
|
||||
public class InlineStaticResource {
|
||||
|
||||
public static ContainerTag<? extends Tag<?>> get(String path, 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) {
|
||||
public static ContainerTag<? extends Tag<?>> get(InputStream inputStream, TargetFormat format) {
|
||||
try {
|
||||
return streamToString(InlineStaticResource.class.getResourceAsStream(path));
|
||||
} catch (Exception expected) {
|
||||
try {
|
||||
return streamToString(new FileInputStream(path));
|
||||
} catch (Exception exception) {
|
||||
throw new RuntimeException("Couldn't find file with path='" + path + "'");
|
||||
}
|
||||
String fileString = new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);
|
||||
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));
|
||||
};
|
||||
} 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}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
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.UncheckedIOException;
|
||||
import org.xbib.j2html.Config;
|
||||
import org.xbib.j2html.rendering.FlatHtml;
|
||||
import org.xbib.j2html.rendering.HtmlBuilder;
|
||||
|
||||
public interface Renderable {
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package org.xbib.j2html.tags;
|
||||
|
||||
import org.xbib.j2html.attributes.Attr;
|
||||
import org.xbib.j2html.attributes.Attribute;
|
||||
import java.util.ArrayList;
|
||||
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> {
|
||||
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 value the attribute value
|
||||
*/
|
||||
boolean setAttribute(String name, String value) {
|
||||
public boolean setAttribute(String name, String value) {
|
||||
if (value == null) {
|
||||
return attributes.add(new Attribute(name));
|
||||
}
|
||||
|
@ -146,68 +146,132 @@ public abstract class Tag<T extends Tag<T>> extends DomContent implements IInsta
|
|||
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 -----
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package org.xbib.j2html.tags;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.xbib.j2html.Config;
|
||||
import org.xbib.j2html.rendering.FlatHtml;
|
||||
import org.xbib.j2html.rendering.HtmlBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Text extends DomContent {
|
||||
|
||||
private final String text;
|
||||
|
@ -24,8 +23,8 @@ public class Text extends DomContent {
|
|||
@Deprecated
|
||||
public void renderModel(Appendable writer, Object model) throws IOException {
|
||||
HtmlBuilder<?> builder = (writer instanceof HtmlBuilder)
|
||||
? (HtmlBuilder<?>) writer
|
||||
: FlatHtml.into(writer, Config.global());
|
||||
? (HtmlBuilder<?>) writer
|
||||
: FlatHtml.into(writer, Config.global());
|
||||
|
||||
render(builder, model);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package org.xbib.j2html.tags;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.xbib.j2html.Config;
|
||||
import org.xbib.j2html.rendering.FlatHtml;
|
||||
import org.xbib.j2html.rendering.HtmlBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class UnescapedText extends DomContent {
|
||||
|
||||
private final String text;
|
||||
|
@ -24,8 +23,8 @@ public class UnescapedText extends DomContent {
|
|||
@Deprecated
|
||||
public void renderModel(Appendable writer, Object model) throws IOException {
|
||||
HtmlBuilder<?> builder = (writer instanceof HtmlBuilder)
|
||||
? (HtmlBuilder<?>) writer
|
||||
: FlatHtml.into(writer, Config.global());
|
||||
? (HtmlBuilder<?>) writer
|
||||
: FlatHtml.into(writer, Config.global());
|
||||
|
||||
render(builder, model);
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IAccept<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withAccept(final String accept_) {
|
||||
return self().attr("accept", accept_);
|
||||
}
|
||||
default T withAccept(final String accept_) {
|
||||
return self().attr("accept", accept_);
|
||||
}
|
||||
|
||||
default T withCondAccept(final boolean enable, final String accept_) {
|
||||
return enable ? self().attr("accept", accept_) : self();
|
||||
}
|
||||
default T withCondAccept(final boolean enable, final String accept_) {
|
||||
return enable ? self().attr("accept", accept_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IAction<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withAction(final String action_) {
|
||||
return self().attr("action", action_);
|
||||
}
|
||||
default T withAction(final String action_) {
|
||||
return self().attr("action", action_);
|
||||
}
|
||||
|
||||
default T withCondAction(final boolean enable, final String action_) {
|
||||
return enable ? self().attr("action", action_) : self();
|
||||
}
|
||||
default T withCondAction(final boolean enable, final String action_) {
|
||||
return enable ? self().attr("action", action_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IAlt<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withAlt(final String alt_) {
|
||||
return self().attr("alt", alt_);
|
||||
}
|
||||
default T withAlt(final String alt_) {
|
||||
return self().attr("alt", alt_);
|
||||
}
|
||||
|
||||
default T withCondAlt(final boolean enable, final String alt_) {
|
||||
return enable ? self().attr("alt", alt_) : self();
|
||||
}
|
||||
default T withCondAlt(final boolean enable, final String alt_) {
|
||||
return enable ? self().attr("alt", alt_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IAsync<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isAsync() {
|
||||
return self().attr("async");
|
||||
}
|
||||
default T isAsync() {
|
||||
return self().attr("async");
|
||||
}
|
||||
|
||||
default T withCondAsync(final boolean enable) {
|
||||
return enable ? self().attr("async") : self();
|
||||
}
|
||||
default T withCondAsync(final boolean enable) {
|
||||
return enable ? self().attr("async") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IAutocomplete<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isAutocomplete() {
|
||||
return self().attr("autocomplete", "on");
|
||||
}
|
||||
default T isAutocomplete() {
|
||||
return self().attr("autocomplete", "on");
|
||||
}
|
||||
|
||||
default T withCondAutocomplete(final boolean enable) {
|
||||
return enable ? self().attr("autocomplete", "on") : self();
|
||||
}
|
||||
default T withCondAutocomplete(final boolean enable) {
|
||||
return enable ? self().attr("autocomplete", "on") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IAutofocus<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isAutofocus() {
|
||||
return self().attr("autofocus");
|
||||
}
|
||||
default T isAutofocus() {
|
||||
return self().attr("autofocus");
|
||||
}
|
||||
|
||||
default T withCondAutofocus(final boolean enable) {
|
||||
return enable ? self().attr("autofocus") : self();
|
||||
}
|
||||
default T withCondAutofocus(final boolean enable) {
|
||||
return enable ? self().attr("autofocus") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IAutoplay<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isAutoplay() {
|
||||
return self().attr("autoplay");
|
||||
}
|
||||
default T isAutoplay() {
|
||||
return self().attr("autoplay");
|
||||
}
|
||||
|
||||
default T withCondAutoplay(final boolean enable) {
|
||||
return enable ? self().attr("autoplay") : self();
|
||||
}
|
||||
default T withCondAutoplay(final boolean enable) {
|
||||
return enable ? self().attr("autoplay") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface ICharset<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withCharset(final String charset_) {
|
||||
return self().attr("charset", charset_);
|
||||
}
|
||||
default T withCharset(final String charset_) {
|
||||
return self().attr("charset", charset_);
|
||||
}
|
||||
|
||||
default T withCondCharset(final boolean enable, final String charset_) {
|
||||
return enable ? self().attr("charset", charset_) : self();
|
||||
}
|
||||
default T withCondCharset(final boolean enable, final String charset_) {
|
||||
return enable ? self().attr("charset", charset_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IChecked<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isChecked() {
|
||||
return self().attr("checked");
|
||||
}
|
||||
default T isChecked() {
|
||||
return self().attr("checked");
|
||||
}
|
||||
|
||||
default T withCondChecked(final boolean enable) {
|
||||
return enable ? self().attr("checked") : self();
|
||||
}
|
||||
default T withCondChecked(final boolean enable) {
|
||||
return enable ? self().attr("checked") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface ICite<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withCite(final String cite_) {
|
||||
return self().attr("cite", cite_);
|
||||
}
|
||||
default T withCite(final String cite_) {
|
||||
return self().attr("cite", cite_);
|
||||
}
|
||||
|
||||
default T withCondCite(final boolean enable, final String cite_) {
|
||||
return enable ? self().attr("cite", cite_) : self();
|
||||
}
|
||||
default T withCondCite(final boolean enable, final String cite_) {
|
||||
return enable ? self().attr("cite", cite_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface ICols<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withCols(final String cols_) {
|
||||
return self().attr("cols", cols_);
|
||||
}
|
||||
default T withCols(final String cols_) {
|
||||
return self().attr("cols", cols_);
|
||||
}
|
||||
|
||||
default T withCondCols(final boolean enable, final String cols_) {
|
||||
return enable ? self().attr("cols", cols_) : self();
|
||||
}
|
||||
default T withCondCols(final boolean enable, final String cols_) {
|
||||
return enable ? self().attr("cols", cols_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IColspan<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withColspan(final String colspan_) {
|
||||
return self().attr("colspan", colspan_);
|
||||
}
|
||||
default T withColspan(final String colspan_) {
|
||||
return self().attr("colspan", colspan_);
|
||||
}
|
||||
|
||||
default T withCondColspan(final boolean enable, final String colspan_) {
|
||||
return enable ? self().attr("colspan", colspan_) : self();
|
||||
}
|
||||
default T withCondColspan(final boolean enable, final String colspan_) {
|
||||
return enable ? self().attr("colspan", colspan_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IContent<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withContent(final String content_) {
|
||||
return self().attr("content", content_);
|
||||
}
|
||||
default T withContent(final String content_) {
|
||||
return self().attr("content", content_);
|
||||
}
|
||||
|
||||
default T withCondContent(final boolean enable, final String content_) {
|
||||
return enable ? self().attr("content", content_) : self();
|
||||
}
|
||||
default T withCondContent(final boolean enable, final String content_) {
|
||||
return enable ? self().attr("content", content_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IControls<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isControls() {
|
||||
return self().attr("controls");
|
||||
}
|
||||
default T isControls() {
|
||||
return self().attr("controls");
|
||||
}
|
||||
|
||||
default T withCondControls(final boolean enable) {
|
||||
return enable ? self().attr("controls") : self();
|
||||
}
|
||||
default T withCondControls(final boolean enable) {
|
||||
return enable ? self().attr("controls") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface ICoords<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withCoords(final String coords_) {
|
||||
return self().attr("coords", coords_);
|
||||
}
|
||||
default T withCoords(final String coords_) {
|
||||
return self().attr("coords", coords_);
|
||||
}
|
||||
|
||||
default T withCondCoords(final boolean enable, final String coords_) {
|
||||
return enable ? self().attr("coords", coords_) : self();
|
||||
}
|
||||
default T withCondCoords(final boolean enable, final String coords_) {
|
||||
return enable ? self().attr("coords", coords_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IData<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withData(final String data_) {
|
||||
return self().attr("data", data_);
|
||||
}
|
||||
default T withData(final String data_) {
|
||||
return self().attr("data", data_);
|
||||
}
|
||||
|
||||
default T withCondData(final boolean enable, final String data_) {
|
||||
return enable ? self().attr("data", data_) : self();
|
||||
}
|
||||
default T withCondData(final boolean enable, final String data_) {
|
||||
return enable ? self().attr("data", data_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IDatetime<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withDatetime(final String datetime_) {
|
||||
return self().attr("datetime", datetime_);
|
||||
}
|
||||
default T withDatetime(final String datetime_) {
|
||||
return self().attr("datetime", datetime_);
|
||||
}
|
||||
|
||||
default T withCondDatetime(final boolean enable, final String datetime_) {
|
||||
return enable ? self().attr("datetime", datetime_) : self();
|
||||
}
|
||||
default T withCondDatetime(final boolean enable, final String datetime_) {
|
||||
return enable ? self().attr("datetime", datetime_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IDefault<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isDefault() {
|
||||
return self().attr("default");
|
||||
}
|
||||
default T isDefault() {
|
||||
return self().attr("default");
|
||||
}
|
||||
|
||||
default T withCondDefault(final boolean enable) {
|
||||
return enable ? self().attr("default") : self();
|
||||
}
|
||||
default T withCondDefault(final boolean enable) {
|
||||
return enable ? self().attr("default") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IDefer<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isDefer() {
|
||||
return self().attr("defer");
|
||||
}
|
||||
default T isDefer() {
|
||||
return self().attr("defer");
|
||||
}
|
||||
|
||||
default T withCondDefer(final boolean enable) {
|
||||
return enable ? self().attr("defer") : self();
|
||||
}
|
||||
default T withCondDefer(final boolean enable) {
|
||||
return enable ? self().attr("defer") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IDirname<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withDirname(final String dirname_) {
|
||||
return self().attr("dirname", dirname_);
|
||||
}
|
||||
default T withDirname(final String dirname_) {
|
||||
return self().attr("dirname", dirname_);
|
||||
}
|
||||
|
||||
default T withCondDirname(final boolean enable, final String dirname_) {
|
||||
return enable ? self().attr("dirname", dirname_) : self();
|
||||
}
|
||||
default T withCondDirname(final boolean enable, final String dirname_) {
|
||||
return enable ? self().attr("dirname", dirname_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IDisabled<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isDisabled() {
|
||||
return self().attr("disabled");
|
||||
}
|
||||
default T isDisabled() {
|
||||
return self().attr("disabled");
|
||||
}
|
||||
|
||||
default T withCondDisabled(final boolean enable) {
|
||||
return enable ? self().attr("disabled") : self();
|
||||
}
|
||||
default T withCondDisabled(final boolean enable) {
|
||||
return enable ? self().attr("disabled") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IDownload<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isDownload() {
|
||||
return self().attr("download");
|
||||
}
|
||||
default T isDownload() {
|
||||
return self().attr("download");
|
||||
}
|
||||
|
||||
default T withCondDownload(final boolean enable) {
|
||||
return enable ? self().attr("download") : self();
|
||||
}
|
||||
default T withCondDownload(final boolean enable) {
|
||||
return enable ? self().attr("download") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IEnctype<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withEnctype(final String enctype_) {
|
||||
return self().attr("enctype", enctype_);
|
||||
}
|
||||
default T withEnctype(final String enctype_) {
|
||||
return self().attr("enctype", enctype_);
|
||||
}
|
||||
|
||||
default T withCondEnctype(final boolean enable, final String enctype_) {
|
||||
return enable ? self().attr("enctype", enctype_) : self();
|
||||
}
|
||||
default T withCondEnctype(final boolean enable, final String enctype_) {
|
||||
return enable ? self().attr("enctype", enctype_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IFor<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withFor(final String for_) {
|
||||
return self().attr("for", for_);
|
||||
}
|
||||
default T withFor(final String for_) {
|
||||
return self().attr("for", for_);
|
||||
}
|
||||
|
||||
default T withCondFor(final boolean enable, final String for_) {
|
||||
return enable ? self().attr("for", for_) : self();
|
||||
}
|
||||
default T withCondFor(final boolean enable, final String for_) {
|
||||
return enable ? self().attr("for", for_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IForm<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withForm(final String form_) {
|
||||
return self().attr("form", form_);
|
||||
}
|
||||
default T withForm(final String form_) {
|
||||
return self().attr("form", form_);
|
||||
}
|
||||
|
||||
default T withCondForm(final boolean enable, final String form_) {
|
||||
return enable ? self().attr("form", form_) : self();
|
||||
}
|
||||
default T withCondForm(final boolean enable, final String form_) {
|
||||
return enable ? self().attr("form", form_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IFormaction<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withFormaction(final String formaction_) {
|
||||
return self().attr("formaction", formaction_);
|
||||
}
|
||||
default T withFormaction(final String formaction_) {
|
||||
return self().attr("formaction", formaction_);
|
||||
}
|
||||
|
||||
default T withCondFormaction(final boolean enable, final String formaction_) {
|
||||
return enable ? self().attr("formaction", formaction_) : self();
|
||||
}
|
||||
default T withCondFormaction(final boolean enable, final String formaction_) {
|
||||
return enable ? self().attr("formaction", formaction_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IHeaders<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withHeaders(final String headers_) {
|
||||
return self().attr("headers", headers_);
|
||||
}
|
||||
default T withHeaders(final String headers_) {
|
||||
return self().attr("headers", headers_);
|
||||
}
|
||||
|
||||
default T withCondHeaders(final boolean enable, final String headers_) {
|
||||
return enable ? self().attr("headers", headers_) : self();
|
||||
}
|
||||
default T withCondHeaders(final boolean enable, final String headers_) {
|
||||
return enable ? self().attr("headers", headers_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IHeight<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withHeight(final String height_) {
|
||||
return self().attr("height", height_);
|
||||
}
|
||||
default T withHeight(final String height_) {
|
||||
return self().attr("height", height_);
|
||||
}
|
||||
|
||||
default T withCondHeight(final boolean enable, final String height_) {
|
||||
return enable ? self().attr("height", height_) : self();
|
||||
}
|
||||
default T withCondHeight(final boolean enable, final String height_) {
|
||||
return enable ? self().attr("height", height_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IHigh<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withHigh(final String high_) {
|
||||
return self().attr("high", high_);
|
||||
}
|
||||
default T withHigh(final String high_) {
|
||||
return self().attr("high", high_);
|
||||
}
|
||||
|
||||
default T withCondHigh(final boolean enable, final String high_) {
|
||||
return enable ? self().attr("high", high_) : self();
|
||||
}
|
||||
default T withCondHigh(final boolean enable, final String high_) {
|
||||
return enable ? self().attr("high", high_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IHref<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withHref(final String href_) {
|
||||
return self().attr("href", href_);
|
||||
}
|
||||
default T withHref(final String href_) {
|
||||
return self().attr("href", href_);
|
||||
}
|
||||
|
||||
default T withCondHref(final boolean enable, final String href_) {
|
||||
return enable ? self().attr("href", href_) : self();
|
||||
}
|
||||
default T withCondHref(final boolean enable, final String href_) {
|
||||
return enable ? self().attr("href", href_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IHreflang<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withHreflang(final String hreflang_) {
|
||||
return self().attr("hreflang", hreflang_);
|
||||
}
|
||||
default T withHreflang(final String hreflang_) {
|
||||
return self().attr("hreflang", hreflang_);
|
||||
}
|
||||
|
||||
default T withCondHreflang(final boolean enable, final String hreflang_) {
|
||||
return enable ? self().attr("hreflang", hreflang_) : self();
|
||||
}
|
||||
default T withCondHreflang(final boolean enable, final String hreflang_) {
|
||||
return enable ? self().attr("hreflang", hreflang_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IIsmap<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isIsmap() {
|
||||
return self().attr("ismap");
|
||||
}
|
||||
default T isIsmap() {
|
||||
return self().attr("ismap");
|
||||
}
|
||||
|
||||
default T withCondIsmap(final boolean enable) {
|
||||
return enable ? self().attr("ismap") : self();
|
||||
}
|
||||
default T withCondIsmap(final boolean enable) {
|
||||
return enable ? self().attr("ismap") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IKind<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withKind(final String kind_) {
|
||||
return self().attr("kind", kind_);
|
||||
}
|
||||
default T withKind(final String kind_) {
|
||||
return self().attr("kind", kind_);
|
||||
}
|
||||
|
||||
default T withCondKind(final boolean enable, final String kind_) {
|
||||
return enable ? self().attr("kind", kind_) : self();
|
||||
}
|
||||
default T withCondKind(final boolean enable, final String kind_) {
|
||||
return enable ? self().attr("kind", kind_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface ILabel<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withLabel(final String label_) {
|
||||
return self().attr("label", label_);
|
||||
}
|
||||
default T withLabel(final String label_) {
|
||||
return self().attr("label", label_);
|
||||
}
|
||||
|
||||
default T withCondLabel(final boolean enable, final String label_) {
|
||||
return enable ? self().attr("label", label_) : self();
|
||||
}
|
||||
default T withCondLabel(final boolean enable, final String label_) {
|
||||
return enable ? self().attr("label", label_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IList<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withList(final String list_) {
|
||||
return self().attr("list", list_);
|
||||
}
|
||||
default T withList(final String list_) {
|
||||
return self().attr("list", list_);
|
||||
}
|
||||
|
||||
default T withCondList(final boolean enable, final String list_) {
|
||||
return enable ? self().attr("list", list_) : self();
|
||||
}
|
||||
default T withCondList(final boolean enable, final String list_) {
|
||||
return enable ? self().attr("list", list_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface ILoop<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isLoop() {
|
||||
return self().attr("loop");
|
||||
}
|
||||
default T isLoop() {
|
||||
return self().attr("loop");
|
||||
}
|
||||
|
||||
default T withCondLoop(final boolean enable) {
|
||||
return enable ? self().attr("loop") : self();
|
||||
}
|
||||
default T withCondLoop(final boolean enable) {
|
||||
return enable ? self().attr("loop") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface ILow<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withLow(final String low_) {
|
||||
return self().attr("low", low_);
|
||||
}
|
||||
default T withLow(final String low_) {
|
||||
return self().attr("low", low_);
|
||||
}
|
||||
|
||||
default T withCondLow(final boolean enable, final String low_) {
|
||||
return enable ? self().attr("low", low_) : self();
|
||||
}
|
||||
default T withCondLow(final boolean enable, final String low_) {
|
||||
return enable ? self().attr("low", low_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IMax<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withMax(final String max_) {
|
||||
return self().attr("max", max_);
|
||||
}
|
||||
default T withMax(final String max_) {
|
||||
return self().attr("max", max_);
|
||||
}
|
||||
|
||||
default T withCondMax(final boolean enable, final String max_) {
|
||||
return enable ? self().attr("max", max_) : self();
|
||||
}
|
||||
default T withCondMax(final boolean enable, final String max_) {
|
||||
return enable ? self().attr("max", max_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IMaxlength<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withMaxlength(final String maxlength_) {
|
||||
return self().attr("maxlength", maxlength_);
|
||||
}
|
||||
default T withMaxlength(final String maxlength_) {
|
||||
return self().attr("maxlength", maxlength_);
|
||||
}
|
||||
|
||||
default T withCondMaxlength(final boolean enable, final String maxlength_) {
|
||||
return enable ? self().attr("maxlength", maxlength_) : self();
|
||||
}
|
||||
default T withCondMaxlength(final boolean enable, final String maxlength_) {
|
||||
return enable ? self().attr("maxlength", maxlength_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IMedia<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withMedia(final String media_) {
|
||||
return self().attr("media", media_);
|
||||
}
|
||||
default T withMedia(final String media_) {
|
||||
return self().attr("media", media_);
|
||||
}
|
||||
|
||||
default T withCondMedia(final boolean enable, final String media_) {
|
||||
return enable ? self().attr("media", media_) : self();
|
||||
}
|
||||
default T withCondMedia(final boolean enable, final String media_) {
|
||||
return enable ? self().attr("media", media_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IMethod<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withMethod(final String method_) {
|
||||
return self().attr("method", method_);
|
||||
}
|
||||
default T withMethod(final String method_) {
|
||||
return self().attr("method", method_);
|
||||
}
|
||||
|
||||
default T withCondMethod(final boolean enable, final String method_) {
|
||||
return enable ? self().attr("method", method_) : self();
|
||||
}
|
||||
default T withCondMethod(final boolean enable, final String method_) {
|
||||
return enable ? self().attr("method", method_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IMin<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withMin(final String min_) {
|
||||
return self().attr("min", min_);
|
||||
}
|
||||
default T withMin(final String min_) {
|
||||
return self().attr("min", min_);
|
||||
}
|
||||
|
||||
default T withCondMin(final boolean enable, final String min_) {
|
||||
return enable ? self().attr("min", min_) : self();
|
||||
}
|
||||
default T withCondMin(final boolean enable, final String min_) {
|
||||
return enable ? self().attr("min", min_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IMultiple<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isMultiple() {
|
||||
return self().attr("multiple");
|
||||
}
|
||||
default T isMultiple() {
|
||||
return self().attr("multiple");
|
||||
}
|
||||
|
||||
default T withCondMultiple(final boolean enable) {
|
||||
return enable ? self().attr("multiple") : self();
|
||||
}
|
||||
default T withCondMultiple(final boolean enable) {
|
||||
return enable ? self().attr("multiple") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IMuted<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isMuted() {
|
||||
return self().attr("muted");
|
||||
}
|
||||
default T isMuted() {
|
||||
return self().attr("muted");
|
||||
}
|
||||
|
||||
default T withCondMuted(final boolean enable) {
|
||||
return enable ? self().attr("muted") : self();
|
||||
}
|
||||
default T withCondMuted(final boolean enable) {
|
||||
return enable ? self().attr("muted") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IName<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withName(final String name_) {
|
||||
return self().attr("name", name_);
|
||||
}
|
||||
default T withName(final String name_) {
|
||||
return self().attr("name", name_);
|
||||
}
|
||||
|
||||
default T withCondName(final boolean enable, final String name_) {
|
||||
return enable ? self().attr("name", name_) : self();
|
||||
}
|
||||
default T withCondName(final boolean enable, final String name_) {
|
||||
return enable ? self().attr("name", name_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface INovalidate<T extends Tag<T>> extends IInstance<T> {
|
||||
default T isNovalidate() {
|
||||
return self().attr("novalidate");
|
||||
}
|
||||
default T isNovalidate() {
|
||||
return self().attr("novalidate");
|
||||
}
|
||||
|
||||
default T withCondNovalidate(final boolean enable) {
|
||||
return enable ? self().attr("novalidate") : self();
|
||||
}
|
||||
default T withCondNovalidate(final boolean enable) {
|
||||
return enable ? self().attr("novalidate") : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnabort<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnabort(final String onabort_) {
|
||||
return self().attr("onabort", onabort_);
|
||||
}
|
||||
default T withOnabort(final String onabort_) {
|
||||
return self().attr("onabort", onabort_);
|
||||
}
|
||||
|
||||
default T withCondOnabort(final boolean enable, final String onabort_) {
|
||||
return enable ? self().attr("onabort", onabort_) : self();
|
||||
}
|
||||
default T withCondOnabort(final boolean enable, final String onabort_) {
|
||||
return enable ? self().attr("onabort", onabort_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnafterprint<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnafterprint(final String onafterprint_) {
|
||||
return self().attr("onafterprint", onafterprint_);
|
||||
}
|
||||
default T withOnafterprint(final String onafterprint_) {
|
||||
return self().attr("onafterprint", onafterprint_);
|
||||
}
|
||||
|
||||
default T withCondOnafterprint(final boolean enable, final String onafterprint_) {
|
||||
return enable ? self().attr("onafterprint", onafterprint_) : self();
|
||||
}
|
||||
default T withCondOnafterprint(final boolean enable, final String onafterprint_) {
|
||||
return enable ? self().attr("onafterprint", onafterprint_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnbeforeprint<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnbeforeprint(final String onbeforeprint_) {
|
||||
return self().attr("onbeforeprint", onbeforeprint_);
|
||||
}
|
||||
default T withOnbeforeprint(final String onbeforeprint_) {
|
||||
return self().attr("onbeforeprint", onbeforeprint_);
|
||||
}
|
||||
|
||||
default T withCondOnbeforeprint(final boolean enable, final String onbeforeprint_) {
|
||||
return enable ? self().attr("onbeforeprint", onbeforeprint_) : self();
|
||||
}
|
||||
default T withCondOnbeforeprint(final boolean enable, final String onbeforeprint_) {
|
||||
return enable ? self().attr("onbeforeprint", onbeforeprint_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnbeforeunload<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnbeforeunload(final String onbeforeunload_) {
|
||||
return self().attr("onbeforeunload", onbeforeunload_);
|
||||
}
|
||||
default T withOnbeforeunload(final String onbeforeunload_) {
|
||||
return self().attr("onbeforeunload", onbeforeunload_);
|
||||
}
|
||||
|
||||
default T withCondOnbeforeunload(final boolean enable, final String onbeforeunload_) {
|
||||
return enable ? self().attr("onbeforeunload", onbeforeunload_) : self();
|
||||
}
|
||||
default T withCondOnbeforeunload(final boolean enable, final String onbeforeunload_) {
|
||||
return enable ? self().attr("onbeforeunload", onbeforeunload_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOncanplay<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOncanplay(final String oncanplay_) {
|
||||
return self().attr("oncanplay", oncanplay_);
|
||||
}
|
||||
default T withOncanplay(final String oncanplay_) {
|
||||
return self().attr("oncanplay", oncanplay_);
|
||||
}
|
||||
|
||||
default T withCondOncanplay(final boolean enable, final String oncanplay_) {
|
||||
return enable ? self().attr("oncanplay", oncanplay_) : self();
|
||||
}
|
||||
default T withCondOncanplay(final boolean enable, final String oncanplay_) {
|
||||
return enable ? self().attr("oncanplay", oncanplay_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOncanplaythrough<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOncanplaythrough(final String oncanplaythrough_) {
|
||||
return self().attr("oncanplaythrough", oncanplaythrough_);
|
||||
}
|
||||
default T withOncanplaythrough(final String oncanplaythrough_) {
|
||||
return self().attr("oncanplaythrough", oncanplaythrough_);
|
||||
}
|
||||
|
||||
default T withCondOncanplaythrough(final boolean enable, final String oncanplaythrough_) {
|
||||
return enable ? self().attr("oncanplaythrough", oncanplaythrough_) : self();
|
||||
}
|
||||
default T withCondOncanplaythrough(final boolean enable, final String oncanplaythrough_) {
|
||||
return enable ? self().attr("oncanplaythrough", oncanplaythrough_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOncuechange<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOncuechange(final String oncuechange_) {
|
||||
return self().attr("oncuechange", oncuechange_);
|
||||
}
|
||||
default T withOncuechange(final String oncuechange_) {
|
||||
return self().attr("oncuechange", oncuechange_);
|
||||
}
|
||||
|
||||
default T withCondOncuechange(final boolean enable, final String oncuechange_) {
|
||||
return enable ? self().attr("oncuechange", oncuechange_) : self();
|
||||
}
|
||||
default T withCondOncuechange(final boolean enable, final String oncuechange_) {
|
||||
return enable ? self().attr("oncuechange", oncuechange_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOndurationchange<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOndurationchange(final String ondurationchange_) {
|
||||
return self().attr("ondurationchange", ondurationchange_);
|
||||
}
|
||||
default T withOndurationchange(final String ondurationchange_) {
|
||||
return self().attr("ondurationchange", ondurationchange_);
|
||||
}
|
||||
|
||||
default T withCondOndurationchange(final boolean enable, final String ondurationchange_) {
|
||||
return enable ? self().attr("ondurationchange", ondurationchange_) : self();
|
||||
}
|
||||
default T withCondOndurationchange(final boolean enable, final String ondurationchange_) {
|
||||
return enable ? self().attr("ondurationchange", ondurationchange_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnemptied<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnemptied(final String onemptied_) {
|
||||
return self().attr("onemptied", onemptied_);
|
||||
}
|
||||
default T withOnemptied(final String onemptied_) {
|
||||
return self().attr("onemptied", onemptied_);
|
||||
}
|
||||
|
||||
default T withCondOnemptied(final boolean enable, final String onemptied_) {
|
||||
return enable ? self().attr("onemptied", onemptied_) : self();
|
||||
}
|
||||
default T withCondOnemptied(final boolean enable, final String onemptied_) {
|
||||
return enable ? self().attr("onemptied", onemptied_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnended<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnended(final String onended_) {
|
||||
return self().attr("onended", onended_);
|
||||
}
|
||||
default T withOnended(final String onended_) {
|
||||
return self().attr("onended", onended_);
|
||||
}
|
||||
|
||||
default T withCondOnended(final boolean enable, final String onended_) {
|
||||
return enable ? self().attr("onended", onended_) : self();
|
||||
}
|
||||
default T withCondOnended(final boolean enable, final String onended_) {
|
||||
return enable ? self().attr("onended", onended_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnerror<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnerror(final String onerror_) {
|
||||
return self().attr("onerror", onerror_);
|
||||
}
|
||||
default T withOnerror(final String onerror_) {
|
||||
return self().attr("onerror", onerror_);
|
||||
}
|
||||
|
||||
default T withCondOnerror(final boolean enable, final String onerror_) {
|
||||
return enable ? self().attr("onerror", onerror_) : self();
|
||||
}
|
||||
default T withCondOnerror(final boolean enable, final String onerror_) {
|
||||
return enable ? self().attr("onerror", onerror_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnhashchange<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnhashchange(final String onhashchange_) {
|
||||
return self().attr("onhashchange", onhashchange_);
|
||||
}
|
||||
default T withOnhashchange(final String onhashchange_) {
|
||||
return self().attr("onhashchange", onhashchange_);
|
||||
}
|
||||
|
||||
default T withCondOnhashchange(final boolean enable, final String onhashchange_) {
|
||||
return enable ? self().attr("onhashchange", onhashchange_) : self();
|
||||
}
|
||||
default T withCondOnhashchange(final boolean enable, final String onhashchange_) {
|
||||
return enable ? self().attr("onhashchange", onhashchange_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnload<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnload(final String onload_) {
|
||||
return self().attr("onload", onload_);
|
||||
}
|
||||
default T withOnload(final String onload_) {
|
||||
return self().attr("onload", onload_);
|
||||
}
|
||||
|
||||
default T withCondOnload(final boolean enable, final String onload_) {
|
||||
return enable ? self().attr("onload", onload_) : self();
|
||||
}
|
||||
default T withCondOnload(final boolean enable, final String onload_) {
|
||||
return enable ? self().attr("onload", onload_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnloadeddata<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnloadeddata(final String onloadeddata_) {
|
||||
return self().attr("onloadeddata", onloadeddata_);
|
||||
}
|
||||
default T withOnloadeddata(final String onloadeddata_) {
|
||||
return self().attr("onloadeddata", onloadeddata_);
|
||||
}
|
||||
|
||||
default T withCondOnloadeddata(final boolean enable, final String onloadeddata_) {
|
||||
return enable ? self().attr("onloadeddata", onloadeddata_) : self();
|
||||
}
|
||||
default T withCondOnloadeddata(final boolean enable, final String onloadeddata_) {
|
||||
return enable ? self().attr("onloadeddata", onloadeddata_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnloadedmetadata<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnloadedmetadata(final String onloadedmetadata_) {
|
||||
return self().attr("onloadedmetadata", onloadedmetadata_);
|
||||
}
|
||||
default T withOnloadedmetadata(final String onloadedmetadata_) {
|
||||
return self().attr("onloadedmetadata", onloadedmetadata_);
|
||||
}
|
||||
|
||||
default T withCondOnloadedmetadata(final boolean enable, final String onloadedmetadata_) {
|
||||
return enable ? self().attr("onloadedmetadata", onloadedmetadata_) : self();
|
||||
}
|
||||
default T withCondOnloadedmetadata(final boolean enable, final String onloadedmetadata_) {
|
||||
return enable ? self().attr("onloadedmetadata", onloadedmetadata_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnloadstart<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnloadstart(final String onloadstart_) {
|
||||
return self().attr("onloadstart", onloadstart_);
|
||||
}
|
||||
default T withOnloadstart(final String onloadstart_) {
|
||||
return self().attr("onloadstart", onloadstart_);
|
||||
}
|
||||
|
||||
default T withCondOnloadstart(final boolean enable, final String onloadstart_) {
|
||||
return enable ? self().attr("onloadstart", onloadstart_) : self();
|
||||
}
|
||||
default T withCondOnloadstart(final boolean enable, final String onloadstart_) {
|
||||
return enable ? self().attr("onloadstart", onloadstart_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnoffline<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnoffline(final String onoffline_) {
|
||||
return self().attr("onoffline", onoffline_);
|
||||
}
|
||||
default T withOnoffline(final String onoffline_) {
|
||||
return self().attr("onoffline", onoffline_);
|
||||
}
|
||||
|
||||
default T withCondOnoffline(final boolean enable, final String onoffline_) {
|
||||
return enable ? self().attr("onoffline", onoffline_) : self();
|
||||
}
|
||||
default T withCondOnoffline(final boolean enable, final String onoffline_) {
|
||||
return enable ? self().attr("onoffline", onoffline_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnonline<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnonline(final String ononline_) {
|
||||
return self().attr("ononline", ononline_);
|
||||
}
|
||||
default T withOnonline(final String ononline_) {
|
||||
return self().attr("ononline", ononline_);
|
||||
}
|
||||
|
||||
default T withCondOnonline(final boolean enable, final String ononline_) {
|
||||
return enable ? self().attr("ononline", ononline_) : self();
|
||||
}
|
||||
default T withCondOnonline(final boolean enable, final String ononline_) {
|
||||
return enable ? self().attr("ononline", ononline_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnpagehide<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnpagehide(final String onpagehide_) {
|
||||
return self().attr("onpagehide", onpagehide_);
|
||||
}
|
||||
default T withOnpagehide(final String onpagehide_) {
|
||||
return self().attr("onpagehide", onpagehide_);
|
||||
}
|
||||
|
||||
default T withCondOnpagehide(final boolean enable, final String onpagehide_) {
|
||||
return enable ? self().attr("onpagehide", onpagehide_) : self();
|
||||
}
|
||||
default T withCondOnpagehide(final boolean enable, final String onpagehide_) {
|
||||
return enable ? self().attr("onpagehide", onpagehide_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnpageshow<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnpageshow(final String onpageshow_) {
|
||||
return self().attr("onpageshow", onpageshow_);
|
||||
}
|
||||
default T withOnpageshow(final String onpageshow_) {
|
||||
return self().attr("onpageshow", onpageshow_);
|
||||
}
|
||||
|
||||
default T withCondOnpageshow(final boolean enable, final String onpageshow_) {
|
||||
return enable ? self().attr("onpageshow", onpageshow_) : self();
|
||||
}
|
||||
default T withCondOnpageshow(final boolean enable, final String onpageshow_) {
|
||||
return enable ? self().attr("onpageshow", onpageshow_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnpause<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnpause(final String onpause_) {
|
||||
return self().attr("onpause", onpause_);
|
||||
}
|
||||
default T withOnpause(final String onpause_) {
|
||||
return self().attr("onpause", onpause_);
|
||||
}
|
||||
|
||||
default T withCondOnpause(final boolean enable, final String onpause_) {
|
||||
return enable ? self().attr("onpause", onpause_) : self();
|
||||
}
|
||||
default T withCondOnpause(final boolean enable, final String onpause_) {
|
||||
return enable ? self().attr("onpause", onpause_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnplay<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnplay(final String onplay_) {
|
||||
return self().attr("onplay", onplay_);
|
||||
}
|
||||
default T withOnplay(final String onplay_) {
|
||||
return self().attr("onplay", onplay_);
|
||||
}
|
||||
|
||||
default T withCondOnplay(final boolean enable, final String onplay_) {
|
||||
return enable ? self().attr("onplay", onplay_) : self();
|
||||
}
|
||||
default T withCondOnplay(final boolean enable, final String onplay_) {
|
||||
return enable ? self().attr("onplay", onplay_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnplaying<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnplaying(final String onplaying_) {
|
||||
return self().attr("onplaying", onplaying_);
|
||||
}
|
||||
default T withOnplaying(final String onplaying_) {
|
||||
return self().attr("onplaying", onplaying_);
|
||||
}
|
||||
|
||||
default T withCondOnplaying(final boolean enable, final String onplaying_) {
|
||||
return enable ? self().attr("onplaying", onplaying_) : self();
|
||||
}
|
||||
default T withCondOnplaying(final boolean enable, final String onplaying_) {
|
||||
return enable ? self().attr("onplaying", onplaying_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnpopstate<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnpopstate(final String onpopstate_) {
|
||||
return self().attr("onpopstate", onpopstate_);
|
||||
}
|
||||
default T withOnpopstate(final String onpopstate_) {
|
||||
return self().attr("onpopstate", onpopstate_);
|
||||
}
|
||||
|
||||
default T withCondOnpopstate(final boolean enable, final String onpopstate_) {
|
||||
return enable ? self().attr("onpopstate", onpopstate_) : self();
|
||||
}
|
||||
default T withCondOnpopstate(final boolean enable, final String onpopstate_) {
|
||||
return enable ? self().attr("onpopstate", onpopstate_) : self();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import org.xbib.j2html.tags.IInstance;
|
|||
import org.xbib.j2html.tags.Tag;
|
||||
|
||||
public interface IOnprogress<T extends Tag<T>> extends IInstance<T> {
|
||||
default T withOnprogress(final String onprogress_) {
|
||||
return self().attr("onprogress", onprogress_);
|
||||
}
|
||||
default T withOnprogress(final String onprogress_) {
|
||||
return self().attr("onprogress", onprogress_);
|
||||
}
|
||||
|
||||
default T withCondOnprogress(final boolean enable, final String onprogress_) {
|
||||
return enable ? self().attr("onprogress", onprogress_) : self();
|
||||
}
|
||||
default T withCondOnprogress(final boolean enable, final String onprogress_) {
|
||||
return enable ? self().attr("onprogress", onprogress_) : self();
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue