Class ExpansionClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
me.hsgamer.hscore.expansion.common.ExpansionClassLoader
- All Implemented Interfaces:
Closeable,AutoCloseable
The class loader of the expansion
-
Constructor Summary
ConstructorsConstructorDescriptionExpansionClassLoader(@NotNull ExpansionManager manager, @NotNull File file, @NotNull ExpansionDescription description, @NotNull ClassLoader parent) Create a new class loader -
Method Summary
Modifier and TypeMethodDescriptionprotected @NotNull Class<?>@NotNull ExpansionDescriptionGet the expansion's description@NotNull ExpansionGet the expansion@NotNull FilegetFile()Get the expansion jar@NotNull ExpansionManagerGet the expansion manager@NotNull ExpansionStategetState()Get the state of the expansion@Nullable ThrowableGet the throwable if the expansion is inExpansionState.ERRORMethods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
ExpansionClassLoader
public ExpansionClassLoader(@NotNull @NotNull ExpansionManager manager, @NotNull @NotNull File file, @NotNull @NotNull ExpansionDescription description, @NotNull @NotNull ClassLoader parent) throws MalformedURLException Create a new class loader- Parameters:
manager- the expansion managerfile- the expansion jardescription- the description for the expansionparent- the parent class loader- Throws:
MalformedURLException- if it cannot convert the file to its related URL
-
-
Method Details
-
getExpansion
Get the expansion- Returns:
- the expansion
-
getFile
Get the expansion jar- Returns:
- the expansion jar
-
getManager
Get the expansion manager- Returns:
- the expansion manager
-
getDescription
Get the expansion's description- Returns:
- the description
-
getState
Get the state of the expansion- Returns:
- the state
-
getThrowable
Get the throwable if the expansion is inExpansionState.ERROR- Returns:
- the throwable
-
findClass
@NotNull protected @NotNull Class<?> findClass(@NotNull @NotNull String name) throws ClassNotFoundException - Overrides:
findClassin classURLClassLoader- Throws:
ClassNotFoundException
-