|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.cli2.builder.CommandBuilder
public class CommandBuilder
Builds Command instances
Field Summary | |
---|---|
private java.util.Set |
aliases
the aliases of the command |
private Argument |
argument
the argument of the command |
private Group |
children
the children of the command |
private java.lang.String |
description
the description of the command |
private int |
id
the id of the command |
private java.lang.String |
preferredName
the preferred name of the command |
private boolean |
required
whether the command is required or not |
Constructor Summary | |
---|---|
CommandBuilder()
Creates a new CommandBuilder instance. |
Method Summary | |
---|---|
Command |
create()
Creates a new Command instance using the properties of the
CommandBuilder . |
CommandBuilder |
reset()
Resets the CommandBuilder to the defaults for a new Command. |
CommandBuilder |
withArgument(Argument newArgument)
Specifies the argument for the next Command
that is created. |
CommandBuilder |
withChildren(Group newChildren)
Specifies the children for the next Command
that is created. |
CommandBuilder |
withDescription(java.lang.String newDescription)
Specifies the description for the next Command
that is created. |
CommandBuilder |
withId(int newId)
Specifies the id for the next Command that is created. |
CommandBuilder |
withName(java.lang.String name)
Specifies the name for the next Command
that is created. |
CommandBuilder |
withRequired(boolean newRequired)
Specifies whether the next Command created is
required or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String preferredName
private java.lang.String description
private java.util.Set aliases
private boolean required
private Argument argument
private Group children
private int id
Constructor Detail |
---|
public CommandBuilder()
CommandBuilder
instance.
Method Detail |
---|
public Command create()
Command
instance using the properties of the
CommandBuilder
.
public CommandBuilder reset()
create
method.
public CommandBuilder withName(java.lang.String name)
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.
CommandBuilder
.public CommandBuilder withDescription(java.lang.String newDescription)
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.
CommandBuilder
.public CommandBuilder withRequired(boolean newRequired)
Command
created is
required or not.
newRequired
- whether the next Command
created is
required or not.
CommandBuilder
.public CommandBuilder withChildren(Group newChildren)
Command
that is created.
newChildren
- the child options for the next Command
that is created.
CommandBuilder
.public CommandBuilder withArgument(Argument newArgument)
Command
that is created.
newArgument
- the argument for the next Command
that is created.
CommandBuilder
.public final CommandBuilder withId(int newId)
Command
that is created.
newId
- the id for the next Command
that is created.
CommandBuilder
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |