Class ConduitContext
java.lang.Object
org.geysermc.conduit.ConduitContext
The set of jars Conduit reads from.
Jars added with addJar(Path) are scanned. Context jars, added with addContextJar(Path),
are only read. They let the scanner resolve classes and follow calls into a library without
reporting the library's own calls.
ConduitContext context = ConduitContext.load(Path.of("mod.jar"));
context.addContextJar(Path.of("library.jar"));
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddContextJar(@NotNull Path jarPath) Adds a jar to read classes from without scanning it.voidAdds jars to scan.voidAdds a jar to scan.voidaddNestedJars(@NotNull Path outerJar, @NotNull String innerPath) Adds every jar directly inside a directory of another jar, such asMETA-INF/jars, to scan.The loader over every jar in the context, used to read class files.static ConduitContextCreates a context that scans the given jars.static ConduitContextCreates a context that scans the given jars.scanClasses(@NotNull ClassFilter filter) Lists every class in the context matching a filter, read from the class files alone.
-
Method Details
-
addJar
Adds a jar to scan.- Parameters:
jarPath- the jar
-
addJar
-
addContextJar
Adds a jar to read classes from without scanning it.- Parameters:
jarPath- the jar
-
addNestedJars
Adds every jar directly inside a directory of another jar, such asMETA-INF/jars, to scan. Nested directories are not searched.- Parameters:
outerJar- the jar containing the othersinnerPath- the directory inside it
-
scanClasses
Lists every class in the context matching a filter, read from the class files alone.- Parameters:
filter- the filter- Returns:
- the matching classes
-
classLoader
The loader over every jar in the context, used to read class files. Loading a class through it does not run the scanner.- Returns:
- the loader over every jar in the context
-
load
Creates a context that scans the given jars.- Parameters:
jarPath- the jars to scan- Returns:
- a new context
-
load
Creates a context that scans the given jars.- Parameters:
jarUrl- the jars to scan- Returns:
- a new context
-