# @jc:file-operation Annotation

Specifies configuration attributes for a File control.

Syntax

@jc:file-operation

[io-type="read, readline, write or append"]
[file-content="file content description"]
[record-size="number of bytes per record"]
[encoding="character set encoding"]

Attributes

These attributes determine the default behavior of the File control. The File control can be configured during its lifetime by calling methods of the FileContol class. To learn more about the FileControl class, see the javadoc for the File Control.

io-type

This attribute specifies the type of operation. The valid values are: read, write, append and readline. (To learn about the readline value, see record-size).

file-content

This attribute indicates the contents of the identified variable which will be written to the file.

record-size

This option is used with methods of type @jc:file-operation io-type="readline". The record size, a positive integer, is expressed in bytes.

The record-size attribute is valid for methods with a return type of RawData and String, but not XmlObject. If this attribute is not specified, the default platform-specific line delimiters, such as carriage returns or line feeds, are used.

The following code illustrates the use of the record-size attribute:

/**
* @jc:file-operation io-type="readline" record-size="80"
*/
RawData readLine();

encoding

This option is used to specify the character set encoding for the file. The file type must be String or XMLObject. This option can not be used if large files are being processed.

Related Topics

File Control

@jc:file Annotation