com.github.dandelion.datatables.core.export
Class HtmlTableBuilder<T>
java.lang.Object
com.github.dandelion.datatables.core.export.HtmlTableBuilder<T>
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 tag
persons is a collection of Person
request is the current HttpServletRequest
- Since:
- 0.9.0
- Author:
- Thibault Duchateau
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HtmlTableBuilder
public HtmlTableBuilder()
newBuilder
public HtmlTableBuilder.ColumnStep newBuilder(String id,
List<T> data,
javax.servlet.http.HttpServletRequest request)
newBuilder
public HtmlTableBuilder.ColumnStep newBuilder(String id,
List<T> data,
javax.servlet.http.HttpServletRequest request,
ExportConf exportConf)
Copyright © 2013–2014 Dandelion Project. All rights reserved.