T
- Type of the data used to build the table.public class HtmlTableBuilder<T> extends Object
Builder used to create instances of HtmlTable
. This builder is mainly
used as an export utility and for testing.
For example, considering the following simple Person
class:
public class Person { private Long id; private String firstName; private String lastName; private String mail; private Date birthDate; // Accessors... }
The builder allows to create fully configured instance of HtmlTable
as follows:
HtmlTable table = new HtmlTableBuilder<Person>().newBuilder("yourTableId", persons, request).column() .fillWithProperty("id").title("Id").column().fillWithProperty("firstName").title("Firtname").column() .fillWithProperty("lastName").title("Lastname").column().fillWithProperty("mail").title("Mail").column() .fillWithProperty("birthDate", "{0,date,dd-MM-yyyy}").title("BirthDate").build();
where:
yourTableId
is the HTML id that has be assigned to the
table
tagpersons
is a collection of Person
request
is the current HttpServletRequest
Modifier and Type | Class and Description |
---|---|
static interface |
HtmlTableBuilder.BuildStep |
static interface |
HtmlTableBuilder.ColumnStep |
static interface |
HtmlTableBuilder.FirstContentStep |
static interface |
HtmlTableBuilder.SecondContentStep |
static interface |
HtmlTableBuilder.TitleStep |
Constructor and Description |
---|
HtmlTableBuilder() |
Modifier and Type | Method and Description |
---|---|
HtmlTableBuilder.ColumnStep |
newBuilder(String id,
List<T> data,
javax.servlet.http.HttpServletRequest request) |
HtmlTableBuilder.ColumnStep |
newBuilder(String id,
List<T> data,
javax.servlet.http.HttpServletRequest request,
ExportConf exportConf) |
public HtmlTableBuilder.ColumnStep newBuilder(String id, List<T> data, javax.servlet.http.HttpServletRequest request)
public HtmlTableBuilder.ColumnStep newBuilder(String id, List<T> data, javax.servlet.http.HttpServletRequest request, ExportConf exportConf)
Copyright © 2013–2015 Dandelion Project. All rights reserved.