1
2
3
4
5
6
7 package org.astrogrid.tableserver.out;
8
9 import org.astrogrid.tableserver.metadata.*;
10
11 import java.io.IOException;
12
13 /***
14 * Defines the methods a table writer must implement...
15 *
16 * @author M Hill
17 */
18
19 public interface TableWriter {
20
21 /*** Sets the details of a column. Fails if col is bigger than the existing internal
22 * array; use setColumnMetadata(array) to set the size */
23
24
25 /*** Sets all the column details */
26 public void startTable(ColumnInfo[] colInfo) throws IOException;
27
28 /*** Writes the given array of values out */
29 public void writeRow(Object[] colValues) throws IOException;
30
31 /*** Ends a table (eg closes tags) */
32 public void endTable() throws IOException;
33
34 /*** Close the writer */
35 public void close() throws IOException;
36
37 /*** If the writer needs to stop before normal completion, call this. It will,
38 * if appropriate, write some message to indicate that the table is incomplete */
39 public void abort() throws IOException;
40
41 /*** Returns the mime type that this writer produces */
42 public String getMimeType();
43 }
44
45