Package com.axelor.common.reflections
Class ClassFinder<T>
- java.lang.Object
-
- com.axelor.common.reflections.ClassFinder<T>
-
public final class ClassFinder<T> extends Object
The helper class to find sub types of a given super class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassFinder<T>any()In case of multiplehaving(Class)calls, whether to check any one annotation (by default all annotations are checked).ClassFinder<T>byURL(String pattern)Find with the given URL pattern.Set<Class<? extends T>>find()Find the classes.ClassFinder<T>having(Class<? extends Annotation> annotation)Only search classes with the given annotation.ClassFinder<?>using(ClassLoader loader)Search using the given class loader.ClassFinder<T>within(String packageName)Only search within the given package name.
-
-
-
Method Detail
-
byURL
public ClassFinder<T> byURL(String pattern)
Find with the given URL pattern.- Parameters:
pattern- the URL pattern- Returns:
- the same finder
-
within
public ClassFinder<T> within(String packageName)
Only search within the given package name.- Parameters:
packageName- the package name- Returns:
- same class finder instance
-
using
public ClassFinder<?> using(ClassLoader loader)
Search using the given class loader.- Parameters:
loader- the class loader- Returns:
- the class finder instance
-
having
public ClassFinder<T> having(Class<? extends Annotation> annotation)
Only search classes with the given annotation.- Parameters:
annotation- the annotation to check- Returns:
- same class finder instance
-
any
public ClassFinder<T> any()
In case of multiplehaving(Class)calls, whether to check any one annotation (by default all annotations are checked).- Returns:
- same class finder instance
-
-