Class ExpansionClassLoader

All Implemented Interfaces:
Closeable, AutoCloseable

public final class ExpansionClassLoader extends URLClassLoader
The class loader of the expansion
  • 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 manager
      file - the expansion jar
      description - the description for the expansion
      parent - the parent class loader
      Throws:
      MalformedURLException - if it cannot convert the file to its related URL
  • Method Details

    • getExpansion

      @NotNull public @NotNull Expansion getExpansion()
      Get the expansion
      Returns:
      the expansion
    • getFile

      @NotNull public @NotNull File getFile()
      Get the expansion jar
      Returns:
      the expansion jar
    • getManager

      @NotNull public @NotNull ExpansionManager getManager()
      Get the expansion manager
      Returns:
      the expansion manager
    • getDescription

      @NotNull public @NotNull ExpansionDescription getDescription()
      Get the expansion's description
      Returns:
      the description
    • getState

      @NotNull public @NotNull ExpansionState getState()
      Get the state of the expansion
      Returns:
      the state
    • getThrowable

      @Nullable public @Nullable Throwable getThrowable()
      Get the throwable if the expansion is in ExpansionState.ERROR
      Returns:
      the throwable
    • findClass

      @NotNull protected @NotNull Class<?> findClass(@NotNull @NotNull String name) throws ClassNotFoundException
      Overrides:
      findClass in class URLClassLoader
      Throws:
      ClassNotFoundException