All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.access.AS400FileRecordDescription
java.lang.Object
|
+----com.ibm.as400.access.AS400FileRecordDescription
- public class AS400FileRecordDescription
- extends Object
- implements Serializable
The AS400FileRecordDescription class represents the record descriptions of an AS/400 physical
or logical file. This class is used to retrieve the file field description
of an AS/400 physical or logical file, and to create Java source code
for a class extending from
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 AS/400 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 AS/400 Copy File (CPYF) command to create
a file with the same format as an existing file.
AS400FileRecordDescription objects generate the following events:
-
AS400FileRecordDescription()
- Constructs an AS400FileRecordDescription object.
-
AS400FileRecordDescription(AS400, String)
- Constructs an AS400FileRecordDescription object.
-
addAS400FileRecordDescriptionListener(AS400FileRecordDescriptionListener)
- Adds a listener to be notified when an AS400FileRecordDescriptionEvent is fired.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener to be notified when the value of any bound
property is changed.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a listener to be notified when the value of any constrained
property is changed.
-
createRecordFormatSource(String, String)
- 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.
-
getFileName()
- Returns the file name.
-
getMemberName()
- Returns the member name.
-
getPath()
- Returns the integrated file system path name
for the file as specified on the
constructor or the setPath() method.
-
getSystem()
- Returns the AS400 system object for this object.
-
removeAS400FileRecordDescriptionListener(AS400FileRecordDescriptionListener)
- Removes a listener from the AS400FileRecordDescription listeners list.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener from the change list.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a listener from the veto change listeners list.
-
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.
-
setPath(String)
- Sets the integrated file system path name for
the file.
-
setSystem(AS400)
- Sets the system to which to connect.
AS400FileRecordDescription
public AS400FileRecordDescription()
- Constructs an AS400FileRecordDescription object.
The system on which the file resides and the name of the
file must be set prior to invoking any other method in the class.
- See Also:
- setSystem, setPath
AS400FileRecordDescription
public AS400FileRecordDescription(AS400 system,
String name)
- Constructs an AS400FileRecordDescription object. It uses the specified system on
which the file resides and the
integrated file system path name of
the file.
- Parameters:
- system - The AS/400 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.
addAS400FileRecordDescriptionListener
public void addAS400FileRecordDescriptionListener(AS400FileRecordDescriptionListener listener)
- Adds a listener to be notified when an AS400FileRecordDescriptionEvent is fired.
- Parameters:
- listener - The As400FileRecordDescriptionListener.
- See Also:
- removeAS400FileRecordDescriptionListener
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a listener to be notified when the value of any bound
property is changed. The propertyChange method will be
be called.
- Parameters:
- listener - The PropertyChangeListener.
- See Also:
- removePropertyChangeListener
addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener listener)
- Adds a listener to be notified when the value of any constrained
property is changed.
The vetoableChange method will be called.
- Parameters:
- listener - The VetoableChangeListener.
- See Also:
- removeVetoableChangeListener
createRecordFormatSource
public synchronized void createRecordFormatSource(String filePath,
String packageName) throws AS400Exception, AS400SecurityException, IOException, InterruptedException
- 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. If the
file contains more than one record format (for example, is a multiple format logical file), a Java
source file for each record format in the file is created; each file will contain the class
definition for a single record format.
The name of the class is the name of the record format retrieved with the string "Format"
appended to it. The name of the file is the name of the class with the extension .java.
The source files generated can be compiled and used as input to the
AS400File.setRecordFormat() method.
The AS/400 system to which to connect and the integrated file system
pathname for the file must be set prior to invoking this method.
- Parameters:
- filePath - The path 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.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: IOException
- If an error occurs while communicating with the
AS/400.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: ServerStartupException
- If the AS/400 server cannot be started.
- Throws: UnknownHostException
- If the AS/400 system cannot be located.
- See Also:
- AS400FileRecordDescription, setPath, setSystem
getFileName
public String getFileName()
- Returns the file name.
- Returns:
- The file name. If the integrated file system pathname has not been
set for the object, an empty string is returned.
getMemberName
public String getMemberName()
- Returns the member name.
- Returns:
- The member name. If the integrated file system pathname has not
been set for the object, an empty string is returned.
getPath
public String getPath()
- Returns the integrated file system path name
for the file as specified on the
constructor or the setPath() method.
- Returns:
- The integrated file system path name
associated with this object.
If the integrated file system path name has not been set for the object,
an empty string is returned.
- See Also:
- AS400FileRecordDescription, setPath
getSystem
public AS400 getSystem()
- Returns the AS400 system object for this object.
- Returns:
- The AS400 system for this object. If the system has not been set,
null is returned.
- See Also:
- AS400FileRecordDescription, setSystem
removeAS400FileRecordDescriptionListener
public void removeAS400FileRecordDescriptionListener(AS400FileRecordDescriptionListener listener)
- Removes a listener from the AS400FileRecordDescription listeners list.
- Parameters:
- listener - The AS400FileRecordDescriptionListener.
- See Also:
- addAS400FileRecordDescriptionListener
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener from the change list.
- Parameters:
- listener - The PropertyChangeListener.
- See Also:
- addPropertyChangeListener
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a listener from the veto change listeners list.
- Parameters:
- listener - The VetoableChangeListener.
- See Also:
- addVetoableChangeListener
retrieveRecordFormat
public synchronized RecordFormat[] retrieveRecordFormat() throws AS400Exception, AS400SecurityException, InterruptedException, IOException
- 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. 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 AS/400 system to which to connect and the integrated file system
pathname for the file must be set prior to invoking this method.
- Returns:
- The record format(s) for the file.
- Throws: AS400Exception
- If the AS/400 system returns an error message.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: ConnectionDroppedException
- If the connection is dropped unexpectedly.
- Throws: IOException
- If an error occurs while communicating with the
AS/400.
- Throws: InterruptedException
- If this thread is interrupted.
- Throws: ServerStartupException
- If the AS/400 server cannot be started.
- Throws: UnknownHostException
- If the AS/400 system cannot be located.
- See Also:
- AS400FileRecordDescription, setPath, setSystem
setPath
public void setPath(String name) throws PropertyVetoException
- Sets the integrated file system path name for
the file.
- Parameters:
- 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.
- Throws: PropertyVetoException
- If a change is vetoed.
setSystem
public void setSystem(AS400 system) throws PropertyVetoException
- Sets the system to which to connect.
- Parameters:
- system - The system to which to conenct.
- Throws: PropertyVetoException
- If a change is vetoed.
All Packages Class Hierarchy This Package Previous Next Index