@Override public String[] align(String[] text, int cellWidth, int cellHeight) { String[] result = delegate.align(text, cellWidth, cellHeight); Assert.isTrue(result.length == cellHeight, String.format("%s had the wrong number of lines (%d), expected %d", Arrays.asList(result), result.length, cellHeight)); for (String s : result) { Assert.isTrue(s.length() == cellWidth, String.format("'%s' had wrong length (%d), expected %d", s, s.length(), cellWidth)); } return result; } }
for (Map.Entry<CellMatcher, Aligner> kv : aligners.entrySet()) { if (kv.getKey().matches(row, column, model)) { subLines[row][column] = kv.getValue().align(subLines[row][column], cellWidths[column], cellHeights[row]);