public class QSYSObjectPathName
extends java.lang.Object
implements java.io.Serializable
QSYSObjectPathName objects generate the following events:
This object can be used in two ways:
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.MBRFor objects or members that reside in QSYS, this format is used:
/QSYS.LIB/object.type /QSYS.LIB/object.FILE/member.MBRFor 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:
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"
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"
QSYSObjectPathName path = new QSYSObjectPathName("QGPL", "ACCOUNTS", "FILE"); // Will print "/QSYS.LIB/QGPL.LIB/ACCOUNTS.FILE" System.out.println(path.getPath());
QSYSObjectPathName path = new QSYSObjectPathName("QGPL", "ACCOUNTS", "PAYABLE", "MBR"); // Will print "/QSYS.LIB/QGPL.LIB/ACCOUNTS.FILE/PAYABLE.MBR" System.out.println(path.getPath());
Constructor and Description |
---|
QSYSObjectPathName()
Constructs a QSYSObjectPathName object.
|
QSYSObjectPathName(java.lang.String path)
Constructs a QSYSObjectPathName object.
|
QSYSObjectPathName(java.lang.String libraryName,
java.lang.String objectName,
java.lang.String objectType)
Constructs a QSYSObjectPathName object.
|
QSYSObjectPathName(java.lang.String libraryName,
java.lang.String objectName,
java.lang.String memberName,
java.lang.String objectType)
Constructs a QSYSObjectPathName object.
|
QSYSObjectPathName(java.lang.String aspName,
java.lang.String libraryName,
java.lang.String objectName,
java.lang.String memberName,
java.lang.String objectType)
Constructs a QSYSObjectPathName object.
|
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.String |
getAspName()
Returns the ASP on which the object resides.
|
java.lang.String |
getLibraryName()
Returns the library in which the object resides.
|
java.lang.String |
getMemberName()
Returns the name of the member.
|
java.lang.String |
getObjectName()
Returns the name of the object this path name represents.
|
java.lang.String |
getObjectType()
Returns type of object this path name represents.
|
java.lang.String |
getPath()
Returns the fully qualified integrated file system path name.
|
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 list.
|
void |
setAspName(java.lang.String aspName)
Sets the IASP in which the object resides.
|
void |
setLibraryName(java.lang.String libraryName)
Sets the library in which the object resides.
|
void |
setMemberName(java.lang.String memberName)
Sets the name of the member.
|
void |
setObjectName(java.lang.String objectName)
Sets the name of the object this path name represents.
|
void |
setObjectType(java.lang.String objectType)
Sets type of object this path name represents.
|
void |
setPath(java.lang.String path)
Sets the integrated file system path name for this object.
|
static java.lang.String |
toPath(java.lang.String libraryName,
java.lang.String objectName,
java.lang.String objectType)
Builds an integrated file system path name to represent the object.
|
static java.lang.String |
toPath(java.lang.String libraryName,
java.lang.String objectName,
java.lang.String memberName,
java.lang.String objectType)
Builds an integrated file system path name to represent the member.
|
static java.lang.String |
toPath(java.lang.String aspName,
java.lang.String libraryName,
java.lang.String objectName,
java.lang.String memberName,
java.lang.String objectType)
Builds an integrated file system path name to represent the member.
|
static java.lang.String |
toQSYSName(java.lang.String name)
Utility method for selectively uppercasing the characters in a string, for use as an IBM i *NAME value.
|
java.lang.String |
toQualifiedObjectName()
Returns a qualified object name, for use in API parameters.
|
public QSYSObjectPathName()
public QSYSObjectPathName(java.lang.String path)
path
- The fully qualified integrated file system name of an object in the QSYS file system.public QSYSObjectPathName(java.lang.String libraryName, java.lang.String objectName, java.lang.String objectType)
QSYSObjectPathName ifsName = new QSYSObjectPathName("library", "name", "type"); // This line will print "/QSYS.LIB/LIBRARY.LIB/NAME.TYPE". System.out.println(ifsName.getPath());
libraryName
- The library in which the object exists. It must be 1-10 characters.objectName
- The name of the object. It must be 1-10 characters.objectType
- The type of the object. It must be 1-6 characters. This is the IBM i system abbreviation 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.public QSYSObjectPathName(java.lang.String libraryName, java.lang.String objectName, java.lang.String memberName, java.lang.String objectType)
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());
libraryName
- The library in which the object exists. It must be 1-10 characters.objectName
- The name of the object. It must be 1-10 characters.memberName
- The name of the member. It must be 1-10 characters.objectType
- The type of the object. This must be "MBR".public QSYSObjectPathName(java.lang.String aspName, java.lang.String libraryName, java.lang.String objectName, java.lang.String memberName, java.lang.String objectType)
QSYSObjectPathName ifsName = new QSYSObjectPathName("iasp1", "library", "name", "member", "MBR"); // This line will print "/IASP1/QSYS.LIB/LIBRARY.LIB/NAME.FILE/MEMBER.MBR". System.out.println(ifsName.getPath());
aspName
- The IASP on which the object exists. It must be 1-10 characters.libraryName
- The library in which the object exists. It must be 1-10 characters.objectName
- The name of the object. It must be 1-10 characters.memberName
- The name of the member. It must be 1-10 characters.objectType
- The type of the object. This must be "MBR".public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener object.public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The listener object.public java.lang.String getAspName()
public java.lang.String getLibraryName()
public java.lang.String getMemberName()
public java.lang.String getObjectName()
public java.lang.String getObjectType()
public java.lang.String getPath()
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener object.public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The listener object.public void setAspName(java.lang.String aspName) throws java.beans.PropertyVetoException
aspName
- The IASP in which the object exists. It must be 1-10 characters.java.beans.PropertyVetoException
- If the change was vetoed.public void setLibraryName(java.lang.String libraryName) throws java.beans.PropertyVetoException
libraryName
- The library in which the object exists. It must be 1-10 characters.java.beans.PropertyVetoException
- If the change was vetoed.public void setMemberName(java.lang.String memberName) throws java.beans.PropertyVetoException
memberName
- 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.java.beans.PropertyVetoException
- If the change was vetoed.public void setObjectName(java.lang.String objectName) throws java.beans.PropertyVetoException
objectName
- The name of the object. It must be 1-10 characters.java.beans.PropertyVetoException
- If the change was vetoed.public void setObjectType(java.lang.String objectType) throws java.beans.PropertyVetoException
objectType
- The type of the object. It must be 1-6 characters. This is the IBM i system abbreviation 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.java.beans.PropertyVetoException
- If the change was vetoed.public void setPath(java.lang.String path) throws java.beans.PropertyVetoException
path
- The fully qualified integrated file system name of an object in the QSYS file system.java.beans.PropertyVetoException
- If the change was vetoed.public static java.lang.String toPath(java.lang.String libraryName, java.lang.String objectName, java.lang.String objectType)
libraryName
- The library the object is in. It must be 1-10 characters.objectName
- The name of the object. It must be 1-10 characters.objectType
- The type of the object. It must be 1-6 characters. This is the IBM i system abbreviation 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.public static java.lang.String toPath(java.lang.String libraryName, java.lang.String objectName, java.lang.String memberName, java.lang.String objectType)
libraryName
- The library the object is in. It must be 1-10 characters.objectName
- The name of the object. It must be 1-10 characters.memberName
- The name of the member. It must be 1-10 characters.objectType
- The type of the object. This must be "MBR".public static java.lang.String toPath(java.lang.String aspName, java.lang.String libraryName, java.lang.String objectName, java.lang.String memberName, java.lang.String objectType)
aspName
- The IASP on which the object exists. It must be 1-10 characters.libraryName
- The library the object is in. It must be 1-10 characters.objectName
- The name of the object. It must be 1-10 characters.memberName
- The name of the member. It must be 1-10 characters.objectType
- The type of the object. This must be "MBR".public static final java.lang.String toQSYSName(java.lang.String name)
name
- The name to be uppercased.public java.lang.String toQualifiedObjectName()