ca.infoway.messagebuilder.j5goodies
Class Predicates

Package class diagram package Predicates
java.lang.Object
  extended by ca.infoway.messagebuilder.j5goodies.Predicates

public class Predicates
extends Object

Provides some standard class finder predicates.

Author:
Intelliware Development

Constructor Summary
Predicates()
           
 
Method Summary
static ClassPredicate hasAnnotationPredicate(Class<? extends Annotation> annotation)
          Construct a predicate that finds all classes with a particular annotation.
static ClassPredicate isInstanceofPredicate(Class<?> type)
          Construct a predicate that finds all classes of a particular type.
static ClassPredicate isInstanceofPredicate(Class<?> type, boolean isInterface)
          Construct a predicate that finds all classes of a particular type.
static ClassPredicate packageNamePredicate(String expectedPackageName)
          Construct a predicate that finds all classes in a particular package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Predicates

public Predicates()
Method Detail

packageNamePredicate

public static ClassPredicate packageNamePredicate(String expectedPackageName)

Construct a predicate that finds all classes in a particular package.

Parameters:
expectedPackageName - - the package
Returns:
- the predicate

hasAnnotationPredicate

public static ClassPredicate hasAnnotationPredicate(Class<? extends Annotation> annotation)

Construct a predicate that finds all classes with a particular annotation.

Parameters:
annotation - - the annotation
Returns:
- the predicate

isInstanceofPredicate

public static ClassPredicate isInstanceofPredicate(Class<?> type)

Construct a predicate that finds all classes of a particular type.

Parameters:
type - - the type
Returns:
- the predicate

isInstanceofPredicate

public static ClassPredicate isInstanceofPredicate(Class<?> type,
                                                   boolean isInterface)

Construct a predicate that finds all classes of a particular type.

Parameters:
type - - the type
isInterface - - true if the predicate should only return interfaces; false if the predicate should never return interfaces
Returns:
- the predicate


Copyright © 2013. All Rights Reserved.