@@ -0,0 +1,2864 @@
+package JavaUtils;%0A%0A%0A%0Aimport models.TableData;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A/**%0A * Created by wale on 10/21/14.%0A * Class generates an HTML table from %0A * a List of Objects that implements %0A * the TableData interface%0A */%0Apublic class Table %7B%0A    private String %5B%5D header;%0A    private List%3C? extends TableData%3E tableData;%0A    private List%3CString%5B%5D%3E tableDataX = new ArrayList%3C%3E();%0A    private Map%3CString,String%3E htmlArgs;%0A%0A%0A    public Table(String%5B%5D header, Map%3CString,String%3E htmlArgs, List%3C? extends TableData%3E tableData) %7B%0A        this.header = header;%0A        this.htmlArgs=htmlArgs;%0A        this.tableData = tableData;%0A%0A        prepData();%0A    %7D%0A%0A    /**%0A     *Prepares tableData as a List of arrays%0A     */%0A    private void prepData()%7B%0A%0A        for(int i =0;i%3CtableData.size();i++)%7B%0A            tableDataX.add(tableData.get(i).toArray());%0A        %7D%0A    %7D%0A%0A    /**%0A     * Generates the table tag and the html arguments%0A     * @return String%0A     */%0A    private String createOpening()%7B%0A        StringBuilder builder = new StringBuilder();%0A        builder.append(%22%3Ctable %22);%0A        for(Map.Entry%3CString,String%3E entry : htmlArgs.entrySet())%7B%0A            builder.append(entry.getKey());%0A            builder.append(%22='%22);%0A            builder.append(entry.getValue());%0A            builder.append(%22' %22);%0A%0A%0A        %7D%0A        builder.append(%22%3E%22);%0A        return builder.toString();%0A%0A    %7D%0A%0A    /**%0A     *Generates the table head section%0A     * @return String%0A     */%0A    private String createHeader()%7B%0A%0A        StringBuilder builder = new StringBuilder();%0A        builder.append(%22%5Cn%5Ct%3Cthead%3E%5Cn%5Ct%3Ctr%3E%5Cn%22);%0A        for(String item : this.header)%7B%0A            builder.append(%22%5Ct%3Ctd%3E%22);%0A            builder.append(item);%0A            builder.append(%22%3C/td%3E%5Cn%22);%0A%0A        %7D%0A        builder.append(%22%5Ct%3C/tr%3E%5Cn%3C/thead%3E%5Cn%22);%0A        return builder.toString();%0A    %7D%0A%0A    /**%0A     *Generates the table body section%0A     * @return String%0A     */%0A    private String createBody()%7B%0A        StringBuilder builder = new StringBuilder();%0A        builder.append(%22%5Cn%22);%0A        builder.append(%22%3Ctbody%3E%5Cn%22);%0A%0A        for(String %5B%5D item : tableDataX)%7B%0A            builder.append(%22%5Ct%3Ctr%3E%5Cn%22);%0A            for(String tdItem : item)%7B%0A                builder.append(%22%5Ct%5Ct%3Ctd%3E%22);%0A                builder.append(tdItem);%0A                builder.append(%22%3C/td%3E%5Cn%22);%0A            %7D%0A            builder.append(%22%5Ct%3C/tr%3E%5Cn%22);%0A        %7D%0A        builder.append(%22%3C/tbody%3E%5Cn%22);%0A%0A        return builder.toString();%0A%0A    %7D%0A%0A    /**%0A     * Generates the Tables closing tags%0A     * @return String%0A     */%0A    private String createClosing()%7B%0A        return %22%3C/table%3E%22;%0A    %7D%0A%0A    /**%0A     * Renders the raw table HTML%0A     * @return String%0A     */%0A    public String render()%7B%0A%0A        return createOpening() + createHeader() + createBody() +createClosing();%0A    %7D%0A%0A%0A%0A%7D%0A

Create Table.java