com.zfqjava.swing
Class ModelIO

java.lang.Object
  |
  +--com.zfqjava.swing.ModelIO

public class ModelIO
extends java.lang.Object

ModelIO provides model input and export operation.

Since:
JDataGrid 1.1

Field Summary
static java.lang.String DELIMITER_STRING
          Key for the delimiter string.
static java.lang.String ENABLE_LOOSE_FORMAT
          Key for enable loose format.
static java.lang.String QUOTE_CHAR
          Key for the quote char.
 
Method Summary
static javax.swing.table.TableModel readTableModel(java.io.File file, java.lang.String formatName, java.util.Map map)
          Returns a TableModel.
static javax.swing.table.TableModel readTableModel(java.io.InputStream input, java.lang.String formatName, java.util.Map map)
          Returns a TableModel.
static javax.swing.table.TableModel readTableModel(java.io.Reader reader, java.lang.String formatName, java.util.Map map)
          Returns a TableModel.
static javax.swing.table.TableModel readTableModel(java.net.URL url, java.lang.String formatName, java.util.Map map)
          Returns a TableModel.
static WorkBook readWorkBook(java.io.File file, java.lang.String formatName, java.util.Map map)
          Returns a WorkBook.
static WorkBook readWorkBook(java.io.InputStream input, java.lang.String formatName, java.util.Map map)
          Returns a WorkBook.
static WorkBook readWorkBook(java.net.URL url, java.lang.String formatName, java.util.Map map)
          Returns a WorkBook.
static void writeTableModel(javax.swing.table.TableModel model, java.lang.String formatName, java.util.Map map, java.io.File file)
          Writes a TableModel use the formatName and to the file object.
static void writeTableModel(javax.swing.table.TableModel model, java.lang.String formatName, java.util.Map map, java.io.OutputStream output)
          Writes a TableModel use the formatName and to the output stream.
static void writeTableModel(javax.swing.table.TableModel model, java.lang.String formatName, java.util.Map map, java.io.Writer writer)
          Writes a TableModel use the formatName and to the writer.
static void writeWorkBook(WorkBook book, java.lang.String formatName, java.util.Map map, java.io.File file)
          Writes a WorkBook use the formatName and to the file object.
static void writeWorkBook(WorkBook book, java.lang.String formatName, java.util.Map map, java.io.OutputStream output)
          Writes a WorkBook use the formatName and to the output stream.
 
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 java.lang.String DELIMITER_STRING
Key for the delimiter string.

Type: java.lang.String


QUOTE_CHAR

public static final java.lang.String QUOTE_CHAR
Key for the quote char.

Type: java.lang.Character


ENABLE_LOOSE_FORMAT

public static final java.lang.String ENABLE_LOOSE_FORMAT
Key for enable loose format.

Type: java.lang.Boolean

Method Detail

readTableModel

public static javax.swing.table.TableModel readTableModel(java.io.InputStream input,
                                                          java.lang.String formatName,
                                                          java.util.Map map)
                                                   throws java.io.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:
java.io.IOException - if an error occurs during reading
java.lang.IllegalArgumentException - if input or formatName is null
See Also:
writeTableModel(javax.swing.table.TableModel, java.lang.String, java.util.Map, java.io.OutputStream)

readTableModel

public static javax.swing.table.TableModel readTableModel(java.io.Reader reader,
                                                          java.lang.String formatName,
                                                          java.util.Map map)
                                                   throws java.io.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:
java.io.IOException - if an error occurs during reading
java.lang.IllegalArgumentException - if input or formatName is null
See Also:
writeTableModel(javax.swing.table.TableModel, java.lang.String, java.util.Map, java.io.OutputStream)

readTableModel

public static javax.swing.table.TableModel readTableModel(java.io.File file,
                                                          java.lang.String formatName,
                                                          java.util.Map map)
                                                   throws java.io.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:
java.io.IOException - if an error occurs during reading
java.lang.IllegalArgumentException - if input or formatName is null
See Also:
writeTableModel(javax.swing.table.TableModel, java.lang.String, java.util.Map, java.io.OutputStream)

readTableModel

public static javax.swing.table.TableModel readTableModel(java.net.URL url,
                                                          java.lang.String formatName,
                                                          java.util.Map map)
                                                   throws java.io.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:
java.io.IOException - if an error occurs during reading
java.lang.IllegalArgumentException - if input or formatName is null
See Also:
writeTableModel(javax.swing.table.TableModel, java.lang.String, java.util.Map, java.io.OutputStream)

writeTableModel

public static void writeTableModel(javax.swing.table.TableModel model,
                                   java.lang.String formatName,
                                   java.util.Map map,
                                   java.io.OutputStream output)
                            throws java.io.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:
java.io.IOException - if an error occurs during reading
java.lang.IllegalArgumentException - if any parameter expect map is null.
See Also:
readTableModel(java.io.InputStream, java.lang.String, java.util.Map)

writeTableModel

public static void writeTableModel(javax.swing.table.TableModel model,
                                   java.lang.String formatName,
                                   java.util.Map map,
                                   java.io.Writer writer)
                            throws java.io.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:
java.io.IOException - if an error occurs during reading
java.lang.IllegalArgumentException - if any parameter expect map is null.
See Also:
readTableModel(java.io.InputStream, java.lang.String, java.util.Map)

writeTableModel

public static void writeTableModel(javax.swing.table.TableModel model,
                                   java.lang.String formatName,
                                   java.util.Map map,
                                   java.io.File file)
                            throws java.io.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:
java.io.IOException - if an error occurs during reading
java.lang.IllegalArgumentException - if any parameter expect map is null.
See Also:
readTableModel(java.io.InputStream, java.lang.String, java.util.Map)

readWorkBook

public static WorkBook readWorkBook(java.io.File file,
                                    java.lang.String formatName,
                                    java.util.Map map)
                             throws java.io.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:
java.io.IOException - if an error occurs during reading
java.lang.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(java.net.URL url,
                                    java.lang.String formatName,
                                    java.util.Map map)
                             throws java.io.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:
java.io.IOException - if an error occurs during reading
java.lang.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(java.io.InputStream input,
                                    java.lang.String formatName,
                                    java.util.Map map)
                             throws java.io.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:
java.io.IOException - if an error occurs during reading
java.lang.IllegalArgumentException - if input or formatName is null
See Also:
writeWorkBook(com.zfqjava.swing.WorkBook, java.lang.String, java.util.Map, java.io.File)

writeWorkBook

public static void writeWorkBook(WorkBook book,
                                 java.lang.String formatName,
                                 java.util.Map map,
                                 java.io.File file)
                          throws java.io.IOException
Writes a WorkBook use the formatName and to the file object.
Parameters:
model - the WorkBook
formatName - the formant name
map - the properties to read model
file - the File object
Throws:
java.io.IOException - if an error occurs during reading
java.lang.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,
                                 java.lang.String formatName,
                                 java.util.Map map,
                                 java.io.OutputStream output)
                          throws java.io.IOException
Writes a WorkBook use the formatName and to the output stream.
Parameters:
model - the WorkBook
formatName - the formant name
map - the properties to read model
output - the OutputStream
Throws:
java.io.IOException - if an error occurs during reading
java.lang.IllegalArgumentException - if any parameter expect map is null.
See Also:
readWorkBook(java.io.File, java.lang.String, java.util.Map)


Copyright © 2001-2003 Extreme Component, Inc. All rights reserved.