com.google.inject.intercept
Class Queries

java.lang.Object
  extended by com.google.inject.intercept.Queries

public class Queries
extends java.lang.Object

Query implementations. Supports querying classes and methods.

Author:
crazybob@google.com (Bob Lee)

Method Summary
static Query<java.lang.reflect.AnnotatedElement> annotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Returns a query which matches elements (methods, classes, etc.) with a given annotation.
static Query<java.lang.Object> any()
          Returns a query which matches any input.
static Query<java.lang.Object> identicalTo(java.lang.Object o)
          Returns a query which matches only the given object.
static Query<java.lang.Class> inPackage(java.lang.Package p)
          Returns a query which matches classes in the given package.
static
<T> Query<T>
not(Query<? super T> p)
          Inverts the given query.
static Query<java.lang.Object> only(java.lang.Object o)
          Returns a query which matches objects equal to the given object.
static Query<java.lang.reflect.Method> returns(Query<? super java.lang.Class<?>> returnType)
          Returns a query which matches methods with matching return types.
static Query<java.lang.Class> subclassesOf(java.lang.Class<?> superclass)
          Returns a query 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 Query<java.lang.Object> any()
Returns a query which matches any input.


not

public static <T> Query<T> not(Query<? super T> p)
Inverts the given query.


annotatedWith

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


subclassesOf

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


only

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


identicalTo

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


inPackage

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


returns

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