* Restructuring to a Maven multi-module project. - Renamed directories to match artifact ids. - Added parent POM. - Added developers to parent POM. - Added dependency management and plugin management. No expectation that the build or release process is fully functional. - Extracted versions into properties like other projects. * Fixed file paths for workflow and documentation. - Added junit to j2html-codegen module. * Temporarily setting packaging for j2html-codegen to pom, to allow workflow to complete. * Removed copied configuration of maven-jar-plugin from parent POM. * Integrating code generation into the main build process. - j2html-codegen is now supplying a Maven plugin that can read a model file and generate corresponding attribute and tag classes as part of the project build. - j2html classes that would conflict with the generated classes have been removed. * Targeting LTS versions only. - JDK 9 & 10 support ended in 2018
16 lines
537 B
Java
16 lines
537 B
Java
// each() lets you iterate through a collection and returns the generated HTML
|
|
// as a DomContent object, meaning you can add siblings, which is not possible
|
|
// using the stream api in the previous example
|
|
body().with(
|
|
div().withId("employees").with(
|
|
p("Some sibling element"),
|
|
each(employees, employee ->
|
|
div().withClass("employee").with(
|
|
h2(employee.getName()),
|
|
img().withSrc(employee.getImgPath()),
|
|
p(employee.getTitle())
|
|
)
|
|
)
|
|
)
|
|
)
|