Class AbstractDataImporter

java.lang.Object
org.mvplugins.multiverse.inventories.dataimport.AbstractDataImporter
All Implemented Interfaces:
DataImporter

@Contract public abstract class AbstractDataImporter extends Object implements DataImporter
Abstract implementation of DataImporter without actual import logic.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.bukkit.plugin.Plugin
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Unhook plugin from this Data Importer.
    protected abstract void
    Logic that does the actual importing data.
    boolean
    Hooks plugin for importing its data.
    boolean
    enable(org.bukkit.plugin.Plugin importerPlugin)
    Hooks plugin for importing its data.
    org.bukkit.plugin.Plugin
    boolean
    Imports the data from another plugin and disabled it upon success so Multiverse inventories can work without conflicts.
    boolean
    importData(boolean disableOnSuccess)
    Imports the data from another plugin and optionally disable it after successful import.
    boolean
    Checks if this Data Importer has been DataImporter.enable(Plugin) successfully.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.mvplugins.multiverse.inventories.dataimport.DataImporter

    getPluginClass, getPluginName
  • Field Details

    • importer

      protected org.bukkit.plugin.Plugin importer
  • Constructor Details

    • AbstractDataImporter

      public AbstractDataImporter()
  • Method Details

    • doDataImport

      protected abstract void doDataImport() throws DataImportException
      Logic that does the actual importing data.
      Throws:
      DataImportException - Errors occurred that caused import to fail.
    • importData

      public boolean importData(boolean disableOnSuccess)
      Imports the data from another plugin and optionally disable it after successful import.
      Specified by:
      importData in interface DataImporter
      Parameters:
      disableOnSuccess - Whether to disable the importer plugin after a successful import.
      Returns:
      True if data import is successful, else false.
    • importData

      public boolean importData()
      Imports the data from another plugin and disabled it upon success so Multiverse inventories can work without conflicts.
      Specified by:
      importData in interface DataImporter
      Returns:
      True if data import is successful, else false.
    • enable

      public boolean enable(org.bukkit.plugin.Plugin importerPlugin)
      Hooks plugin for importing its data. Needs plugin class of DataImporter.getPluginClass().
      Specified by:
      enable in interface DataImporter
      Parameters:
      importerPlugin - The target plugin instance to hook.
      Returns:
      True if successfully enabled, else false.
    • enable

      public boolean enable()
      Hooks plugin for importing its data. Needs plugin class of DataImporter.getPluginClass().
      Specified by:
      enable in interface DataImporter
      Returns:
      True if successfully enabled, else false.
    • disable

      public boolean disable()
      Unhook plugin from this Data Importer.
      Specified by:
      disable in interface DataImporter
      Returns:
      True if successfully disabled, else false.
    • isEnabled

      public boolean isEnabled()
      Checks if this Data Importer has been DataImporter.enable(Plugin) successfully.
      Specified by:
      isEnabled in interface DataImporter
      Returns:
      True if is enabled, else false.
    • getPlugin

      public org.bukkit.plugin.Plugin getPlugin()
      Specified by:
      getPlugin in interface DataImporter
      Returns:
      The plugin associated with this Data Importer, null if not enabled.