public interface ClassProvider
extends java.io.Closeable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ClassProvider.Builder
A
ClassProvider.Builder is used to configure and construct a ClassProvider. |
static interface |
ClassProvider.IClassInfo
Holds basic information about a class.
|
static interface |
ClassProvider.IFieldInfo
Holds basic information about a field contained in a class.
|
static interface |
ClassProvider.IMethodInfo
Holds basic information about a method contained in a class.
|
| Modifier and Type | Method and Description |
|---|---|
static ClassProvider.Builder |
builder()
Creates a default instance of a
ClassProvider.Builder. |
static ClassProvider |
fromClassLoader(@Nullable java.lang.ClassLoader classLoader)
Creates a class provider which reads class data from the provided classloader,
or the classloader of this class if null.
|
static ClassProvider |
fromJvmClasspath()
Creates a class provider which reads class data from the default classloader that loaded this class.
|
static ClassProvider |
fromPaths(java.nio.file.Path... paths)
Creates a class provider which reads class data from the provided library paths.
|
java.util.Optional<? extends ClassProvider.IClassInfo> |
getClass(java.lang.String cls)
Queries the class information from this class path.
|
static ClassProvider.Builder builder()
ClassProvider.Builder.
The default supported library paths are ZIP files and directories.
Upon calling ClassProvider.Builder.addLibrary(Path), the path will be walked for all class files and stored.
Like a class path, entries added earlier take precedence over later entries with the same name.
static ClassProvider fromPaths(java.nio.file.Path... paths)
The default supported library paths are ZIP files and directories. Each path will be walked for all class files and stored in order. Like a class path, entries added earlier take precedence over later entries with the same name.
paths - the paths to read frombuilder()static ClassProvider fromJvmClasspath()
static ClassProvider fromClassLoader(@Nullable @Nullable java.lang.ClassLoader classLoader)
classLoader - the classloader to read from, or null for the default JVM classpathjava.util.Optional<? extends ClassProvider.IClassInfo> getClass(java.lang.String cls)
cls - the fully resolved classname, see Type.getInternalName()