|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectappli.sqlplayer.util.Table2tsv
This conversion class receives the data from a database table row by row and
column by column and writes a file to a temporary directory.
The file is TSV format. The first row should contain the column name.
Most of the variable refer to xml stuff: this is because previously this
class outputted an xml file
Use this class as follows:
Field Summary | |
private java.lang.StringBuffer |
descrLine
|
private java.lang.String |
directory
|
private java.lang.String |
filename
|
private java.lang.StringBuffer |
line
|
private int |
rowCount
|
private boolean |
rowOpen
|
private java.lang.String |
tablename
|
private java.io.BufferedWriter |
wrt
|
Constructor Summary | |
Table2tsv()
|
Method Summary | |
void |
addColumn(java.lang.String name,
java.lang.String content)
Add data for new column of current open row |
void |
closeRow()
Finish row |
java.lang.String |
getDirectory()
|
java.lang.String |
getFilename()
|
java.lang.String |
getTablename()
|
void |
newDocument()
Start new XML document |
void |
newDocument(java.lang.String filename,
java.lang.String tablename)
Start new XML document |
void |
openRow()
Start data entry for new row |
void |
saveDocument()
Save current XML tree to XML file |
void |
setDirectory(java.lang.String newDirectory)
Set directory path including ending file separator of xml output |
void |
setFilename(java.lang.String newFilename)
Set filename of XML file |
void |
setTablename(java.lang.String newTablename)
Set tablename of source table |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String filename
private java.lang.String directory
private java.lang.String tablename
private boolean rowOpen
private java.io.BufferedWriter wrt
private java.lang.StringBuffer descrLine
private java.lang.StringBuffer line
private int rowCount
Constructor Detail |
public Table2tsv()
Method Detail |
public void setFilename(java.lang.String newFilename)
newFilename
- filename of XML file in "out" folderpublic java.lang.String getFilename()
public void setDirectory(java.lang.String newDirectory)
newDirectory
- directory overriding the default output directorypublic java.lang.String getDirectory()
public void setTablename(java.lang.String newTablename)
newTablename
- name of source tablepublic java.lang.String getTablename()
public void newDocument()
public void newDocument(java.lang.String filename, java.lang.String tablename)
filename
- Filename of XML documenttablename
- Tablename of current tablepublic void saveDocument() throws java.io.IOException
java.io.IOException
public void openRow()
public void closeRow()
public void addColumn(java.lang.String name, java.lang.String content)
name
- Column namecontent
- content of this column
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |