Class AddonClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
de.craftsblock.craftsnet.addon.loaders.CraftsNetClassLoader
de.craftsblock.craftsnet.addon.loaders.AddonClassLoader
- All Implemented Interfaces:
Closeable,AutoCloseable
Class responsible for loading addons dynamically into the CraftsNet framework.
- Since:
- 3.0.3-SNAPSHOT
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionprotected Class<?>Finds the class with the specified binary name.static Set<AddonClassLoader>Get a list of allAddonClassLoaderwhich are currently active.protected Class<?>Loads the class with the specified name, optionally linking it after loading.Methods inherited from class de.craftsblock.craftsnet.addon.loaders.CraftsNetClassLoader
getCraftsNet, isCraftsNetLoaded, isCraftsNetLoaded, retrieveCraftsNet, retrieveCraftsNetMethods 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, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Method Details
-
loadClass
Loads the class with the specified name, optionally linking it after loading.- Overrides:
loadClassin classClassLoader- Parameters:
name- The binary name of the class to be loaded.resolve-trueto resolve the class;falseto skip resolution.- Returns:
- The
Classobject representing the loaded class. - Throws:
ClassNotFoundException- If the class could not be found.
-
findClass
Finds the class with the specified binary name.- Overrides:
findClassin classURLClassLoader- Parameters:
name- The binary name of the class to be found.- Returns:
- The
Classobject representing the class, ornullif the class could not be found. - Throws:
ClassNotFoundException- If the class could not be found.
-
getAddonLoaders
Get a list of allAddonClassLoaderwhich are currently active.- Returns:
- The set of
AddonClassLoader.
-