|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lonniepryor.blues.util.Constructors
Specification interface for identifying Constructors. 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 |
Constructors()
Creates a new Constructors object. |
Method Summary | |
Constructors |
and(Constructors specification)
Returns a specification representing a logical AND of this specification on the left and the supplied specification on the right. |
static Constructors |
declaredOn(Types specification)
Creates a new specification satisfied only by Constructors hosted on the Types that satisfy the supplied specification. |
static Constructors |
declaredPackageProtected()
Returns a specification satisfied by Constructors decalred as package protected. |
static Constructors |
declaredPrivate()
Returns a specification satisfied by Constructors decalred as private. |
static Constructors |
declaredProtected()
Returns a specification satisfied by Constructors decalred as protected. |
static Constructors |
declaredPublic()
Returns a specification satisfied by Constructors decalred as public. |
static Constructors |
equalTo(java.lang.reflect.Constructor toTest)
Creates a new specification satisfied by Constructors equal to the supplied Constructor. |
protected abstract boolean |
evaluate(java.lang.reflect.Constructor constructor)
Returns true if the supplied Constructor satisfies this specification. |
boolean |
isSatisfiedBy(java.lang.reflect.Constructor constructor)
Returns true if the supplied Constructor is not null and satisfies this specification. |
boolean |
isSatisfiedByAll(java.lang.reflect.Constructor[] all)
Returns true if all of the supplied Constructors satisfy this specification. |
boolean |
isSatisfiedByAny(java.lang.reflect.Constructor[] any)
Returns true if any of the supplied Constructors satisfy this specification. |
Constructors |
not()
Returns a specification representing a logical NOT of this specification. |
Constructors |
or(Constructors specification)
Returns a specification representing a logical OR of this specification on the left and the supplied specification on the right. |
static Constructors |
parse(java.lang.String ctorsPattern)
Parses a pattern string into a complete Constructors specification. |
static Constructors |
publicFactories()
Returns a specification satisfied by public Constructors that take no parameters. |
java.lang.reflect.Constructor[] |
selectAll(java.lang.reflect.Constructor[] from)
Selects all the Constructors that satisfy this specification from the supplied array. |
java.lang.reflect.Constructor |
selectFirst(java.lang.reflect.Constructor[] from)
Selects the first Constructor that satisfies this specification from the supplied array. |
static Constructors |
taking(Parameters specification)
Creates a new specification satisfied only by Constructors with parameter Lists that satisfy the supplied specification. |
static Constructors |
takingNoParameters()
Returns a specification satisfied by Constructors that take no parameters. |
static Constructors |
takingOneParameter()
Returns a specification satisfied by Constructors that take exactly one parameter. |
static Constructors |
throwing(Throwables specification)
Creates a new specification satisfied only by Constructors 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 Constructors()
Method Detail |
public static Constructors declaredPublic()
public static Constructors declaredProtected()
public static Constructors declaredPrivate()
public static Constructors declaredPackageProtected()
public static Constructors takingNoParameters()
public static Constructors takingOneParameter()
public static Constructors publicFactories()
public static Constructors equalTo(java.lang.reflect.Constructor toTest)
toTest
- The Constructor to be equal to.
public static Constructors declaredOn(Types specification)
specification
- The specification that Types must match.
public static Constructors taking(Parameters specification)
specification
- The specification that parameter Lists must match.
public static Constructors throwing(Throwables specification)
specification
- The specification that throwable sets must match.
public static Constructors parse(java.lang.String ctorsPattern)
constructors ::= throws-clause throws-clause ::= param-list [ " throws " throwables ] param-list ::= declaring-type "(" [ parameters ] ")" declaring-type ::= [ modifiers ] [ types | "(" types-expr ")" "." ] "new" modifiers ::= ( [ "!" ] ( "public" | "protected" | "package" | "private" ) )...Example:
public (com.lonniepryor..* && !javax..*+).new(..)The above matches public constructors taking any number of parameters on any class in the 'com.lonniepryor' namespace that is not assignable to a class in the 'javax' namespace.
ctorsPattern
- The pattern string.
Types.parse(String)
,
Parameters.parse(String)
public final boolean isSatisfiedBy(java.lang.reflect.Constructor constructor)
constructor
- The Constructor to test.
protected abstract boolean evaluate(java.lang.reflect.Constructor constructor)
constructor
- The Constructor to test.
public final boolean isSatisfiedByAll(java.lang.reflect.Constructor[] all)
all
- The array of Constructors to test.
public final boolean isSatisfiedByAny(java.lang.reflect.Constructor[] any)
any
- The array of Constructors to test.
public final java.lang.reflect.Constructor selectFirst(java.lang.reflect.Constructor[] from)
from
- The array to select from.
public final java.lang.reflect.Constructor[] selectAll(java.lang.reflect.Constructor[] from)
from
- The array to select from.
public final Constructors and(Constructors specification)
specification
- The specification to AND with.
public final Constructors or(Constructors specification)
specification
- The specification to OR with.
public final Constructors not()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |