public final class LibraryInjector extends Object
Constructor and Description |
---|
LibraryInjector(org.bukkit.plugin.java.JavaPlugin plugin) |
LibraryInjector(org.bukkit.plugin.java.JavaPlugin plugin,
boolean logDownloads)
Creates a new library (dependency) injector
|
Modifier and Type | Method and Description |
---|---|
void |
addToDownload(Class<?> clazz)
Searches for the
MavenLibrary annotation in the specified class object
and adds the found for download. |
void |
addToDownload(Dependency dependency)
Adds to download the specified
Dependency |
void |
addToDownload(Object clazzObject)
Searches for the
MavenLibrary annotation in the specified object
and adds the found for download. |
void |
addToDownload(String groupId,
String artifactId,
String version)
Adds for download the specified dependency parameters.
|
void |
addToDownload(String groupId,
String artifactId,
String version,
String repoUrl)
Adds for download the specified dependency parameters.
|
void |
downloadAndInject()
Downloads the specified dependencies if they're not present and
loads them into the specified plugin's classpath.
|
List<Dependency> |
getDependencies()
Returns a unmodifiable collection of all dependencies
which were downloaded or are to be downloaded.
|
public LibraryInjector(org.bukkit.plugin.java.JavaPlugin plugin, boolean logDownloads)
plugin
- the plugin to which to inject the librarieslogDownloads
- should the injector log downloaded librariespublic LibraryInjector(org.bukkit.plugin.java.JavaPlugin plugin)
public void addToDownload(Object clazzObject)
MavenLibrary
annotation in the specified object
and adds the found for download.clazzObject
- the object to search for dependency annotationspublic void addToDownload(Class<?> clazz)
MavenLibrary
annotation in the specified class object
and adds the found for download.clazz
- the class object to search for dependency annotationspublic void addToDownload(String groupId, String artifactId, String version)
groupId
- the dependency's group idartifactId
- the dependency's artifact idversion
- the dependency's versionpublic void addToDownload(String groupId, String artifactId, String version, String repoUrl)
groupId
- the dependency's group idartifactId
- the dependency's artifact idversion
- the dependency's versionrepoUrl
- the dependency's repository urlpublic void addToDownload(Dependency dependency)
Dependency
dependency
- the dependency you wish to downloadpublic List<Dependency> getDependencies()
public void downloadAndInject()
Copyright © 2019. All rights reserved.