Package dev.cwhead.GravesX.module.util
Class LibbyImporter
java.lang.Object
dev.cwhead.GravesX.module.util.LibbyImporter
- All Implemented Interfaces:
LibraryImporter
Implements a
LibraryImporter that parses Maven-style coordinates and
loads libraries for modules using LibraryLoaderUtil.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLibbyImporter(Graves plugin) Creates a new importer bound to the Graves plugin. -
Method Summary
Modifier and TypeMethodDescriptionvoidimportLibrary(ModuleContext ctx, String... coordinates) Loads libraries described by coordinate strings.private voidParses a single coordinate string and loads it.private static booleanParses a human-friendly boolean string.
-
Field Details
-
plugin
-
util
-
-
Constructor Details
-
LibbyImporter
Creates a new importer bound to the Graves plugin.- Parameters:
plugin- Owning Graves plugin.
-
-
Method Details
-
importLibrary
Loads libraries described by coordinate strings. Each coordinate is trimmed and ignored if null/empty.- Specified by:
importLibraryin interfaceLibraryImporter- Parameters:
ctx- Module context of the caller.coordinates- One or more coordinates in the formgroup:artifact:version[?key=value&...].
-
loadOne
Parses a single coordinate string and loads it. Supports query keys:isolated,transitive,repo,id,relocate(formatfrom->to),relocateFrom,relocateto. On parse/load failure, logs the error and disables the plugin.- Parameters:
spec- Coordinate string to load.
-
parseBoolean
Parses a human-friendly boolean string. Truthy:"1","true","yes","y"(case-insensitive).- Parameters:
s- String to parse.- Returns:
- True if the value is truthy, otherwise false.
-