From dcd8a4ea2823fcdddb94e86413706a3fda9a8d84 Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Fri, 2 Nov 2018 15:44:36 +0100 Subject: [PATCH] Added some javadoc in PlaceholdersManager --- .../bentobox/managers/PlaceholdersManager.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/world/bentobox/bentobox/managers/PlaceholdersManager.java b/src/main/java/world/bentobox/bentobox/managers/PlaceholdersManager.java index 341dbee1c..e000d8e59 100644 --- a/src/main/java/world/bentobox/bentobox/managers/PlaceholdersManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/PlaceholdersManager.java @@ -5,6 +5,11 @@ import world.bentobox.bentobox.api.placeholders.PlaceholderReplacer; import world.bentobox.bentobox.hooks.PlaceholderAPIHook; +/** + * Manages placeholder integration. + * + * @author Poslovitch + */ public class PlaceholdersManager { private BentoBox plugin; @@ -13,6 +18,11 @@ public PlaceholdersManager(BentoBox plugin) { this.plugin = plugin; } + /** + * Registers the placeholder on the behalf on BentoBox. + * @param placeholder the placeholder to register. It will be appended with {@code "bentobox_"} by the placeholder plugin. + * @param replacer the expression that will return a {@code String} when executed, which will replace the placeholder. + */ public void registerPlaceholder(String placeholder, PlaceholderReplacer replacer) { // Register it in PlaceholderAPI plugin.getHooks().getHook("PlaceholderAPI").ifPresent(hook -> { @@ -21,6 +31,11 @@ public void registerPlaceholder(String placeholder, PlaceholderReplacer replacer }); } + /** + * Registers the placeholder on the behalf of the specified addon. + * @param placeholder the placeholder to register. It will be appended with the addon's name by the placeholder plugin. + * @param replacer the expression that will return a {@code String} when executed, which will replace the placeholder. + */ public void registerPlaceholder(Addon addon, String placeholder, PlaceholderReplacer replacer) { if (addon == null) { registerPlaceholder(placeholder, replacer);