Class PluginInfo

java.lang.Object
net.ME1312.Galaxi.Plugin.PluginInfo
All Implemented Interfaces:
ExtraDataHandler

public class PluginInfo extends Object implements ExtraDataHandler
Plugin Info Class
See Also:
  • Method Details

    • load

      public static PluginInfo load(Object main) throws InvocationTargetException
      Get or register PluginInfo for objects tagged with @App/@Plugin
      Parameters:
      main - Class tagged with @App/@Plugin
      Returns:
      PluginInfo
      Throws:
      InvocationTargetException
    • get

      public static PluginInfo get(Object main)
      Get an already registered PluginInfo by plugin class
      Parameters:
      main - Class tagged with @App/@Plugin
      Returns:
      PluginInfo
    • get

      public static PluginInfo get(Class<?> main)
      Get an already registered PluginInfo by plugin class
      Parameters:
      main - Class tagged with @App/@Plugin
      Returns:
      PluginInfo
    • getLoader

      public ClassLoader getLoader()
      Get the Plugin's ClassLoader
      Returns:
      Plugin ClassLoader
    • get

      public Object get()
      Get Plugin Object
      Returns:
      Plugin Object
    • getIcon

      public Image getIcon()
      Get the Plugin's Icon
      Returns:
      Plugin Icon
    • setIcon

      public void setIcon(InputStream stream) throws IOException
      Set the Plugin's Icon
      Parameters:
      stream - Icon Stream
      Throws:
      IOException
    • getName

      public String getName()
      Get the Plugin's Name
      Returns:
      Plugin Name
    • getDisplayName

      public String getDisplayName()
      Get the Plugin's Display Name
      Returns:
      Display Name
    • setDisplayName

      public void setDisplayName(String value)
      Set the Plugin's Display Name
      Parameters:
      value - Value (or null to reset)
    • getVersion

      public Version getVersion()
      Get the Plugin's Version
      Returns:
      Plugin Version
    • getBuild

      public Version getBuild()
      Get the Plugin's Build Version
      Returns:
      Plugin Build Version
    • setBuild

      public void setBuild(Version value)
      Set the Plugin's Build Version (may only be done once)
      Parameters:
      value - Plugin Build Version
    • getState

      public String getState()
      Get the Plugin's State
      Returns:
      Plugin State
    • setState

      public void setState(String value)
      Set the Plugin's State
      Parameters:
      value - Plugin State
    • getAuthors

      public List<String> getAuthors()
      Get Authors List
      Returns:
      Authors List
    • getDescription

      public String getDescription()
      Get Plugin Description
      Returns:
      Plugin Description
    • getWebsite

      public URL getWebsite()
      Get Authors' Website
      Returns:
      Authors' Website
    • getLoadBefore

      public List<String> getLoadBefore()
      Gets the Load Before Plugins List
      Returns:
      Load Before Plugins List
    • getDependencies

      public List<PluginInfo.Dependency> getDependencies()
      Gets the Dependencies List
      Returns:
      Dependencies List
    • scanDependencies

      public List<PluginInfo> scanDependencies()
      Scans to create a Full Dependency List (which includes the dependencies of your dependencies)
      Returns:
      Full Dependencies List
    • getPlatformStack

      public List<String> getPlatformStack()
      Builds a stack of relevant platform and versioning information for this plugin (Useful for debugging!)
      Returns:
      Platform Information Stack
    • isEnabled

      public boolean isEnabled()
      Sets the Plugin's Enabled Status
      Returns:
      Enabled Status
    • setEnabled

      public void setEnabled(boolean value)
      Sets if the Plugin is Enabled
      Parameters:
      value - Value
    • setLogger

      public void setLogger(Logger value)
      Replace this Plugin's Logger with a custom one
      Parameters:
      value - Value
    • getLogger

      public Logger getLogger()
      Gets the default Logger for this Plugin
      Returns:
      Logger
    • getUpdateChecker

      public Supplier<Boolean> getUpdateChecker()
      Get the Update Checker for this Plugin
      Returns:
      Update Checker
    • setUpdateChecker

      public void setUpdateChecker(Supplier<Boolean> checker)
      Set the Update Checker for this Plugin
      Parameters:
      checker - Value (return true when an update is available)
    • getDataFolder

      public File getDataFolder()
      Gets this Plugin's data folder
      Returns:
      Data Folder
    • addExtra

      public void addExtra(String handle, Object value)
      Description copied from interface: ExtraDataHandler
      Add an extra value to this Object
      Specified by:
      addExtra in interface ExtraDataHandler
      Parameters:
      handle - Handle
      value - Value
    • hasExtra

      public boolean hasExtra(String handle)
      Description copied from interface: ExtraDataHandler
      Determine if an extra value exists
      Specified by:
      hasExtra in interface ExtraDataHandler
      Parameters:
      handle - Handle
      Returns:
      Value Status
    • getExtra

      public ObjectMapValue<String> getExtra(String handle)
      Description copied from interface: ExtraDataHandler
      Get an extra value
      Specified by:
      getExtra in interface ExtraDataHandler
      Parameters:
      handle - Handle
      Returns:
      Value
    • getExtra

      public ObjectMap<String> getExtra()
      Description copied from interface: ExtraDataHandler
      Get the extra value section
      Specified by:
      getExtra in interface ExtraDataHandler
      Returns:
      Extra Value Section
    • removeExtra

      public void removeExtra(String handle)
      Description copied from interface: ExtraDataHandler
      Remove an extra value from this Object
      Specified by:
      removeExtra in interface ExtraDataHandler
      Parameters:
      handle - Handle