com.ibm.etools.iseries.comm.filters
Class ISeriesFieldFilterString
java.lang.Object
com.ibm.etools.iseries.comm.filters.ISeriesAbstractFilterString
com.ibm.etools.iseries.comm.filters.ISeriesFieldFilterString
public class ISeriesFieldFilterString
- extends ISeriesAbstractFilterString
A class representing an AS/400 Field filter string. This is a name pattern
for returning lists of AS/400 fields. Getting a list of fields requires the
library, file and record names to list in, and the name pattern for the fields.
All this information can be specified by calling the setLibrary(String)
,
setFile(String)
, setRecord(String)
and
setField(String)
methods.
Alternatively, it can be set by passing in a filter string in the constructor.
Filter strings for fields are of the form:
lib/file RCDNAME(rcd) FLDNAME(fld)
where is a generic field name, and rcd is either an explicit record name
or *FIRST to indicate the first record.
The library and file names can also be generic, if you desire a list of fields
from more than one file. If the file name is generic , then it is possible multiple files
from the same library will match the generic file name, with some of the files being data
files and some of the files being device files. By default, you will get back the
fields for all files that match the name pattern given for the file.
In this case of a generic file name, you may call the method setObjectType(String)
with "*FILE:" as the prefix and a file attribute name or generic name appended. For example,
"*FILE:PF-DTA" or "*FILE:DSPF". These attributes are used restrict the list to
specific file types. You can also specify multiple type:attr pairs as in
setObjectType("*FILE:DSPF *FILE:PRTF");
.
Alternatively, in the filter given in this class' constructor, specify the optional filter
keyword OBJTYPE. The valid forms of this are the same as the setObjectType method.
For example, to get a list of all fields in all data files whose name ends with "ACC"
in all libraries in the user part of the library list, specify this on the constructor:
*USRLIBL/*ACC(*) RCDNAME(*FIRST) FLDNAME(*) OBJTYPE(*FILE:PF-DTA)
.
Note that OBJTYPE syntax follows the rules of the ISeriesObjectFilterString
class,
and indeed generic file names result in a call to the getList method of
ISeriesListObjects
to resolve
the list of files, as part of the processing in the getList method of
ISeriesListRecords
.
Valid generic library, file, record and attribute names are names with one or two asterisks
anywhere in the name, as in:
ABC*
or *ABC
or A*C
*ABC*
or *A*C
or A*C*
To get the actual filter string from objects of this class, just call toString()
.
Objects of this class are used in the ISeriesListFields
class for returning a list of information about each field meeting the filter's criteria.
- See Also:
ISeriesListFields
Method Summary |
String |
getField()
Return the field name part of this filter string. |
String |
getFile()
Return the file name part of this filter string. |
String |
getLibrary()
Return the library name part of this filter string. |
String |
getObjectType()
Retrieve the object type as specified on the setObjectType(String) method. |
String |
getRecord()
Return the record name part of this filter string. |
boolean |
isGeneric()
Returns true if current filter represents a generic name versus a scalar name. |
boolean |
isMultiGeneric()
Returns true if current filter represents a generic name that has more than
one generic name part. |
void |
setField(String fld)
Set the field name part of this filter string. |
void |
setFile(String obj)
Set the name of the file containing the fields to list. |
void |
setLibrary(String lib)
Set the library name part of this filter string. |
void |
setObjectType(String type)
Specify the type of files to list fields in: data or device say. |
void |
setRecord(String rcd)
Set the record name part of this filter string. |
String |
toString()
Convert this filter into a filter string. |
Methods inherited from class com.ibm.etools.iseries.comm.filters.ISeriesAbstractFilterString |
addQuotes, clone, countHostOccurrencesOf, countOccurrencesOf, createFilterStringObject, equals, hashCode, hostIndexOf, hostIndexOf, isGenericLibraryName, isGenericName, isQuoted, stripQuotes, verifyGenericName, verifyGenericNameAdvanced, verifyGenericNameAdvancedQuoted, verifyGenericNameQuoted |
Copyright
public static final String Copyright
- See Also:
- Constant Field Values
DEFAULT_LIBRARY
public static final String DEFAULT_LIBRARY
- Default library name is *CURLIB
- See Also:
- Constant Field Values
DEFAULT_RCDNAME
public static final String DEFAULT_RCDNAME
- Default value for RCDNAME is *FIRST
- See Also:
- Constant Field Values
DEFAULT_OBJTYPE
public static final String DEFAULT_OBJTYPE
- Default value for OBJTYPE is *FILE:PF-DTA
- See Also:
- Constant Field Values
ALL
public static final String ALL
- Default value for file name, member name and member type is * (meaning all).
- See Also:
- Constant Field Values
ISeriesFieldFilterString
public ISeriesFieldFilterString()
- Constructor to use when there is no existing filter string.
This results in a default filter of
*CURLIB/* RCDNAME(*FIRST) FLDNAME(*)
, which
means list all fields in the first record in all files in the current library. That could be a lot!
To change any of the default values, after instantiation call:
setLibrary(String)
to set the library name. Note this can be generic too,
but this will result in a call to retrieve files in every library matching the library name pattern,
and a subsequent call to retrieve fields in every file found.
setFile(String)
to set the file name. This can be a simple or generic
name. If generic, you will get fields from multiple files.
setRecord(String)
to set the record name. This can be a simple record name
or *FIRST or a generic name to list fields from multiple records.
setField(String)
to set the field name pattern. This will result in a list of
fields subsetted to only those which match this pattern.
setObjectType(String)
to set the file type. Ignored unless the file name is generic.
Valid generic names have one or two asterisks anywhere in the name. A single asterisk means all.
ISeriesFieldFilterString
public ISeriesFieldFilterString(String input)
- Constructor to use when filter string already exists.
Filter strings for fields are of the form:
lib/file RCDNAME(rcd) FLDNAME(fld) OBJTYPE(*FILE:attr)
where:
lib
is the library containing the file containing the fields. This can
be a single library name or a generic library name like *ABC or *ROLL*.
Special values supported for library are *LIBL, *CURLIB, *USRLIBL and
*ALLUSR. Note that *LIBL means all files matching the file name pattern, not
the first library containing a match.
file
is the file containing the fields. This can
be a single file name or a generic file name like *A* or *ROLL*.
rcd
is the name or generic name of the records to list, or *FIRST to
indicate the first record.
OBJTYPE
is optional and only used when the file name is generic.
This tells the list processor what type of files - data or device - to consider when
resolving the list of files. Field in all files matching the file name and object type
will be returned. The default is to consider only data files, but by specifying
*FILE:PF-DSPF you can restrict it to display files, say.
To get the actual filter string from object of this class, just call toString()
.
getLibrary
public String getLibrary()
- Return the library name part of this filter string.
getFile
public String getFile()
- Return the file name part of this filter string.
getRecord
public String getRecord()
- Return the record name part of this filter string.
getField
public String getField()
- Return the field name part of this filter string.
setLibrary
public void setLibrary(String lib)
- Set the library name part of this filter string.
This can be simple or generic, where generic is a name containing
one or two asterisks anywhere in the name.
If a generic library, such as *LIBL or A*, is specified then you will
have a "multi-generic" filter that will result in a list containing
fields from more than one file.
- See Also:
ISeriesListFields
setFile
public void setFile(String obj)
- Set the name of the file containing the fields to list.
This can be simple or generic, where generic is a name containing
one or two asterisks anywhere in the name. If generic, then you
will have a "multi-generic" filter that will result in a list containing
fields from more than one file.
setRecord
public void setRecord(String rcd)
- Set the record name part of this filter string.
This can be simple or generic, where generic is a name containing
one or two asterisks anywhere in the name. It can also
be *FIRST to indicate the first record.
setField
public void setField(String fld)
- Set the field name part of this filter string.
This can be simple or generic, where generic is a name containing
one or two asterisks anywhere in the name.
setObjectType
public void setObjectType(String type)
- Specify the type of files to list fields in: data or device say. This method is only
needed when the file name is generic, and is ignored otherwise.
The default for this is
*FILE:PF-DTA
.
- Parameters:
type
- The file type and file attribute to use when resolving a generic file
name as part of processing this field filter. The type part must be *FILE, while the
attribute part can be any database or device file attribute such as PF-DTA or DSPF.
OBJTYPE(*FILE:PF-DTA)
or
OBJTYPE(*FILE:DSPF)
.
Other values will be allowed but will just result in an empty list of fields if no files
are found matching that type. If the type given is not *FILE, or the attribute isn't
data or device attributes, then you will probably also get an exception from the
getList method when attempting to retrieve the list.- See Also:
ISeriesObjectFilterString
getObjectType
public String getObjectType()
- Retrieve the object type as specified on the
setObjectType(String)
method.
This is only used when processing lists of fields where the file name is generic.
toString
public String toString()
- Convert this filter into a filter string.
Filter strings for fields are of the form:
lib/file RCDNAME(rcd) FLDNAME(fld)
where is a generic field name, and rcd is either an explicit record name
or *FIRST to indicate the first record.
- Specified by:
toString
in class ISeriesAbstractFilterString
isGeneric
public boolean isGeneric()
- Returns true if current filter represents a generic name versus a scalar name.
Note that a generic record name or name of *FIRST is considered generic,
as it does require an additional trip to the host to resolve the record name.
- Specified by:
isGeneric
in class ISeriesAbstractFilterString
isMultiGeneric
public boolean isMultiGeneric()
- Returns true if current filter represents a generic name that has more than
one generic name part. For example, a multi-generic filter might ask to list
all fields in file QDATA in all libraries that start with A.
Note that a generic record name or name of *FIRST is considered multi-generic,
as it does require an additional trip to the host to resolve the record name.
- Specified by:
isMultiGeneric
in class ISeriesAbstractFilterString
Copyright © 2011 IBM Corp. All Rights Reserved.
Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.