Class ReflectionsWorkaroundClasspathHelper
- java.lang.Object
-
- org.optaplanner.core.config.domain.ReflectionsWorkaroundClasspathHelper
-
@Deprecated public abstract class ReflectionsWorkaroundClasspathHelper extends Object
Deprecated.in favor of Quarkus integration in OptaPlanner 8 or Spring Boot starter.Workaround for bug inClasspathHelper
. This workaround expires once https://github.com/ronmamo/reflections/pull/118 is fixed.
-
-
Constructor Summary
Constructors Constructor Description ReflectionsWorkaroundClasspathHelper()
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ClassLoader[]
classLoaders(ClassLoader... classLoaders)
Deprecated.Returns an array of class Loaders initialized from the specified array.static String
cleanPath(URL url)
Deprecated.Cleans the URL.static ClassLoader
contextClassLoader()
Deprecated.Gets the current thread context class loader.static URL
forClass(Class<?> aClass, ClassLoader... classLoaders)
Deprecated.Returns the URL that contains aClass
.static Collection<URL>
forClassLoader()
Deprecated.Returns a distinct collection of URLs based on URLs derived from class loaders.static Collection<URL>
forClassLoader(ClassLoader... classLoaders)
Deprecated.Returns a distinct collection of URLs based on URLs derived from class loaders.static Collection<URL>
forJavaClassPath()
Deprecated.Returns a distinct collection of URLs based on thejava.class.path
system property.static Collection<URL>
forPackage(String name, ClassLoader... classLoaders)
Deprecated.Returns a distinct collection of URLs based on a package name.static Collection<URL>
forResource(String resourceName, ClassLoader... classLoaders)
Deprecated.Returns a distinct collection of URLs based on a resource.static ClassLoader
staticClassLoader()
Deprecated.Gets the class loader of this library.
-
-
-
Method Detail
-
contextClassLoader
public static ClassLoader contextClassLoader()
Deprecated.Gets the current thread context class loader.Thread.currentThread().getContextClassLoader()
.- Returns:
- the context class loader, may be null
-
staticClassLoader
public static ClassLoader staticClassLoader()
Deprecated.Gets the class loader of this library.Reflections.class.getClassLoader()
.- Returns:
- the static library class loader, may be null
-
classLoaders
public static ClassLoader[] classLoaders(ClassLoader... classLoaders)
Deprecated.Returns an array of class Loaders initialized from the specified array.If the input is null or empty, it defaults to both
contextClassLoader()
andstaticClassLoader()
- Returns:
- the array of class loaders, not null
-
forPackage
public static Collection<URL> forPackage(String name, ClassLoader... classLoaders)
Deprecated.Returns a distinct collection of URLs based on a package name.This searches for the package name as a resource, using
ClassLoader.getResources(String)
. For example,forPackage(org.reflections)
effectively returns URLs from the classpath containing packages starting withorg.reflections
.If the optional
ClassLoader
s are not specified, then bothcontextClassLoader()
andstaticClassLoader()
are used forClassLoader.getResources(String)
.The returned URLs retains the order of the given
classLoaders
.- Returns:
- the collection of URLs, not null
-
forResource
public static Collection<URL> forResource(String resourceName, ClassLoader... classLoaders)
Deprecated.Returns a distinct collection of URLs based on a resource.This searches for the resource name, using
ClassLoader.getResources(String)
. For example,forResource(test.properties)
effectively returns URLs from the classpath containing files of that name.If the optional
ClassLoader
s are not specified, then bothcontextClassLoader()
andstaticClassLoader()
are used forClassLoader.getResources(String)
.The returned URLs retains the order of the given
classLoaders
.- Returns:
- the collection of URLs, not null
-
forClass
public static URL forClass(Class<?> aClass, ClassLoader... classLoaders)
Deprecated.Returns the URL that contains aClass
.This searches for the class using
ClassLoader.getResource(String)
.If the optional
ClassLoader
s are not specified, then bothcontextClassLoader()
andstaticClassLoader()
are used forClassLoader.getResources(String)
.- Returns:
- the URL containing the class, null if not found
-
forClassLoader
public static Collection<URL> forClassLoader()
Deprecated.Returns a distinct collection of URLs based on URLs derived from class loaders.This finds the URLs using
URLClassLoader.getURLs()
using bothcontextClassLoader()
andstaticClassLoader()
.The returned URLs retains the order of the given
classLoaders
.- Returns:
- the collection of URLs, not null
-
forClassLoader
public static Collection<URL> forClassLoader(ClassLoader... classLoaders)
Deprecated.Returns a distinct collection of URLs based on URLs derived from class loaders.This finds the URLs using
URLClassLoader.getURLs()
using the specified class loader, searching up the parent hierarchy.If the optional
ClassLoader
s are not specified, then bothcontextClassLoader()
andstaticClassLoader()
are used forClassLoader.getResources(String)
.The returned URLs retains the order of the given
classLoaders
.- Returns:
- the collection of URLs, not null
-
forJavaClassPath
public static Collection<URL> forJavaClassPath()
Deprecated.Returns a distinct collection of URLs based on thejava.class.path
system property.This finds the URLs using the
java.class.path
system property.The returned collection of URLs retains the classpath order.
- Returns:
- the collection of URLs, not null
-
-