diff options
Diffstat (limited to 'src/main/java/org/bukkit/plugin/java/annotation/command')
-rw-r--r-- | src/main/java/org/bukkit/plugin/java/annotation/command/Command.java | 48 | ||||
-rw-r--r-- | src/main/java/org/bukkit/plugin/java/annotation/command/Commands.java | 20 |
2 files changed, 68 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/plugin/java/annotation/command/Command.java b/src/main/java/org/bukkit/plugin/java/annotation/command/Command.java new file mode 100644 index 0000000..9d54dee --- /dev/null +++ b/src/main/java/org/bukkit/plugin/java/annotation/command/Command.java @@ -0,0 +1,48 @@ +package org.bukkit.plugin.java.annotation.command; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Repeatable; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Defines a plugin command + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Repeatable(Commands.class) +public @interface Command { + + /** + * This command's name. + */ + String name(); + + /** + * This command's description. + */ + String desc() default ""; + + /** + * This command's aliases. + */ + String[] aliases() default {}; + + /** + * This command's permission node. + */ + String permission() default ""; + + /** + * This command's permission-check-fail message. + */ + String permissionMessage() default ""; + + /** + * This command's usage message. + */ + String usage() default ""; +} diff --git a/src/main/java/org/bukkit/plugin/java/annotation/command/Commands.java b/src/main/java/org/bukkit/plugin/java/annotation/command/Commands.java new file mode 100644 index 0000000..c98a77b --- /dev/null +++ b/src/main/java/org/bukkit/plugin/java/annotation/command/Commands.java @@ -0,0 +1,20 @@ +package org.bukkit.plugin.java.annotation.command; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Part of the plugin annotations framework. + * <p> + * Represents a list of this plugin's registered command(s). + */ + +@Documented +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface Commands { + Command[] value() default {}; +} |