net.thucydides.core.reflection
Class ClassFinder

Package class diagram package ClassFinder
java.lang.Object
  extended by net.thucydides.core.reflection.ClassFinder

public class ClassFinder
extends Object

Load classes from a given package.


Method Summary
 ClassFinder annotatedWith(Class annotation)
           
 List<Class<?>> fromPackage(String packageName)
          Scans all classes accessible from the context class loader which belong to the given package and subpackages.
static List<Class<?>> getClasses(String packageName)
          Scans all classes accessible from the context class loader which belong to the given package and subpackages.
static ClassFinder loadClasses()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadClasses

public static ClassFinder loadClasses()

annotatedWith

public ClassFinder annotatedWith(Class annotation)

fromPackage

public List<Class<?>> fromPackage(String packageName)
Scans all classes accessible from the context class loader which belong to the given package and subpackages.

Parameters:
packageName - The base package
Returns:
The classes

getClasses

public static List<Class<?>> getClasses(String packageName)
Scans all classes accessible from the context class loader which belong to the given package and subpackages. Adapted from http://snippets.dzone.com/posts/show/4831 and extended to support use of JAR files

Parameters:
packageName - The base package
Returns:
The classes
Throws:
ClassNotFoundException
IOException


Copyright © 2011-2013 Wakaleo Consulting. All Rights Reserved.