com.google.inject.matcher
Class Matchers

java.lang.Object
  extended by com.google.inject.matcher.Matchers

public class Matchers
extends java.lang.Object

Matcher implementations. Supports matching classes and methods.

Author:
crazybob@google.com (Bob Lee)

Method Summary
static Matcher<java.lang.reflect.AnnotatedElement> annotatedWith(java.lang.annotation.Annotation annotation)
          Returns a matcher which matches elements (methods, classes, etc.) with a given annotation.
static Matcher<java.lang.reflect.AnnotatedElement> annotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Returns a matcher which matches elements (methods, classes, etc.) with a given annotation.
static Matcher<java.lang.Object> any()
          Returns a matcher which matches any input.
static Matcher<java.lang.Object> identicalTo(java.lang.Object o)
          Returns a matcher which matches only the given object.
static Matcher<java.lang.Class> inPackage(java.lang.Package p)
          Returns a matcher which matches classes in the given package.
static
<T> Matcher<T>
not(Matcher<? super T> p)
          Inverts the given matcher.
static Matcher<java.lang.Object> only(java.lang.Object o)
          Returns a matcher which matches objects equal to the given object.
static Matcher<java.lang.reflect.Method> returns(Matcher<? super java.lang.Class<?>> returnType)
          Returns a matcher which matches methods with matching return types.
static Matcher<java.lang.Class> subclassesOf(java.lang.Class<?> superclass)
          Returns a matcher which matches subclasses of the given type (as well as the given type).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

any

public static Matcher<java.lang.Object> any()
Returns a matcher which matches any input.


not

public static <T> Matcher<T> not(Matcher<? super T> p)
Inverts the given matcher.


annotatedWith

public static Matcher<java.lang.reflect.AnnotatedElement> annotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns a matcher which matches elements (methods, classes, etc.) with a given annotation.


annotatedWith

public static Matcher<java.lang.reflect.AnnotatedElement> annotatedWith(java.lang.annotation.Annotation annotation)
Returns a matcher which matches elements (methods, classes, etc.) with a given annotation.


subclassesOf

public static Matcher<java.lang.Class> subclassesOf(java.lang.Class<?> superclass)
Returns a matcher which matches subclasses of the given type (as well as the given type).


only

public static Matcher<java.lang.Object> only(java.lang.Object o)
Returns a matcher which matches objects equal to the given object.


identicalTo

public static Matcher<java.lang.Object> identicalTo(java.lang.Object o)
Returns a matcher which matches only the given object.


inPackage

public static Matcher<java.lang.Class> inPackage(java.lang.Package p)
Returns a matcher which matches classes in the given package.


returns

public static Matcher<java.lang.reflect.Method> returns(Matcher<? super java.lang.Class<?>> returnType)
Returns a matcher which matches methods with matching return types.



Copyright © {inceptionYear}-2008 null. All Rights Reserved.