net.dpml.cli.builder

Class DefaultOptionBuilder


public class DefaultOptionBuilder
extends java.lang.Object

Builds DefaultOption instances.
Version:
@PROJECT-VERSION@
Author:
@PUBLISHER-NAME@

Constructor Summary

DefaultOptionBuilder()
Creates a new DefaultOptionBuilder using defaults
DefaultOptionBuilder(String shortPrefix, String longPrefix, boolean burstEnabled)
Creates a new DefaultOptionBuilder

Method Summary

DefaultOption
create()
Creates a DefaultOption instance
DefaultOptionBuilder
reset()
Resets the builder.
DefaultOptionBuilder
withArgument(Argument newArgument)
Use this Argument
DefaultOptionBuilder
withChildren(Group newChildren)
Use this child Group
DefaultOptionBuilder
withDescription(String newDescription)
Use this option description
DefaultOptionBuilder
withId(int newId)
Sets the id
DefaultOptionBuilder
withLongName(String longName)
Use this long option name.
DefaultOptionBuilder
withRequired(boolean newRequired)
Use this optionality
DefaultOptionBuilder
withShortName(String shortName)
Use this short option name.

Constructor Details

DefaultOptionBuilder

public DefaultOptionBuilder()
Creates a new DefaultOptionBuilder using defaults

DefaultOptionBuilder

public DefaultOptionBuilder(String shortPrefix,
                            String longPrefix,
                            boolean burstEnabled)
            throws IllegalArgumentException
Creates a new DefaultOptionBuilder
Parameters:
shortPrefix - the prefix to use for short options
longPrefix - the prefix to use for long options
burstEnabled - whether to allow gnu style bursting

Method Details

create

public DefaultOption create()
            throws IllegalStateException
Creates a DefaultOption instance
Returns:
the new instance

reset

public DefaultOptionBuilder reset()
Resets the builder.
Returns:
this DefaultOptionBuilder.

withArgument

public DefaultOptionBuilder withArgument(Argument newArgument)
Use this Argument
Parameters:
newArgument - the argument to use
Returns:
this builder

withChildren

public DefaultOptionBuilder withChildren(Group newChildren)
Use this child Group
Parameters:
newChildren - the child Group to use
Returns:
this builder

withDescription

public DefaultOptionBuilder withDescription(String newDescription)
Use this option description
Parameters:
newDescription - the description to use
Returns:
this builder

withId

public final DefaultOptionBuilder withId(int newId)
Sets the id
Parameters:
newId - the id of the DefaultOption
Returns:
this DefaultOptionBuilder

withLongName

public DefaultOptionBuilder withLongName(String longName)
Use this long option name. The first name is used as the preferred display name for the Command and then later names are used as aliases.
Parameters:
longName - the name to use
Returns:
this builder

withRequired

public DefaultOptionBuilder withRequired(boolean newRequired)
Use this optionality
Parameters:
newRequired - true iff the Option is required
Returns:
this builder

withShortName

public DefaultOptionBuilder withShortName(String shortName)
Use this short option name. The first name is used as the preferred display name for the Command and then later names are used as aliases.
Parameters:
shortName - the name to use
Returns:
this builder