borland Packages  Class Hierarchy  dx.dataset Package 

TextDataFile component

java.lang.Object
   +----com.borland.dx.dataset.DataFile
           +----com.borland.dx.dataset.TextDataFile

About the TextDataFile component

Constructors  Properties  Methods  

Implements Designable, LoadCancel, Serializable

The TextDataFile component specifies the properties of a text file that affect its import and export, such as delimiters, field separators, and so on. This component is used when:

When importing data into a TableDataSet, this component specifies the properties of the text file that affect its import, such as delimiters, field separators, and so on. To further specify the formatting of the data within each field, set the exportDisplayMask property of the Column component. The exportDisplayMask is used both when importing as well as exporting.

This component is the default for the dataFile property of the StorageDataSet component. By default, exported data is in a text format as specified by this component's properties. To write the data stored in any StorageDataSet to a text file, instantiate a TextDataFile component and call one of the TextDataFile.save(...) methods.

All properties of this component have default values. To changes these values, call the corresponding accessor methods. In addition, localized properties are stored in its associated DataFileFormat object, which is set by this component's fileFormat property.

For information on saving data stored in a TableDataSet using this component, see "Saving data in a TextDataFile to a JDBC data source" in the About section of the TableDataSet component.


TextDataFile constructors

TextDataFile properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

TextDataFile methods

Methods implemented in this class

Methods implemented in java.lang.Object


TextDataFile constructors

TextDataFile()

  public TextDataFile()
Constructs a TextDataFile component.

TextDataFile properties

delimiter

 public final String getDelimiter()
 public final void setDelimiter(String delimiter)
The String character that appears before and after character data elements in the data file. The default value is double-quotes (").

encoding

 public final String getEncoding()
 public final void setEncoding(String encoding)
The encoding of the file. Based on the encoding returned by System.getProperty("file.encoding"), this property sets the fileFormat property to ASCII or ENCODED.

fileFormat

 public final int getFileFormat()
 public final void setFileFormat(int fileFormat)
The format of the file-based data source. This property defaults to ASCII. Valid values for encoding are defined in DataFileFormat.

fileName

 public String getFileName()
 public void setFileName(String fileName)
Stores the name of the file that contains data to read in or to write out to. This property defaults to TextDataFile.txt.

loadAsInserted

 public final boolean isLoadAsInserted()
 public final void setLoadAsInserted(boolean loadAsInserted)
Determines whether to load rows with a RowStatus of RowStatus.INSERTED (true) or, to load rows with a RowStatus of RowStatus.LOADED (false). If set to true these rows are treated as inserted when methods such as Database.saveChanges() are called.

loadOnOpen

 public boolean isLoadOnOpen()
 public void setLoadOnOpen(boolean loadOnOpen)
If true, then the DataSet is loaded with the contents of the file when the DataSet is opened.

locale

 public final Locale getLocale()
 public final void setLocale(Locale locale)
Specifies the Locale of the TextDataFile component. The locale property allows the user to identify which locale to use when formatting the data in a Column. This property supports locales that are supported by the JavaSoft (tm) JDK.

separator

 public final String getSeparator()
 public final void setSeparator(String separator)
Specifies the value used to separated individual data items. The default value for this property is the tab character (\t).

TextDataFile methods

load(com.borland.dx.dataset.DataSet)

  public final void load(DataSet dataSet)
Loads data from a stream into the DataSet.

Overrides: com.borland.dx.dataset.DataFile.load(com.borland.dx.dataset.DataSet)

load(com.borland.dx.dataset.DataSet, java.io.InputStream, java.io.InputStream)

  public final void load(DataSet dataSet, InputStream stream, InputStream schemaStream)
Loads data from the input stream into the specified DataSet. The schemaStream parameter can be set to null if columns have already been added to the DataSet.

loadMetaData(com.borland.dx.dataset.DataSet)

  public final void loadMetaData(DataSet dataSet)
Loads metadata into the DataSet using the schema file specified by the fileName property.

Overrides: com.borland.dx.dataset.DataFile.loadMetaData(com.borland.dx.dataset.DataSet)

save(com.borland.dx.dataset.DataSet)

  public void save(DataSet saveDataSet)
Saves DataSet data to the file specified by the fileName property.

Overrides: com.borland.dx.dataset.DataFile.save(com.borland.dx.dataset.DataSet)

save(com.borland.dx.dataset.DataSet, java.io.OutputStream, java.io.OutputStream)

  public void save(DataSet saveDataSet, OutputStream stream, OutputStream schemaStream)
Saves the DataSet data and metadata as specified.

Parameters:

saveDataSet
The DataSet containing the data to save.
stream
The stream that will contain the actual data from the DataSet.
schemaStream
The stream that will contain the DataSet's metadata. If this parameter is null, the fileName property is used to save the metadata.