public class AS400FileRecordDescription
extends java.lang.Object
implements java.io.Serializable
RecordFormat
that
can then be compiled and used as input to the
AS400File.setRecordFormat()
method.
This allows the record format to be created statically during
development time and then reused when needed.
The class also provides a method for returning RecordFormat objects
that can be used as input to the AS400File.setRecordFormat() method.
This method can be used to create the record format dynamically.
The output from the createRecordFormatSource()
and
retrieveRecordFormat()
methods
contains enough information to use to describe the record format of the
existing file from which it was generated. The record formats
generated are not meant for creating files with the same format as the
file from which they are retrieved. Use the Copy File (CPYF) command to create
a file with the same format as an existing file.
AS400FileRecordDescription objects generate the following events:
AS400FileRecordDescriptionEvent
Constructor and Description |
---|
AS400FileRecordDescription()
Constructs an AS400FileRecordDescription object.
|
AS400FileRecordDescription(AS400 system,
java.lang.String name)
Constructs an AS400FileRecordDescription object.
|
Modifier and Type | Method and Description |
---|---|
void |
addAS400FileRecordDescriptionListener(AS400FileRecordDescriptionListener listener)
Adds a listener to be notified when an AS400FileRecordDescriptionEvent is fired.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound
property is changed.
|
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained
property is changed.
|
void |
createRecordFormatSource(java.lang.String filePath,
java.lang.String packageName)
Retrieves the file description for the file, and creates a file containing the Java source for
a class extending from RecordFormat that represents the record format for the file.
|
java.lang.String |
getFileName()
Returns the file name.
|
java.lang.String |
getMemberName()
Returns the member name.
|
java.lang.String |
getPath()
Returns the integrated file system path name
for the file as specified on the
constructor or the setPath() method.
|
AS400 |
getSystem()
Returns the system object for this object.
|
void |
removeAS400FileRecordDescriptionListener(AS400FileRecordDescriptionListener listener)
Removes a listener from the AS400FileRecordDescription listeners list.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener from the change list.
|
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a listener from the veto change listeners list.
|
RecordFormat[] |
retrieveRecordFormat()
Retrieves the file description for the file, and creates a RecordFormat
object for each record format, which can be used as input to the
AS400File.setRecordFormat()
method. |
void |
setPath(java.lang.String name)
Sets the integrated file system path name for
the file.
|
void |
setSystem(AS400 system)
Sets the system to which to connect.
|
public AS400FileRecordDescription()
public AS400FileRecordDescription(AS400 system, java.lang.String name)
system
- The system on which the file resides.name
- The integrated file system path name
of the file. If a member is not specified in name, the first
member of the file is used.public void addAS400FileRecordDescriptionListener(AS400FileRecordDescriptionListener listener)
listener
- The As400FileRecordDescriptionListener.removeAS400FileRecordDescriptionListener(com.ibm.as400.access.AS400FileRecordDescriptionListener)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public void createRecordFormatSource(java.lang.String filePath, java.lang.String packageName) throws AS400Exception, AS400SecurityException, java.io.IOException, java.lang.InterruptedException
AS400File.setRecordFormat()
method.filePath
- The path of the directory in which to create the file. If filePath is null,
the file is created in the current working directory.packageName
- The name of the package in which the class belongs. The packageName
is used to specify the package statement in the source code for the class.
If this value is null, no package statement is specified in the source code for the class.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.io.IOException
- If an error occurs while communicating with the
system.java.lang.InterruptedException
- If this thread is interrupted.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400FileRecordDescription(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public java.lang.String getFileName()
public java.lang.String getMemberName()
public java.lang.String getPath()
AS400FileRecordDescription(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
public AS400 getSystem()
AS400FileRecordDescription(com.ibm.as400.access.AS400, java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public void removeAS400FileRecordDescriptionListener(AS400FileRecordDescriptionListener listener)
listener
- The AS400FileRecordDescriptionListener.addAS400FileRecordDescriptionListener(com.ibm.as400.access.AS400FileRecordDescriptionListener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The VetoableChangeListener.addVetoableChangeListener(java.beans.VetoableChangeListener)
public RecordFormat[] retrieveRecordFormat() throws AS400Exception, AS400SecurityException, java.lang.InterruptedException, java.io.IOException
AS400File.setRecordFormat()
method. If the file is a physical file, the RecordFormat array returned
contains one
RecordFormat object. If the file is a multiple format logical file, the
RecordFormat array may contain
more than one RecordFormat object.
The system to which to connect and the integrated file system
pathname for the file must be set prior to invoking this method.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.java.io.IOException
- If an error occurs while communicating with the
system.java.lang.InterruptedException
- If this thread is interrupted.ServerStartupException
- If the host server cannot be started.java.net.UnknownHostException
- If the system cannot be located.AS400FileRecordDescription(com.ibm.as400.access.AS400, java.lang.String)
,
setPath(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public void setPath(java.lang.String name) throws java.beans.PropertyVetoException
name
- The integrated file system path name
of the file. If a member is not specified in name, the first
member of the file is used.java.beans.PropertyVetoException
- If a change is vetoed.public void setSystem(AS400 system) throws java.beans.PropertyVetoException
system
- The system to which to conenct.java.beans.PropertyVetoException
- If a change is vetoed.