org.duelengine.duel.util
Class ClassEnumerator

java.lang.Object
  extended by org.duelengine.duel.util.ClassEnumerator

public final class ClassEnumerator
extends Object

Utility for enumerating available classes in a particular package


Constructor Summary
ClassEnumerator()
           
 
Method Summary
static Set<Class<?>> getClasses(String packageName)
          Loads classes in the specified package from the current thread ClassLoader
static Set<Class<?>> getClasses(String packageName, ClassLoader loader)
          Loads classes in the specified package from the specified ClassLoader
static Set<Class<?>> getFromDirectory(String packageName, File directory)
          Loads classes in the specified package from the specified directory
static Set<Class<?>> getFromJAR(String packageName, String jar)
          Loads classes in the specified package from the specified JAR
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassEnumerator

public ClassEnumerator()
Method Detail

getClasses

public static Set<Class<?>> getClasses(String packageName)
                                throws IOException,
                                       ClassNotFoundException
Loads classes in the specified package from the current thread ClassLoader

Parameters:
packageName -
Returns:
Throws:
IOException
ClassNotFoundException

getClasses

public static Set<Class<?>> getClasses(String packageName,
                                       ClassLoader loader)
                                throws IOException,
                                       ClassNotFoundException
Loads classes in the specified package from the specified ClassLoader

Parameters:
packageName -
loader -
Returns:
Throws:
IOException
ClassNotFoundException

getFromDirectory

public static Set<Class<?>> getFromDirectory(String packageName,
                                             File directory)
                                      throws ClassNotFoundException
Loads classes in the specified package from the specified directory

Parameters:
packageName -
directory -
Returns:
Throws:
ClassNotFoundException

getFromJAR

public static Set<Class<?>> getFromJAR(String packageName,
                                       String jar)
                                throws FileNotFoundException,
                                       IOException,
                                       ClassNotFoundException
Loads classes in the specified package from the specified JAR

Parameters:
packageName -
jar -
Returns:
Throws:
FileNotFoundException
IOException
ClassNotFoundException


Copyright © 2011. All Rights Reserved.