| | |
| | | /** |
| | | * Table serializer implementation. |
| | | */ |
| | | private static final class Serializer extends TableSerializer { |
| | | private final class Serializer extends TableSerializer { |
| | | |
| | | // The current column being output. |
| | | private int column = 0; |
| | | |
| | | // Indicates whether or not the headings should be output. |
| | | private final boolean displayHeadings; |
| | | |
| | | // Counts the number of separators that should be output the next |
| | | // time a non-empty cell is displayed. The comma separators are |
| | | // not displayed immediately so that we can avoid displaying |
| | | // unnecessary trailing separators. |
| | | private int requiredSeparators = 0; |
| | | |
| | | // The output destination. |
| | | private final PrintWriter writer; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | private Serializer(PrintWriter writer, boolean displayHeadings) { |
| | | this.writer = writer; |
| | | this.displayHeadings = displayHeadings; |
| | | private Serializer() { |
| | | // No implementation required. |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @Override |
| | | protected TableSerializer getSerializer() { |
| | | return new Serializer(writer, displayHeadings); |
| | | return new Serializer(); |
| | | } |
| | | |
| | | } |