|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lonniepryor.blues.util.Methods
Specification interface for identifying Methods. Instances of this class may be logically combined using the AND, OR, and NOT operations. Many common use-cases are supplied via static accessor methods.
Constructor Summary | |
protected |
Methods()
Creates a new Methods object. |
Method Summary | |
Methods |
and(Methods specification)
Returns a specification representing a logical AND of this specification on the left and the supplied specification on the right. |
static Methods |
declaredAbstract()
Returns a specification satisfied by Methods decalred as abstract. |
static Methods |
declaredFinal()
Returns a specification satisfied by Methods decalred as final. |
static Methods |
declaredNative()
Returns a specification satisfied by Methods decalred as native. |
static Methods |
declaredOn(Types specification)
Creates a new specification satisfied only by Methods hosted on classes that satisfy the supplied specification. |
static Methods |
declaredPackageProtected()
Returns a specification satisfied by Methods decalred as package protected. |
static Methods |
declaredPrivate()
Returns a specification satisfied by Methods decalred as private. |
static Methods |
declaredProtected()
Returns a specification satisfied by Methods decalred as protected. |
static Methods |
declaredPublic()
Returns a specification satisfied by Methods decalred as public. |
static Methods |
declaredStatic()
Returns a specification satisfied by Methods decalred as static. |
static Methods |
declaredSynchronized()
Returns a specification satisfied by Methods decalred as synchronized. |
static Methods |
equalTo(java.lang.reflect.Method toTest)
Creates a new specification satisfied by Methods equal to the supplied Method. |
protected abstract boolean |
evaluate(java.lang.reflect.Method method)
Returns true if the supplied Method satisfies this specification. |
boolean |
isSatisfiedBy(java.lang.reflect.Method method)
Returns true if the supplied Method is not null and satisfies this specification. |
boolean |
isSatisfiedByAll(java.lang.reflect.Method[] all)
Returns true if all of the supplied Methods satisfy this specification. |
boolean |
isSatisfiedByAny(java.lang.reflect.Method[] any)
Returns true if any of the supplied Methods satisfy this specification. |
static Methods |
named(java.lang.String namePattern)
Creates a new specification satisfied by Methods whose names match the supplied pattern. |
static Methods |
named(Strings specification)
Creates a new specification satisfied by Methods whose names satisfy the supplied specification. |
Methods |
not()
Returns a specification representing a logical NOT of this specification. |
Methods |
or(Methods specification)
Returns a specification representing a logical OR of this specification on the left and the supplied specification on the right. |
static Methods |
parse(java.lang.String methodsPattern)
Parses a pattern string into a complete Methods specification. |
static Methods |
propertyAccessors()
Returns a specification satisfied by Methods that are valid JavaBeans accessor methods. |
static Methods |
propertyMutators()
Returns a specification satisfied by Methods that are valid JavaBeans mutator methods. |
static Methods |
returning(Types specification)
Creates a new specification satisfied only by Methods that return Types that satisfy the supplied specification. |
static Methods |
returningVoid()
Returns a specification satisfied by Methods returning void. |
java.lang.reflect.Method[] |
selectAll(java.lang.reflect.Method[] from)
Selects all the Methods that satisfy this specification from the supplied Collection. |
java.lang.reflect.Method |
selectFirst(java.lang.reflect.Method[] from)
Selects the first Method that satisfies this specification from the supplied Collection. |
static Methods |
taking(Parameters specification)
Creates a new specification satisfied only by Methods with parameter Lists that satisfy the supplied specification. |
static Methods |
takingNoParameters()
Returns specification satisfied by Methods taking no parameters. |
static Methods |
takingOneParameter()
Returns a specification satisfied by Methods taking one parameter. |
static Methods |
throwing(Throwables specification)
Creates a new specification satisfied only by Methods with throwable sets that satisfy the supplied specification. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Methods()
Method Detail |
public static Methods declaredPublic()
public static Methods declaredProtected()
public static Methods declaredPrivate()
public static Methods declaredPackageProtected()
public static Methods declaredStatic()
public static Methods declaredAbstract()
public static Methods declaredFinal()
public static Methods declaredSynchronized()
public static Methods declaredNative()
public static Methods takingNoParameters()
public static Methods takingOneParameter()
public static Methods returningVoid()
public static Methods propertyAccessors()
public static Methods propertyMutators()
public static Methods equalTo(java.lang.reflect.Method toTest)
toTest
- The Method to be equal to.
public static Methods named(java.lang.String namePattern)
namePattern
- The pattern names must match.
public static Methods named(Strings specification)
specification
- The specification names must satisfy.
public static Methods declaredOn(Types specification)
specification
- The specification that classes must match.
public static Methods taking(Parameters specification)
specification
- The specification that parameter Lists must match.
public static Methods throwing(Throwables specification)
specification
- The specification that throwable sets must match.
public static Methods returning(Types specification)
specification
- The specification that return Types must match.
public static Methods parse(java.lang.String methodsPattern)
methods ::= throws-clause throws-clause ::= param-list [ " throws " throwables ] param-list ::= name "(" [ parameters ] ")" name ::= [ return-type ] [ types | "(" types-expr ")" "." ] ( strings | "(" strings-expr ")" ) return-type ::= [ modifiers ] ( types | "(" types-expr ")" ) modifiers ::= ( [ "!" ] ( "public" | "protected" | "package" | "private" | "static" | "abstract" | "final" | "synchronized" | "native" ) )...Example:
public void (com.lonniepryor..* && !javax..*+).foo(..)The above matches public void methods named foo taking any number of parameters on any class in the 'com.lonniepryor' namespace that is not assignable to a class in the 'javax' namespace.
methodsPattern
- The pattern string.
public final boolean isSatisfiedBy(java.lang.reflect.Method method)
method
- The Method to test.
protected abstract boolean evaluate(java.lang.reflect.Method method)
method
- The Method to test.
public final boolean isSatisfiedByAll(java.lang.reflect.Method[] all)
all
- The Collection of Methods to test.
public final boolean isSatisfiedByAny(java.lang.reflect.Method[] any)
any
- The Collection of Methods to test.
public final java.lang.reflect.Method selectFirst(java.lang.reflect.Method[] from)
from
- The Collection to select from.
public final java.lang.reflect.Method[] selectAll(java.lang.reflect.Method[] from)
from
- The Collection to select from.
public final Methods and(Methods specification)
specification
- The specification to AND with.
public final Methods or(Methods specification)
specification
- The specification to OR with.
public final Methods not()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |