private ITableItemStrategy getTableEle(TableEle tableEle) { if (tableEle.getValue().equals("tableDef")) { return new TableDefinition(); }else if (tableEle.getValue().equals("th")) { return new TableHeader(); }else if (tableEle.getValue().equals("td")) { return new TableCol(); }else { //if (tableEle.getValue().equals("tf")) { return new TableFooter(); } }
private ITableItemStrategy getTableEle(TableEle tableEle) { if (tableEle.getValue().equals("tableDef")) { return new TableDefinition(); }else if (tableEle.getValue().equals("th")) { return new TableHeader(); }else if (tableEle.getValue().equals("td")) { return new TableCol(); }else { //if (tableEle.getValue().equals("tf")) { return new TableFooter(); } }
@Test public void testTableCol() { TableCol tblcol = new TableCol(); assertEquals(1, TestUtils.regexCount(tblcol.getTop(), "<*w:tr")); assertEquals(2, TestUtils.regexCount(tblcol.getMiddle(), "<*w:tc>")); assertEquals(1, TestUtils.regexCount(tblcol.getMiddle(), "<w:t>[{]value[}]</w:t>")); // test placeholder assertEquals(1, TestUtils.regexCount(tblcol.getBottom(), "</w:tr>")); }