-
Notifications
You must be signed in to change notification settings - Fork 0
09) Provided Annotations
This page provides a list of annotations that have been pre-defined. Note that the behavior for any of these annotations can be overridden. For the code used to add the annotations, see here.
- @MainCommand
- @Command
- @Name
- @Group
- @Description
- @RequiredParameters
- @Delimiter
- @HandleAbsentArgument
- @Flags
- @Contiguous
- @Index
- @MatchRegex
- @RegisterArgumentMapper
- @Required
- @Type
- @Width
Field: String[] keys
Target: Method
Default Value: Name of Method
Function: CommandHandleBuilder#setKeys(String... key)
Field: String name
Target: Method
Default Value: Name of Method
Function: CommandHandleBuilder#setName(String name)
Field: String group
Target: Package, Class, Method
Default Value: Package name; If the class is in a package that is named "command(s)"
, it will be set to the name of its package's enclosing package.
Function: CommandHandleBuilder#setGroup(String group)
Field: String group
Target: Method
Default Value: null
Function: CommandHandleBuilder#setDescription(String description)
Field: int[] indices
Target: Method
Default Value: {}
Function:
for (int i : annotation.indices()) {
command.configureParameter(i, param -> param.setRequired(true));
}
Field: String regex
; int limit = 0
Target: Method, Class, Package
Default Value: Splits on spaces unless enclosed by quotes or backticks
Function: command.setSplitRegex(annotation.regex(), annotations.limit())
Field: Class<? extends AbsentArgumentHandler> handler
Target: Parameter, Method, Class
Default Value:
Function:
Field: Target: Default Value: Function:
Field: Target: Default Value: Function:
Field: Target: Default Value: Function:
Field: Target: Default Value: Function:
Field: Target: Default Value: Function:
Field: Target: Default Value: Function:
Field: Target: Default Value: Function:
Field: Target: Default Value: Function:
Annotation | Fields | Target | Default Value | Function |
---|---|---|---|---|
@Command @MainCommand
|
String[] keys | Method | Method name | command.setKeys(annotation.value()) |
@Name |
String name | Method | Method name | command.setName(annotation.value()) |
@Group |
String group | Method, Class, Package | Package name. If it's command(s) , it will be enclosing Package name. |
command.setGroup(annotation.value()) |
@Description |
String desc | Method | null | command.setDescription(annotation.value()) |
@RequiredParameters |
int[] indices | Method | {} | for (int i : annotation.value()) { command.configureParameter(i, param -> param.setRequired(true)); |