Interface CommandBinding
public interface CommandBinding
The code the build generates for one @Command class, through which the
parser creates the command, sets its fields and runs it without reflection.
Applications do not implement this; the build writes one implementation per command and fails if a command cannot be bound.
-
Method Summary
Modifier and TypeMethodDescriptionintRuns the command and answers its exit code.Converts the text of one value of the argument inslotto the type of its field.create()A new instance of the command.voidinject(Object command, Object parent, CommandSpec spec) Hands the command the instance of its enclosing command, for aCommandLine.ParentCommandfield, and its own model, for aCommandLine.Specfield.booleanrunnable()Whether the command has a body: it is aRunnableor aCallable.voidStores a converted value in the field ofslot.spec()The model of the command, with its subcommands.
-
Method Details
-
spec
CommandSpec spec()The model of the command, with its subcommands. -
create
-
convert
-
set
-
inject
Hands the command the instance of its enclosing command, for aCommandLine.ParentCommandfield, and its own model, for aCommandLine.Specfield.- Throws:
Exception
-
runnable
boolean runnable()Whether the command has a body: it is aRunnableor aCallable. -
call
-