|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.citra.table.io.XMLExportManager
public class XMLExportManager
XMLExportManager writes a table model in an XML format. You should define a 'path' element in the constructor, which follows the XPath specification. The specified path defines parent-child relationships from left to right, with each 'node' being separated with a '/'. e.g.
/bookstore/book
person etc.
An XML document will be created with the specified paths and the table columns as element nodes, and the cell values as the atomic values of the column nodes.
Field Summary | |
---|---|
static String |
DEFAULT_IDENT
the default identation string as "\t" |
static String |
DEFAULT_NEWLINE
the default new line as "\r\n" |
protected String |
ident
the indentation string |
protected String |
newline
the newline string |
protected String |
path
the path |
Constructor Summary | |
---|---|
XMLExportManager(String path)
Constructs an XMLExportManager. |
Method Summary | |
---|---|
protected String |
format(TableModel model,
int row,
int column)
Returns the value of a specified cell as a string. |
protected String |
formatHeader(String value)
Returns a formatted string of a table's column name. |
String |
getPath()
Returns the current path. |
void |
setPath(String path)
Sets the current path. |
void |
write(TableModel model,
OutputStream out)
Writes model to the outputstream out . |
void |
write(TableModel model,
Writer writer)
Writes model to the writer writer . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_IDENT
public static final String DEFAULT_NEWLINE
protected String path
protected String ident
protected String newline
Constructor Detail |
---|
public XMLExportManager(String path)
Method Detail |
---|
protected String format(TableModel model, int row, int column)
model
- the table modelrow
- the row indexcolumn
- the column index
public String getPath()
public void setPath(String path)
path
- the path to assignpublic void write(TableModel model, OutputStream out)
model
to the outputstream out
.
write
in interface ExportManager
model
- the table model to writeout
- the output stream to write topublic void write(TableModel model, Writer writer)
model
to the writer writer
.
write
in interface ExportManager
model
- the table model to writewriter
- the writer to write toprotected String formatHeader(String value)
value
- the value of the colunmn
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |