JComponentPack 1.5.0

com.zfqjava.swing
Class ModelIO

java.lang.Object
  extended by com.zfqjava.swing.ModelIO

public class ModelIO
extends Object


Field Summary
static String DELIMITER_STRING
          Key for the delimiter string.
static String ENABLE_LOOSE_FORMAT
          Key for enable loose format.
static String PREFERRED_WORK_BOOK_API
          The preferred workbook api, used when read and write workbook.
static String PROGRESS_BAR
          Key for JProgressBar, used to monitor the input and output stream.
static String QUOTE_CHAR
          Key for the quote char.
 
Method Summary
static TableModel readTableModel(File file, String formatName, Map map)
          Returns a TableModel.
static TableModel readTableModel(InputStream input, String formatName, Map map)
          Returns a TableModel.
static TableModel readTableModel(Reader reader, String formatName, Map map)
          Returns a TableModel.
static TableModel readTableModel(URL url, String formatName, Map map)
          Returns a TableModel.
static WorkBook readWorkBook(File file, String formatName, Map map)
          Returns a WorkBook.
static WorkBook readWorkBook(InputStream input, String formatName, Map map)
          Returns a WorkBook.
static WorkBook readWorkBook(URL url, String formatName, Map map)
          Returns a WorkBook.
static void writeTableModel(TableModel model, String formatName, Map map, File file)
          Writes a TableModel use the formatName and to the file object.
static void writeTableModel(TableModel model, String formatName, Map map, OutputStream output)
          Writes a TableModel use the formatName and to the output stream.
static void writeTableModel(TableModel model, String formatName, Map map, URL url)
          Writes a TableModel use the formatName and to the url object.
static void writeTableModel(TableModel model, String formatName, Map map, Writer writer)
          Writes a TableModel use the formatName and to the writer.
static void writeWorkBook(WorkBook book, String formatName, Map map, File file)
          Writes a WorkBook use the formatName and to the file object.
static void writeWorkBook(WorkBook book, String formatName, Map map, OutputStream output)
          Writes a WorkBook use the formatName and to the output stream.
static void writeWorkBook(WorkBook book, String formatName, Map map, URL url)
          Writes a WorkBook use the formatName and to the url object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMITER_STRING

public static final String DELIMITER_STRING
Key for the delimiter string.

Type: java.lang.String

See Also:
Constant Field Values

ENABLE_LOOSE_FORMAT

public static final String ENABLE_LOOSE_FORMAT
Key for enable loose format.

Type: java.lang.Boolean

See Also:
Constant Field Values

PREFERRED_WORK_BOOK_API

public static final String PREFERRED_WORK_BOOK_API
The preferred workbook api, used when read and write workbook.

Type: java.lang.String Value: one of the following

Since:
JDataGrid 1.9.1
See Also:
Constant Field Values

QUOTE_CHAR

public static final String QUOTE_CHAR
Key for the quote char.

Type: java.lang.Character

See Also:
Constant Field Values

PROGRESS_BAR

public static final String PROGRESS_BAR
Key for JProgressBar, used to monitor the input and output stream.

Type: javax.swing.JProgressBar

See Also:
Constant Field Values
Method Detail

readTableModel

public static TableModel readTableModel(File file,
                                        String formatName,
                                        Map map)
                                 throws IOException
Returns a TableModel.

Parameters:
file - an File to read from
formatName - the formant name
map - the properties to read model
Returns:
a TableModel or null
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if input or formatName is null
See Also:
writeTableModel(javax.swing.table.TableModel, java.lang.String, java.util.Map, java.io.File)

readTableModel

public static TableModel readTableModel(InputStream input,
                                        String formatName,
                                        Map map)
                                 throws IOException
Returns a TableModel.

Parameters:
input - an InputStream to read from
formatName - the formant name
map - the properties to read model
Returns:
a TableModel or null
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if input or formatName is null
See Also:
writeTableModel(javax.swing.table.TableModel, java.lang.String, java.util.Map, java.io.File)

readTableModel

public static TableModel readTableModel(Reader reader,
                                        String formatName,
                                        Map map)
                                 throws IOException
Returns a TableModel.

Parameters:
reader - an Reader to read from
formatName - the formant name
map - the properties to read model
Returns:
a TableModel or null
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if input or formatName is null
See Also:
writeTableModel(javax.swing.table.TableModel, java.lang.String, java.util.Map, java.io.File)

readTableModel

public static TableModel readTableModel(URL url,
                                        String formatName,
                                        Map map)
                                 throws IOException
Returns a TableModel.

Parameters:
url - an URL to read from
formatName - the formant name
map - the properties to read model
Returns:
a TableModel or null
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if input or formatName is null
See Also:
writeTableModel(javax.swing.table.TableModel, java.lang.String, java.util.Map, java.io.File)

readWorkBook

public static WorkBook readWorkBook(File file,
                                    String formatName,
                                    Map map)
                             throws IOException
Returns a WorkBook.

Parameters:
file - an File to read from
formatName - the formant name
map - the properties to read model
Returns:
a WorkBook or null
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if input or formatName is null
See Also:
writeWorkBook(com.zfqjava.swing.WorkBook, java.lang.String, java.util.Map, java.io.File)

readWorkBook

public static WorkBook readWorkBook(InputStream input,
                                    String formatName,
                                    Map map)
                             throws IOException
Returns a WorkBook.

Parameters:
input - an InputStream to read from
formatName - the formant name
map - the properties to read model
Returns:
a WorkBook or null
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if input or formatName is null
See Also:
writeWorkBook(com.zfqjava.swing.WorkBook, java.lang.String, java.util.Map, java.io.File)

readWorkBook

public static WorkBook readWorkBook(URL url,
                                    String formatName,
                                    Map map)
                             throws IOException
Returns a WorkBook.

Parameters:
url - an URL to read from
formatName - the formant name
map - the properties to read model
Returns:
a WorkBook or null
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if input or formatName is null
See Also:
writeWorkBook(com.zfqjava.swing.WorkBook, java.lang.String, java.util.Map, java.io.File)

writeTableModel

public static void writeTableModel(TableModel model,
                                   String formatName,
                                   Map map,
                                   File file)
                            throws IOException
Writes a TableModel use the formatName and to the file object.

Parameters:
model - the TableModel
formatName - the formant name
map - the properties to read model
file - the File object
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if any parameter expect map is null.
See Also:
readTableModel(java.io.File, java.lang.String, java.util.Map)

writeTableModel

public static void writeTableModel(TableModel model,
                                   String formatName,
                                   Map map,
                                   URL url)
                            throws IOException
Writes a TableModel use the formatName and to the url object.

Parameters:
model - the TableModel
formatName - the formant name
map - the properties to read model
url - the URL object
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if any parameter expect map is null.
See Also:
readTableModel(java.io.File, java.lang.String, java.util.Map)

writeTableModel

public static void writeTableModel(TableModel model,
                                   String formatName,
                                   Map map,
                                   OutputStream output)
                            throws IOException
Writes a TableModel use the formatName and to the output stream.

Parameters:
model - the TableModel
formatName - the formant name
map - the properties to read model
output - the OutputStream
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if any parameter expect map is null.
See Also:
readTableModel(java.io.File, java.lang.String, java.util.Map)

writeTableModel

public static void writeTableModel(TableModel model,
                                   String formatName,
                                   Map map,
                                   Writer writer)
                            throws IOException
Writes a TableModel use the formatName and to the writer.

Parameters:
model - the TableModel
formatName - the formant name
map - the properties to read model
writer - the Writer
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if any parameter expect map is null.
See Also:
readTableModel(java.io.File, java.lang.String, java.util.Map)

writeWorkBook

public static void writeWorkBook(WorkBook book,
                                 String formatName,
                                 Map map,
                                 File file)
                          throws IOException
Writes a WorkBook use the formatName and to the file object.

Parameters:
book - the WorkBook
formatName - the formant name
map - the properties to read model
file - the File object
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if any parameter expect map is null.
See Also:
readWorkBook(java.io.File, java.lang.String, java.util.Map)

writeWorkBook

public static void writeWorkBook(WorkBook book,
                                 String formatName,
                                 Map map,
                                 URL url)
                          throws IOException
Writes a WorkBook use the formatName and to the url object.

Parameters:
book - the WorkBook
formatName - the formant name
map - the properties to read model
url - the URL object
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if any parameter expect map is null.
Since:
JDataGrid 2.0.2
See Also:
readWorkBook(java.io.File, java.lang.String, java.util.Map)

writeWorkBook

public static void writeWorkBook(WorkBook book,
                                 String formatName,
                                 Map map,
                                 OutputStream output)
                          throws IOException
Writes a WorkBook use the formatName and to the output stream.

Parameters:
book - the WorkBook
formatName - the formant name
map - the properties to read model
output - the OutputStream
Throws:
IOException - if an error occurs during reading
IllegalArgumentException - if any parameter expect map is null.
See Also:
readWorkBook(java.io.File, java.lang.String, java.util.Map)

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.