org.springframework.shell.core.annotation
Annotation Type CliAvailabilityIndicator
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface CliAvailabilityIndicator
Annotates a method that can indicate whether a particular command is presently
available or not.
This annotation must only be applied to a public no-argument method that returns primitive boolean.
The method should be inexpensive to evaluate, as this method can be called very
frequently. If expensive operations are necessary to compute command availability,
it is suggested the method return a boolean field that is maintained using the observer
pattern.
It is possible that a particular availability method might be able to represent the
availability status of multiple commands. As such, an availability indicator annotation
will indicate the commands that it applies to. If a specific command has multiple
aliases (ie by using an array for CliCommand.value()
), only one of the commands
need to be specified in the CliAvailabilityIndicator
annotation.
- Since:
- 1.0
value
public abstract String[] value
- Returns:
- the name of the command or commands that this availability indicator represents