Class MethodModel
java.lang.Object
io.github.projectunified.craftcommand.processor.model.MethodModel
Model representing a command or subcommand method.
-
Constructor Summary
ConstructorsConstructorDescriptionMethodModel(String methodName, String subcommandName, List<String> aliases, ParameterModel senderParameter, List<ParameterModel> parameters, boolean isDefault, ExecutableElement element) Constructs a MethodModel. -
Method Summary
Modifier and TypeMethodDescriptionGets the subcommand aliases.Gets the underlying Java ExecutableElement.Gets the Java method name.Gets the list of argument parameters.Gets the sender parameter model.Gets the type of the sender parameter.Gets the subcommand name.booleanChecks if this method is the default action.
-
Constructor Details
-
MethodModel
public MethodModel(String methodName, String subcommandName, List<String> aliases, ParameterModel senderParameter, List<ParameterModel> parameters, boolean isDefault, ExecutableElement element) Constructs a MethodModel.- Parameters:
methodName- the name of the Java methodsubcommandName- the name of the subcommand, ornullif default actionaliases- the subcommand aliasessenderParameter- the model for the first (sender) parameterparameters- the models for the remaining command argumentsisDefault-trueif marked with@Defaultelement- the underlying ExecutableElement
-
-
Method Details
-
getMethodName
Gets the Java method name.- Returns:
- the method name
-
getSubcommandName
Gets the subcommand name.- Returns:
- the subcommand name, or
null
-
getAliases
Gets the subcommand aliases.- Returns:
- the list of aliases
-
getSenderType
Gets the type of the sender parameter.- Returns:
- the sender type mirror
-
getSenderParameter
Gets the sender parameter model.- Returns:
- the sender parameter model
-
getParameters
Gets the list of argument parameters.- Returns:
- the list of parameter models
-
isDefault
public boolean isDefault()Checks if this method is the default action.- Returns:
trueif default action
-
getElement
Gets the underlying Java ExecutableElement.- Returns:
- the executable element
-