net.dpml.cli.builder
Class CommandBuilder
java.lang.Object
net.dpml.cli.builder.CommandBuilder
Builds Command instances
CommandBuilder
public CommandBuilder()
Creates a new CommandBuilder
instance.
create
public Command create()
Creates a new Command
instance using the properties of the
CommandBuilder
.
reset
public CommandBuilder reset()
Resets the CommandBuilder to the defaults for a new Command.
This method is called automatically at the end of the
create
method.
withArgument
public CommandBuilder withArgument(Argument newArgument)
Specifies the argument for the next Command
that is created.
newArgument
- the argument for the next Command
that is created.
withChildren
public CommandBuilder withChildren(Group newChildren)
Specifies the children for the next Command
that is created.
newChildren
- the child options for the next Command
that is created.
withDescription
public CommandBuilder withDescription(String newDescription)
Specifies the description for the next Command
that is created. This description is used to produce
help documentation for the Command
.
newDescription
- the description for the next
Command
that is created.
withId
public final CommandBuilder withId(int newId)
Specifies the id for the next Command
that is created.
newId
- the id for the next Command
that is created.
withName
public CommandBuilder withName(String name)
Specifies the name for the next Command
that is created. The first name is used as the preferred
display name for the Command
and then
later names are used as aliases.
name
- the name for the next Command
that is created.
withRequired
public CommandBuilder withRequired(boolean newRequired)
Specifies whether the next Command
created is
required or not.
newRequired
- whether the next Command
created is
required or not.