From 9bb8687a88edc889337d2109b0f21b39b52aabf9 Mon Sep 17 00:00:00 2001 From: asofold Date: Sat, 26 Jan 2013 08:03:33 +0100 Subject: [PATCH] Add javadocs for ComponentRegistry and related. --- .../nocheatplus/components/ComponentRegistry.java | 10 +++++++++- .../nocheatplus/components/NoCheatPlusAPI.java | 12 ++++++++---- .../nocheatplus/components/TickListener.java | 2 +- .../neatmonster/nocheatplus/players/DataManager.java | 3 +++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/ComponentRegistry.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/ComponentRegistry.java index cb428d6f..b62fb562 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/ComponentRegistry.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/ComponentRegistry.java @@ -1,5 +1,13 @@ package fr.neatmonster.nocheatplus.components; +/** + * A ComponentRegistry allows registering components, that then are delegated to where they belong.
+ * Notes: + *
  • Implementations should somehow specify when components can be registered and when they are unregistered automatically.
  • + *
  • Implementations should somehow specify what components can be registered.
  • + * @author mc_dev + * + */ public interface ComponentRegistry { /** * Convenience method to add components according to implemented interfaces, @@ -7,7 +15,7 @@ public interface ComponentRegistry { * For the NoCheatPlus instance this must be done after the configuration has been initialized. * @param obj */ - public void addComponent(final Object onj); + public void addComponent(final Object obj); /** * Remove a registered component.
    diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/NoCheatPlusAPI.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/NoCheatPlusAPI.java index 0157bc22..378d2aff 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/NoCheatPlusAPI.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/NoCheatPlusAPI.java @@ -1,10 +1,14 @@ package fr.neatmonster.nocheatplus.components; - - +/** + * ComponentRegistry: + *
  • Supported components: Listener, TickListener, PermStateReceiver, INotifyReload, INeedConfig, IRemoveData
  • + *
  • Registering components should be done during onEnable or any time while the plugin is enabled, all components will be unregistered in onDisable.
  • + *
  • References to all components will be held until onDisable is finished.
  • + * @author mc_dev + * + */ public interface NoCheatPlusAPI extends ComponentRegistry{ - - } diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/TickListener.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/TickListener.java index 601494c8..7c72916d 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/TickListener.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/components/TickListener.java @@ -1,7 +1,7 @@ package fr.neatmonster.nocheatplus.components; /** - * Can be registered with the TickTask. + * Can be registered with the TickTask. Ensure that registered objects get unregistered before the plugin gets enabled again. You can ensure it by using NoCheatPlusAPI to register a TickListener. * @author mc_dev * */ diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/players/DataManager.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/players/DataManager.java index 0cb19ec3..bf89a8ee 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/players/DataManager.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/players/DataManager.java @@ -46,6 +46,9 @@ import fr.neatmonster.nocheatplus.hooks.APIUtils; * Originally intended as temporary or intermediate design, this might help reorganizing the API at some point.
    * However i could not yet find a pleasing way for generic configuration access for a centralized data management (all in one), * so this might just be a workarounds class for coping with the current design, until somehow resolved in another way. + *
    + * ComponentRegistry: + *
  • Supported: IRemoveData
  • * @author mc_dev * */