borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.dataset
java.lang.Object +----borland.jbcl.dataset.TextDataFile
Constructors Properties Methods
Implements DataFile, LoadCancel
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, set this component's fileName property then call the StorageDataSet component's saveDataFile() method.
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.
Note: This component will not delete existing rows if a DataSet already contains data.
public TextDataFile()Constructs a TextDataFile component.
public final String getDelimiter() public final void setDelimiter(java.lang.String delimiter)The String character that appears before and after character data elements in the data file. The default value is double-quotes (").
public final String getEncoding() public final void setEncoding(java.lang.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.
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.
public String getFileName() public void setFileName(java.lang.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.
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.
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.
public final Locale getLocale() public final void setLocale(java.util.Locale locale) public final void setLocale(java.lang.String localeName)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.
public final String getLocaleName() public final void setLocaleName(java.lang.String localeName)Specifies the Locale of the TextDataFile component as a String name. 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.
public final String getSeparator() public final void setSeparator(java.lang.String separator)Specifies the value used to separated individual data items. The default value for this property is the tab character (\t).
public final void load(borland.jbcl.dataset.DataSet dataSet, java.io.InputStream stream, java.io.InputStream schemaStream)Loads data into the specified DataSet. The schemaStream property can be set to null if columns have already been added to the DataSet.
public void save(borland.jbcl.dataset.DataSet saveDataSet, java.io.OutputStream stream, java.io.OutputStream schemaStream)