T - the type of the classes to findpublic abstract class ClassFinder<T> extends Object implements Iterable<BetterReflectionClass<T>>
| Modifier and Type | Field and Description |
|---|---|
protected String |
basePackage |
| Constructor and Description |
|---|
ClassFinder(String basePackage)
Constructs a ClassFinder object with the given base package parameter.
|
| Modifier and Type | Method and Description |
|---|---|
ClassFinder<T> |
classLoader(ClassLoader classLoader)
Sets the class loader that will be used to load the classes for this ClassFinder instance.
|
abstract List<BetterReflectionClass<T>> |
findClasses()
Finds classes in a package based on certain criteria.
|
ClassLoader |
getClassLoader()
Retrieves the class loader currently set for this ClassFinder instance.
|
File |
getJarFile()
Retrieves the jar file currently set for this ClassFinder instance.
|
BetterReflectionClass<?> |
getType()
Retrieves the type of the ClassFinder instance.
|
boolean |
isRecursive()
Returns whether the ClassFinder instance is set to be recursive or not.
|
Iterator<BetterReflectionClass<T>> |
iterator()
Returns an iterator over the BetterReflectionClass objects representing the found classes.
|
ClassFinder<T> |
jarFile(File jarFile)
Sets the jar file that this ClassFinder will search for classes.
|
ClassFinder<T> |
ofType(BetterReflectionClass<T> type)
Sets the type of the ClassFinder instance.
|
ClassFinder<T> |
ofType(Class<T> type)
Sets the type of the ClassFinder instance.
|
ClassFinder<T> |
recursive(boolean recursive)
Sets the recursive flag of the ClassFinder instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprotected final String basePackage
public ClassFinder(String basePackage)
basePackage - the base package to search for classes inpublic ClassFinder<T> ofType(Class<T> type)
type - the type of the ClassFinder instance to setpublic ClassFinder<T> ofType(BetterReflectionClass<T> type)
type - the type of the ClassFinder instance to setpublic BetterReflectionClass<?> getType()
public ClassFinder<T> recursive(boolean recursive)
recursive - the boolean value to set the recursive flag topublic boolean isRecursive()
public ClassFinder<T> classLoader(ClassLoader classLoader)
classLoader - the ClassLoader instance to be used for loading classesClassFinder instancepublic ClassLoader getClassLoader()
ClassLoader instance being used to load classespublic ClassFinder<T> jarFile(File jarFile)
public File getJarFile()
File representing the jar file being searched for classespublic abstract List<BetterReflectionClass<T>> findClasses() throws IOException, URISyntaxException
IOException - if an I/O error occurs while finding the classes.URISyntaxException - if a URI syntax error occurs while finding the classes.public Iterator<BetterReflectionClass<T>> iterator()
iterator in interface Iterable<BetterReflectionClass<T>>RuntimeException - if an I/O error occurs while finding the classes.Copyright © 2024. All rights reserved.