All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.access.QSYSObjectPathName
java.lang.Object
|
+----com.ibm.as400.access.QSYSObjectPathName
- public class QSYSObjectPathName
- extends Object
- implements Serializable
The QSYSObjectPathName class provides
an integrated file system path name that represents an object in the QSYS
library file system.
QSYSObjectPathName objects generate the following events:
PropertyChangeEvent.
This object can be used in two ways:
- To parse the integrated file system path name to ensure correct
syntax and to extract the library, object, member, and object type
- To build an integrated file system path name from a library,
object, and member or object type.
IllegalPathNameExceptions are thrown if errors are found.
Objects in the QSYS file system have integrated file system names with the
following format for objects or members in a library other than QSYS:
/QSYS.LIB/library.LIB/object.type
/QSYS.LIB/library.LIB/object.FILE/member.MBR
For objects or members that reside in QSYS, this format is used:
/QSYS.LIB/object.type
/QSYS.LIB/object.FILE/member.MBR
For example:
/QSYS.LIB/QGPL.LIB/CRTLIB.CMD
/QSYS.LIB/QGPL.LIB/ACCOUNTS.FILE/PAYABLE.MBR
/QSYS.LIB/CRTLIB.CMD
/QSYS.LIB/ACCOUNTS.FILE/PAYABLE.MBR
In an integrated file system path name,
special values, such as *ALL, that begin with an asterisk
are not depicted with an asterisk but with leading and trailing
percent signs (%ALL%). In the
integrated file system, an asterisk is a wildcard character. The following
special values are recognized by this class:
Library name: %ALL%(*ALL), %ALLUSR%(*ALLUSR), %CURLIB%(*CURLIB),
%LIBL%(*LIBL), %USRLIBL%(*USRLIBL)
Object name: %ALL%(*ALL)
Member name: %ALL%(*ALL), %FILE%(*FILE), %FIRST%(*FIRST), %LAST%(*LAST)
%NONE%(*NONE)
The path name will be in uppercase. If case needs
to be preserved for a library, object, or member name, quotation marks should
be used around the names. For example,
QSYSObjectPathName path = new
QSYSObjectPathName("/QSYS.LIB/\"MixedCase\".LIB/\"lowercase\".FILE");
Examples:
- This code will extract the pieces of an integrated file system name
that represents a file.
QSYSObjectPathName path = new
QSYSObjectPathName("/QSYS.LIB/QGPL.LIB/ACCOUNTS.FILE");
System.out.println(path.getLibraryName()); // will print "QGPL"
System.out.println(path.getObjectName()); // will print "ACCOUNTS"
System.out.println(path.getObjectType()); // will print "FILE"
- This code will extract the pieces of an integrated file system name
that represents a member.
QSYSObjectPathName path = new
QSYSObjectPathName("/QSYS.LIB/QGPL.LIB/ACCOUNTS.FILE/PAYABLE.MBR");
System.out.println(path.getLibraryName()); // will print "QGPL"
System.out.println(path.getObjectName()); // will print "ACCOUNTS"
System.out.println(path.getMemberName()); // will print "PAYABLE"
System.out.println(path.getObjectType()); // will print "MBR"
- This code will build an integrated file system name for a file.
QSYSObjectPathName path = new
QSYSObjectPathName("QGPL", "ACCOUNTS", "FILE");
// will print "/QSYS.LIB/QGPL.LIB/ACCOUNTS.FILE"
System.out.println(path.getPath());
- This code will build an integrated file system name for a member.
QSYSObjectPathName path = new
QSYSObjectPathName("QGPL", "ACCOUNTS", "PAYABLE", "MBR");
// will print "/QSYS.LIB/QGPL.LIB/ACCOUNTS.FILE/PAYABLE.MBR"
System.out.println(path.getPath());
-
QSYSObjectPathName()
- Constructs an QSYSObjectPathName object.
-
QSYSObjectPathName(String)
- Constructs an QSYSObjectPathName object.
-
QSYSObjectPathName(String, String, String)
- Constructs an QSYSObjectPathName object.
-
QSYSObjectPathName(String, String, String, String)
- Constructs an QSYSObjectPathName object.
-
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.
-
getLibraryName()
- Returns the library in which the object resides.
-
getMemberName()
- Returns the name of the member.
-
getObjectName()
- Returns the name of the object this path name represents.
-
getObjectType()
- Returns type of object this path name represents.
-
getPath()
- Returns the fully qualified integrated file system path name.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener from the change list.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a listener from the veto list.
-
setLibraryName(String)
- Sets the library in which the object resides.
-
setMemberName(String)
- Sets the name of the member.
-
setObjectName(String)
- Sets the name of the object this path name represents.
-
setObjectType(String)
- Sets type of object this path name represents.
-
setPath(String)
- Sets the integrated file system path name for this object.
-
toPath(String, String, String)
- Builds an integrated file system path name to represent the object.
-
toPath(String, String, String, String)
- Builds an integrated file system path name to represent the member.
QSYSObjectPathName
public QSYSObjectPathName()
- Constructs an QSYSObjectPathName object.
It creates an integrated file system path name for an object in the QSYS
file system.
QSYSObjectPathName
public QSYSObjectPathName(String path)
- Constructs an QSYSObjectPathName object.
It creates an integrated file system path name for an object in the QSYS
file system.
- Parameters:
- path - The fully qualified integrated file system name of an
object in the QSYS file system.
QSYSObjectPathName
public QSYSObjectPathName(String library,
String object,
String type)
- Constructs an QSYSObjectPathName object.
It builds an integrated file system path name to represent the object.
QSYSObjectPathName ifsName = new
QSYSObjectPathName("library", "name", "type");
// This line will print "/QSYS.LIB/LIBRARY.LIB/NAME.TYPE".
System.out.println(ifsName.getPath());
- Parameters:
- library - The library in which the object exists. It must be 1-10 characters.
- object - The name of the object. It must be 1-10 characters.
- type - The type of the object. It must be 1-6 characters.
This is the AS/400 abbrethroughtion for the type of object,
for example, LIB for library, or CMD for command.
Types can be found by prompting for the OBJTYPE
parameter on commands such as WRKOBJ.
QSYSObjectPathName
public QSYSObjectPathName(String library,
String object,
String member,
String type)
- Constructs an QSYSObjectPathName object.
It builds an integrated file system path name to represent the member.
QSYSObjectPathName ifsName = new
QSYSObjectPathName("library", "name", "member", "MBR");
// This line will print "/QSYS.LIB/LIBRARY.LIB/NAME.FILE/MEMBER.MBR".
System.out.println(ifsName.getPath());
- Parameters:
- library - The library in which the object exists. It must be 1-10 characters.
- object - The name of the object. It must be 1-10 characters.
- member - The name of the member. It must be 1-10 characters.
- type - The type of the object. This must be MBR.
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 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
getLibraryName
public String getLibraryName()
- Returns the library in which the object resides.
- Returns:
- The name of the library.
getMemberName
public String getMemberName()
- Returns the name of the member. If this object does not represent a
member, an empty string is returned.
- Returns:
- The name of the member.
getObjectName
public String getObjectName()
- Returns the name of the object this path name represents. If this
object represents a member, the object name is the name of the file
in which the member exists.
- Returns:
- The name of the object.
getObjectType
public String getObjectType()
- Returns type of object this path name represents.
Type is the AS/400 abbrethroughtion for the type of object,
for example, LIB for library, or CMD for command.
Types can be found by prompting for the OBJTYPE
parameter on commands such as WRKOBJ.
- Returns:
- The type of the object.
getPath
public String getPath()
- Returns the fully qualified integrated file system path name.
- Returns:
- The fully qualified integrated file system path name.
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener from the change list.
If the listener is not on the list, do nothing.
- Parameters:
- listener - The PropertyChangeListener.
- See Also:
- addPropertyChangeListener
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a listener from the veto list.
If the listener is not on the list, do nothing.
- Parameters:
- listener - The VetoableChangeListener.
- See Also:
- addVetoableChangeListener
setLibraryName
public void setLibraryName(String library) throws PropertyVetoException
- Sets the library in which the object resides.
This is a bound and constrained property.
Note that changes to this property also affect the pathName property.
- Parameters:
- library - The library in which the object exists. It must be 1-10 characters.
- Throws: PropertyVetoException
- If the change was vetoed.
setMemberName
public void setMemberName(String member) throws PropertyVetoException
- Sets the name of the member. If a value other than an empty String ("")
is specified, the object type is set to MBR.
This is a bound and constrained property.
Note that changes to this property also affect the
objectType and pathName properties.
- Parameters:
- member - The name of the member. It must be 10 characters or less.
An empty String ("") can be passed to indicate this
object does not represent a member.
- Throws: PropertyVetoException
- If the change was vetoed.
setObjectName
public void setObjectName(String object) throws PropertyVetoException
- Sets the name of the object this path name represents. If this
object represents a member, the object name is the name of the file
that the member is in.
This is a bound and constrained property.
Note that changes to this property also affect the pathName property.
- Parameters:
- object - The name of the object. It must be 1-10 characters.
- Throws: PropertyVetoException
- If the change was vetoed.
setObjectType
public void setObjectType(String type) throws PropertyVetoException
- Sets type of object this path name represents. If the type is not MBR,
the member name property will be set to an empty string.
The value will be uppercased.
This is a bound and constrained property.
Note that changes to this property also affect the
memberName and pathName properties.
- Parameters:
- type - The type of the object. It must be 1-6 characters.
This is the AS/400 abbrethroughtion for the type of object,
for example, LIB for library, or CMD for command.
Types can be found by prompting for the OBJTYPE
parameter on commands such as WRKOBJ.
- Throws: PropertyVetoException
- If the change was vetoed.
setPath
public void setPath(String path) throws PropertyVetoException
- Sets the integrated file system path name for this object.
This is a bound and constrained property.
Note that changes to this property also affect the libraryName,
memberName, objectName, and objectType properties.
- Parameters:
- path - The fully qualified integrated file system name of an
object in the QSYS file system.
- Throws: PropertyVetoException
- If the change was vetoed.
toPath
public static String toPath(String library,
String object,
String type)
- Builds an integrated file system path name to represent the object.
- Parameters:
- library - The library the object is in. It must be 1-10 characters.
- object - The name of the object. It must be 1-10 characters.
- type - The type of the object. It must be 1-6 characters.
This is the AS/400 abbrethroughtion for the type of object,
for example, LIB for library, or CMD for command.
Types can be found by prompting for the OBJTYPE
parameter on commands such as WRKOBJ.
- Returns:
- The integrated file system name for the object.
toPath
public static String toPath(String library,
String object,
String member,
String type)
- Builds an integrated file system path name to represent the member.
- Parameters:
- library - The library the object is in. It must be 1-10 characters.
- object - The name of the object. It must be 1-10 characters.
- member - The name of the member. It must be 1-10 characters.
- type - The type of the object. This must be MBR.
- Returns:
- The integrated file system name for the object.
All Packages Class Hierarchy This Package Previous Next Index