gshute.util
Class Filters

java.lang.Object
  |
  +--gshute.util.Filters

public class Filters
extends java.lang.Object

Class Filters is a factory class that provides filters for accepting classes and methods based on various criteria. In addition, this class provides static methods for directly testing whether or not classes methods meet various criteria.


Inner Class Summary
 class Filters.Compound
          A Filters.Compound object combines the acceptance decisions of its constituent filters.
 
Method Summary
static boolean classSubclassOf(java.lang.Class cl1, java.lang.Class cl2)
          Filters.classSubclassOf(cl1, cl2) returns true if cl1 is a subclass of cl2.
static Filter getClassNotSubclassOfFilter(java.lang.Class cl)
          Filters.getClassNotSubclassOfFilter(cl) returns a filter that filters objects from class Class.
static Filter getClassNotSuperclassOfFilter(java.lang.Class cl)
          Filters.getClassNotSuperclassOfFilter(cl) returns a filter that filters objects from class Class.
static Filter getClassSubclassOfFilter(java.lang.Class cl)
          Filters.getClassSubclassOfFilter(cl) returns a filter that filters objects from class Class.
static Filter getClassSuperclassOfFilter(java.lang.Class cl)
          Filters.getClassSuperclassOfFilter(cl) returns a filter that filters objects from class Class.
static Filter getMethodImpByFilter(java.lang.Class cl)
          Filters.getMethodImpByFilter(cl) returns a filter that filters objects from class Method.
static Filter getMethodNameFilter(java.lang.String strt, java.lang.String end)
          Filters.getMethodNameFilter(strt, end) returns a filter that filters objects from class Method.
static Filter getMethodNotImpByFilter(java.lang.Class cl)
          Filters.getMethodNotImpByFilter(cl) returns a filter that filters objects from class Method.
static Filter getMethodNumArgsFilter(int n)
          Filters.getMethodNumArgsFilter(n) returns a filter that filters objects from class Method.
static boolean methodImpBy(java.lang.reflect.Method m, java.lang.Class cl)
          Filters.methodImpBy(m, cl) returns true if the declaring class of m is a superclass of cl.
static boolean methodNameMatches(java.lang.reflect.Method m, java.lang.String strt, java.lang.String end)
          Filters.methodNameMatches(m, strt, end) returns true if the name of m starts with strt and ends with end.
static boolean methodNumArgsEquals(java.lang.reflect.Method m, int n)
          Filters.methodNumArgsEquals(m, n) returns true if m has exactly n arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

classSubclassOf

public static boolean classSubclassOf(java.lang.Class cl1,
                                      java.lang.Class cl2)
Filters.classSubclassOf(cl1, cl2) returns true if cl1 is a subclass of cl2.

methodNameMatches

public static boolean methodNameMatches(java.lang.reflect.Method m,
                                        java.lang.String strt,
                                        java.lang.String end)
Filters.methodNameMatches(m, strt, end) returns true if the name of m starts with strt and ends with end. Empty strings match the beginning or end of any method name.

methodNumArgsEquals

public static boolean methodNumArgsEquals(java.lang.reflect.Method m,
                                          int n)
Filters.methodNumArgsEquals(m, n) returns true if m has exactly n arguments.

methodImpBy

public static boolean methodImpBy(java.lang.reflect.Method m,
                                  java.lang.Class cl)
Filters.methodImpBy(m, cl) returns true if the declaring class of m is a superclass of cl.

getClassSubclassOfFilter

public static Filter getClassSubclassOfFilter(java.lang.Class cl)
Filters.getClassSubclassOfFilter(cl) returns a filter that filters objects from class Class. The filter accepts a class if it is a subclass of class cl.

getClassNotSubclassOfFilter

public static Filter getClassNotSubclassOfFilter(java.lang.Class cl)
Filters.getClassNotSubclassOfFilter(cl) returns a filter that filters objects from class Class. The filter accepts a class if it is not a subclass of class cl.

getClassSuperclassOfFilter

public static Filter getClassSuperclassOfFilter(java.lang.Class cl)
Filters.getClassSuperclassOfFilter(cl) returns a filter that filters objects from class Class. The filter accepts a class if it is a superclass of class cl.

getClassNotSuperclassOfFilter

public static Filter getClassNotSuperclassOfFilter(java.lang.Class cl)
Filters.getClassNotSuperclassOfFilter(cl) returns a filter that filters objects from class Class. The filter accepts a class if it is not a superclass of class cl.

getMethodNameFilter

public static Filter getMethodNameFilter(java.lang.String strt,
                                         java.lang.String end)
Filters.getMethodNameFilter(strt, end) returns a filter that filters objects from class Method. The filter accepts a method if its name begins with strt and ends with end. Either of these strings may be empty to match any method name.

getMethodNumArgsFilter

public static Filter getMethodNumArgsFilter(int n)
Filters.getMethodNumArgsFilter(n) returns a filter that filters objects from class Method. The filter accepts a method if it has n parameters.

getMethodImpByFilter

public static Filter getMethodImpByFilter(java.lang.Class cl)
Filters.getMethodImpByFilter(cl) returns a filter that filters objects from class Method. The filter accepts a method if it is implemented by class cl.

getMethodNotImpByFilter

public static Filter getMethodNotImpByFilter(java.lang.Class cl)
Filters.getMethodNotImpByFilter(cl) returns a filter that filters objects from class Method. The filter accepts a method if it is not implemented by class cl.