com.mycila.testing.core.introspect
Class Filters

java.lang.Object
  extended by com.mycila.testing.core.introspect.Filters

public final class Filters
extends Object

Author:
Mathieu Carbou (mathieu.carbou@gmail.com)

Method Summary
static
<T> Filter<T>
all()
           
static
<T> Filter<T>
and(Filter<T>... filters)
           
static Filter<Method> excludeOverridenMethods(Filter<Method> methodFilter)
          This filter will exclude methods that are overriden, as defined in the JLS at http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.8
static Filter<Field> fieldsAccepting(Class<?> type)
          Filter that select fields having specified type or a super-type of the specified type
static Filter<Field> fieldsAnnotatedBy(Class<? extends Annotation> annotation)
          Returns fields annotated by a given annotation
static Filter<Field> fieldsProviding(Class<?> type)
          Filter that select fields having specified type or a sub-type of the specified type
static Filter<Method> methodsAnnotatedBy(Class<? extends Annotation> annotation)
          Returns methods annotated by a given annotation
static Filter<Method> methodsReturning(Class<?> type)
          Select methods returning objects that are of a given type or of a sub-type of given type
static
<T> Filter<T>
none()
           
static
<T> Filter<T>
not(Filter<T> filter)
           
static
<T> Filter<T>
or(Filter<T>... filters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

all

public static <T> Filter<T> all()

none

public static <T> Filter<T> none()

not

public static <T> Filter<T> not(Filter<T> filter)

and

public static <T> Filter<T> and(Filter<T>... filters)

or

public static <T> Filter<T> or(Filter<T>... filters)

fieldsProviding

public static Filter<Field> fieldsProviding(Class<?> type)
Filter that select fields having specified type or a sub-type of the specified type

Parameters:
type - Selected type
Returns:
Created filter

fieldsAccepting

public static Filter<Field> fieldsAccepting(Class<?> type)
Filter that select fields having specified type or a super-type of the specified type

Parameters:
type - Selected type
Returns:
Created filter

methodsReturning

public static Filter<Method> methodsReturning(Class<?> type)
Select methods returning objects that are of a given type or of a sub-type of given type

Parameters:
type - The type of the return
Returns:
Teh created filter

fieldsAnnotatedBy

public static Filter<Field> fieldsAnnotatedBy(Class<? extends Annotation> annotation)
Returns fields annotated by a given annotation

Parameters:
annotation - The annotation
Returns:
The created filter

methodsAnnotatedBy

public static Filter<Method> methodsAnnotatedBy(Class<? extends Annotation> annotation)
Returns methods annotated by a given annotation

Parameters:
annotation - The annotation
Returns:
The created filter

excludeOverridenMethods

public static Filter<Method> excludeOverridenMethods(Filter<Method> methodFilter)
This filter will exclude methods that are overriden, as defined in the JLS at http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.4.8

Parameters:
methodFilter - The method filter used to accept methods
Returns:
Created filter


Copyright © 2008-2011 Mycila. All Rights Reserved.