Package moa.core
Class AutoClassDiscovery
- java.lang.Object
-
- moa.core.AutoClassDiscovery
-
public class AutoClassDiscovery extends Object
Class for discovering classes via reflection in the java class path.
If analyzing of classpath fails, it falls back on reading class names from file listCLASS_LIST
as resource stream.- Author:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected static Map<String,String[]>
cachedClassNames
static String
CLASS_LIST
protected static nz.ac.waikato.cms.locator.ClassCache
m_Cache
-
Constructor Summary
Constructors Constructor Description AutoClassDiscovery()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Class[]
findClassesOfType(String packageNameToSearch, Class<?> typeDesired)
static String[]
findClassNames(String packageNameToSearch)
static List<String>
getAllClassNames()
Returns all class names stored in the cache.static boolean
hasEmptyConstructor(Class<?> type)
protected static void
initCache()
Initializes the class cachestatic boolean
isPublicConcreteClassOfType(String className, Class<?> typeDesired)
static void
main(String[] args)
Outputs all class names below "moa" either to stdout or to the file provided as first argument.
-
-
-
Field Detail
-
m_Cache
protected static nz.ac.waikato.cms.locator.ClassCache m_Cache
-
CLASS_LIST
public static final String CLASS_LIST
- See Also:
- Constant Field Values
-
-
Method Detail
-
initCache
protected static void initCache()
Initializes the class cache
-
getAllClassNames
public static List<String> getAllClassNames()
Returns all class names stored in the cache.- Returns:
- the class names
-
findClassesOfType
public static Class[] findClassesOfType(String packageNameToSearch, Class<?> typeDesired)
-
isPublicConcreteClassOfType
public static boolean isPublicConcreteClassOfType(String className, Class<?> typeDesired)
-
hasEmptyConstructor
public static boolean hasEmptyConstructor(Class<?> type)
-
-