com.github.dandelion.datatables.core.export
Class HtmlTableBuilder<T>

java.lang.Object
  extended by 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:

Since:
0.9.0
Author:
Thibault Duchateau

Nested Class Summary
static interface HtmlTableBuilder.BuildStep
           
static interface HtmlTableBuilder.ColumnStep
           
static interface HtmlTableBuilder.FirstContentStep
           
static interface HtmlTableBuilder.SecondContentStep
           
static interface HtmlTableBuilder.TitleStep
           
 
Constructor Summary
HtmlTableBuilder()
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlTableBuilder

public HtmlTableBuilder()
Method Detail

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.