Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.comm.filters
Class ISeriesAbstractFilterString

java.lang.Object
  extended by com.ibm.etools.iseries.comm.filters.ISeriesAbstractFilterString
Direct Known Subclasses:
ISeriesFieldFilterString, ISeriesIFSFilterString, ISeriesJobFilterString, ISeriesMemberFilterString, ISeriesObjectFilterString, ISeriesRecordFilterString, ISeriesSplfFilterString

public abstract class ISeriesAbstractFilterString
extends Object

Base class and factory for AS/400 filter string objects. The child classes take care of parsing a string into its constituents, and generating the correct filter string from the constituents. The factory method parses a string enough to determine which child class to instantiate and return.


Field Summary
static String Copyright
           
protected static char QUOTE
           
protected static char WILDCARD
           
 
Constructor Summary
ISeriesAbstractFilterString()
           
 
Method Summary
static String addQuotes(String input)
          Helper method to add beginning + ending quotes to a string
 Object clone()
          Support cloning
static int countHostOccurrencesOf(String haystack, String needle, int start)
          Utility method.
static int countOccurrencesOf(String haystack, char needle)
          Helper method.
static ISeriesAbstractFilterString createFilterStringObject(String input)
          Factory method
 boolean equals(Object obj)
          Support sequential lookup
 int hashCode()
          Support keyed lookup.
static int hostIndexOf(String haystack, char needle, int start)
          Utility method.
static int hostIndexOf(String haystack, String needle, int start)
          Utility method.
abstract  boolean isGeneric()
          Returns true if current filter represents a generic name or vs a scalar name.
static boolean isGenericLibraryName(String name)
          Utility method that returns true if a given library name is generic or not.
static boolean isGenericName(String name)
          Utility method that returns true if a given name is generic or not.
abstract  boolean isMultiGeneric()
          Returns true if current filter represents a generic name that has more than one generic name part.
static boolean isQuoted(String input)
          Helper method to tell you if a string is quoted or not.
static String stripQuotes(String input)
          Helper method to strip beginning + ending quotes from a string
abstract  String toString()
          Force all child classes to intelligently implement toString.
static boolean verifyGenericName(String name)
          Utility method to ensure a generic name meets the rules for PDM-style generic names.
static boolean verifyGenericNameAdvanced(String name)
          Utility method to ensure a generic name meets the rules for advanced style generic names.
static boolean verifyGenericNameAdvancedQuoted(String name)
          Utility method to ensure a generic quoted name meets the rules for advanced-style generic quoted names.
static boolean verifyGenericNameQuoted(String name)
          Utility method to ensure a generic quoted name meets the rules for PDM-style generic quoted names.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

WILDCARD

protected static final char WILDCARD
See Also:
Constant Field Values

QUOTE

protected static final char QUOTE
See Also:
Constant Field Values
Constructor Detail

ISeriesAbstractFilterString

public ISeriesAbstractFilterString()
Method Detail

toString

public abstract String toString()
Force all child classes to intelligently implement toString.

Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Support sequential lookup

Overrides:
equals in class Object

hashCode

public int hashCode()
Support keyed lookup.

Overrides:
hashCode in class Object

clone

public Object clone()
Support cloning

Overrides:
clone in class Object

isGeneric

public abstract boolean isGeneric()
Returns true if current filter represents a generic name or vs a scalar name. The rules for determining this are different per type of filter so each child class implements this method uniquely.


isMultiGeneric

public abstract 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 members in file QRPGLESRC in all libraries that start with A. The rules for determining this are different per type of filter so each child class implements this method uniquely.


isGenericName

public static boolean isGenericName(String name)
Utility method that returns true if a given name is generic or not. Does NOT take into account special values like *LIBL or object types like *FILE.


isGenericLibraryName

public static boolean isGenericLibraryName(String name)
Utility method that returns true if a given library name is generic or not. Does take into account special value *CURLIB, which is not generic. Note *LIBL and *USRLIBL are generic as even for object lists we interpret *LIBL/A* to mean list all objects that start with A inside all libraries on the library list.


verifyGenericName

public static boolean verifyGenericName(String name)
Utility method to ensure a generic name meets the rules for PDM-style generic names. Valid names are: - no asterisks - one asterisk anywhere - one asterisk at the beginning and one asterisk at the end.


verifyGenericNameAdvanced

public static boolean verifyGenericNameAdvanced(String name)
Utility method to ensure a generic name meets the rules for advanced style generic names. Valid names are: - no asterisks - one asterisk anywhere - two asterisks anywhere


verifyGenericNameQuoted

public static boolean verifyGenericNameQuoted(String name)
Utility method to ensure a generic quoted name meets the rules for PDM-style generic quoted names. Valid names are: - no asterisks - one asterisk anywhere - one asterisk at the beginning and one asterisk at the end.


verifyGenericNameAdvancedQuoted

public static boolean verifyGenericNameAdvancedQuoted(String name)
Utility method to ensure a generic quoted name meets the rules for advanced-style generic quoted names. Valid names are: - no asterisks - one asterisk anywhere - two asterisks anywhere


stripQuotes

public static String stripQuotes(String input)
Helper method to strip beginning + ending quotes from a string


addQuotes

public static String addQuotes(String input)
Helper method to add beginning + ending quotes to a string


isQuoted

public static boolean isQuoted(String input)
Helper method to tell you if a string is quoted or not. Extended AS/400 names for libraries and objects have enclosing quotes.


countOccurrencesOf

public static int countOccurrencesOf(String haystack,
                                     char needle)
Helper method. Count occurrences of given character in given string. Does NOT take into account quoted names.


countHostOccurrencesOf

public static int countHostOccurrencesOf(String haystack,
                                         String needle,
                                         int start)
Utility method. Look for number of occurrences of one string in another, but taking care not to search inside quoted parts. This is important for quoted names such as AS/400 allows. Originally from CODE Project Organizer.

Returns:
count

hostIndexOf

public static int hostIndexOf(String haystack,
                              String needle,
                              int start)
Utility method. Look for an occurrences of one string in another, but taking care not to search inside quoted parts. This is important for quoted names such as AS/400 allows. Originally from CODE Project Organizer.

Returns:
zero-based starting position if found, or -1 otherwise

hostIndexOf

public static int hostIndexOf(String haystack,
                              char needle,
                              int start)
Utility method. Look for an occurrences of one char in a string, but taking care not to search inside quoted parts. This is important for quoted names such as AS/400 allows. Originally from CODE Project Organizer.

Returns:
zero-based starting position if found, or -1 otherwise

createFilterStringObject

public static ISeriesAbstractFilterString createFilterStringObject(String input)
Factory method


Rational Developer for Power Systems Software
V7.6

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.