Class AnnotatedMethodHandler<C>
java.lang.Object
org.incendo.cloud.annotations.method.AnnotatedMethodHandler<C>
- Type Parameters:
C- command sender type
- Direct Known Subclasses:
MethodArgumentParser,MethodCommandExecutionHandler,MethodExceptionHandler,MethodSuggestionProvider
Handler that invokes an annotated method.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAnnotatedMethodHandler(@NonNull Method method, @NonNull Object instance, @NonNull ParameterInjectorRegistry<C> injectorRegistry) -
Method Summary
Modifier and TypeMethodDescriptionReturns the annotation accessor.createParameterValues(@NonNull CommandContext<C> context) Creates a list of values for the methodparameters().createParameterValues(@NonNull CommandContext<C> context, @NonNull Parameter @NonNull [] parameters) Creates a list of values for the given methodparameters.createParameterValues(@NonNull CommandContext<C> context, @NonNull Parameter @NonNull [] parameters, @NonNull Collection<Object> preDeterminedValues) Creates a list of values for the given methodparameters.protected @Nullable ParameterValuegetInjectedValue(@NonNull Parameter parameter, @NonNull CommandContext<C> context) Returns the injected value for the givenparameter, if possible.protected @Nullable ParameterValuegetParameterValue(@NonNull Parameter parameter, @NonNull CommandContext<C> context) Returns the value for the givenparameter, if possible.Returns the parameter injector registry.Returns the method handle.Returns the method parameters.
-
Constructor Details
-
AnnotatedMethodHandler
-
-
Method Details
-
parameters
Returns the method parameters.- Returns:
- the parameters
-
methodHandle
Returns the method handle.- Returns:
- the method handle
-
annotationAccessor
Returns the annotation accessor.- Returns:
- the annotation accessor
-
injectorRegistry
Returns the parameter injector registry.- Returns:
- the injector registry
-
getParameterValue
protected @Nullable ParameterValue getParameterValue(@NonNull Parameter parameter, @NonNull CommandContext<C> context) Returns the value for the givenparameter, if possible.- Parameters:
parameter- parameter to get value forcontext- the command context- Returns:
- the value, or
null
-
getInjectedValue
protected @Nullable ParameterValue getInjectedValue(@NonNull Parameter parameter, @NonNull CommandContext<C> context) Returns the injected value for the givenparameter, if possible.- Parameters:
parameter- parameter to get value forcontext- the command context- Returns:
- the value, or
null
-
createParameterValues
public @NonNull List<@NonNull ParameterValue> createParameterValues(@NonNull CommandContext<C> context) Creates a list of values for the methodparameters().- Parameters:
context- command context- Returns:
- the parameter values
-
createParameterValues
public @NonNull List<@NonNull ParameterValue> createParameterValues(@NonNull CommandContext<C> context, @NonNull Parameter @NonNull [] parameters) Creates a list of values for the given methodparameters.- Parameters:
context- command contextparameters- parameters to get values for- Returns:
- the parameter values
-
createParameterValues
public @NonNull List<@NonNull ParameterValue> createParameterValues(@NonNull CommandContext<C> context, @NonNull Parameter @NonNull [] parameters, @NonNull Collection<Object> preDeterminedValues) Creates a list of values for the given methodparameters.- Parameters:
context- command contextparameters- parameters to get values forpreDeterminedValues- values that are already known- Returns:
- the parameter values
-