From 68b65fce4f2dfde805509a1b8fb13ac3424ad5fa Mon Sep 17 00:00:00 2001 From: Hammy Date: Sat, 18 Sep 2021 13:35:31 +0100 Subject: [PATCH] Update and add more annotations --- .../me/goudham/command/annotation/Command.java | 2 ++ .../goudham/command/annotation/SubCommand.java | 16 ++++++++++++++++ .../command/annotation/SubCommandGroup.java | 16 ++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 src/main/java/me/goudham/command/annotation/SubCommand.java create mode 100644 src/main/java/me/goudham/command/annotation/SubCommandGroup.java diff --git a/src/main/java/me/goudham/command/annotation/Command.java b/src/main/java/me/goudham/command/annotation/Command.java index 68f6d5cd..9ac00773 100644 --- a/src/main/java/me/goudham/command/annotation/Command.java +++ b/src/main/java/me/goudham/command/annotation/Command.java @@ -13,5 +13,7 @@ public @interface Command { String name(); String description(); boolean isVisible(); + SubCommandGroup[] subCommandGroups() default {}; + SubCommand[] subCommands() default {}; Option[] options() default {}; } diff --git a/src/main/java/me/goudham/command/annotation/SubCommand.java b/src/main/java/me/goudham/command/annotation/SubCommand.java new file mode 100644 index 00000000..088446fd --- /dev/null +++ b/src/main/java/me/goudham/command/annotation/SubCommand.java @@ -0,0 +1,16 @@ +package me.goudham.command.annotation; + +import jakarta.inject.Qualifier; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Qualifier +@Target(ElementType.ANNOTATION_TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SubCommand { + String name(); + String description(); + Option[] options() default {}; +} diff --git a/src/main/java/me/goudham/command/annotation/SubCommandGroup.java b/src/main/java/me/goudham/command/annotation/SubCommandGroup.java new file mode 100644 index 00000000..be1cbed4 --- /dev/null +++ b/src/main/java/me/goudham/command/annotation/SubCommandGroup.java @@ -0,0 +1,16 @@ +package me.goudham.command.annotation; + +import jakarta.inject.Qualifier; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Qualifier +@Target(ElementType.ANNOTATION_TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface SubCommandGroup { + String name(); + String description(); + SubCommand[] subCommands() default {}; +}