|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lonniepryor.blues.util.Throwables
Specification interface for identifying sets of Types. 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 |
Throwables()
Creates a new Throwables object. |
Method Summary | |
Throwables |
and(Throwables specification)
Returns a specification representing a logical AND of this specification on the left and the supplied specification on the right. |
static Throwables |
any()
Returns a specification matching any not-null throwable set. |
static Throwables |
containing(Types specification)
Returns a specification matching any throwable set containing an element that satisfies the supplied specification. |
protected abstract boolean |
evaluate(java.lang.Class[] throwableTypes)
Returns true if the supplied throwable set satisfies this specification. |
boolean |
isSatisfiedBy(java.lang.Class[] throwableTypes)
Returns true if the supplied throwable set is not null and satisfies this specification. |
boolean |
isSatisifiedByAll(java.lang.Class[][] all)
Returns true if all of the supplied throwable sets satisfy this specification. |
boolean |
isSatisifiedByAny(java.lang.Class[][] any)
Returns true if any of the supplied throwable sets satisfy this specification. |
Throwables |
not()
Returns a specification representing a logical NOT of this specification. |
Throwables |
or(Throwables specification)
Returns a specification representing a logical OR of this specification on the left and the supplied specification on the right. |
static Throwables |
parse(java.lang.String throwablesPattern)
Parses a pattern string into a complete Throwables specification. |
java.lang.Class[][] |
selectAll(java.lang.Class[][] from)
Selects all the throwable sets that satisfy this specification from the supplied array. |
java.lang.Class[] |
selectFirst(java.lang.Class[][] from)
Selects the first throwable set that satisfies this specification from the supplied array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Throwables()
Method Detail |
public static Throwables any()
public static Throwables containing(Types specification)
specification
- The specification that any element in canidate throwable
sets must match.
public static Throwables parse(java.lang.String throwablesPattern)
throwables ::= element [ "," element ]... element ::= [ "!" ] ( types | ( "(" types-expr ")" ) )
throwablesPattern
- The content of the pattern.
ParseException
- if the pattern is invalid.public final boolean isSatisfiedBy(java.lang.Class[] throwableTypes)
throwableTypes
- The throwable set to test.
protected abstract boolean evaluate(java.lang.Class[] throwableTypes)
throwableTypes
- The throwable set to test.
public final boolean isSatisifiedByAll(java.lang.Class[][] all)
all
- The array of throwable sets to test.
public final boolean isSatisifiedByAny(java.lang.Class[][] any)
any
- The array of throwable sets to test.
public final java.lang.Class[] selectFirst(java.lang.Class[][] from)
from
- The array of throwable sets to select from.
public final java.lang.Class[][] selectAll(java.lang.Class[][] from)
from
- The array of throwable sets to select from.
public final Throwables and(Throwables specification)
specification
- The specification to AND with.
public final Throwables or(Throwables specification)
specification
- The specification to OR with.
public final Throwables not()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |