Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class OptionSpec
The model of one option, written by the build from an
CommandLine.Option.Constructors
Methods
public String[] names() | Every name of the option. |
public String longestName() | The longest name, which the usage line and error messages print. |
public boolean negatable() | Whether --no-<name> sets the flag to false. |
public boolean usageHelp() | Whether this is the built-in --help. |
public boolean versionHelp() | Whether this is the built-in --version. |
Inherited methods
From ArgSpec
slot, description, paramLabel, flag, required, arityMin, arityMax, multiple, defaultValue, split, hidden
Constructor details
OptionSpec
public OptionSpec(int slot, String[] names, String description, String paramLabel, boolean flag, boolean required, String arity, boolean multiple, String defaultValue, String split, boolean negatable, boolean hidden)Creates the model of an option.
Parameters
slotint- the number the generated binding knows this option by
namesString[]- every name, such as
-vand--verbose descriptionString- the help text
paramLabelString- the placeholder printed for its value, such as
<file> flagboolean- true for a boolean that takes no value
requiredboolean- whether a command line without it is an error
arityString- how many values one occurrence takes, as
1,0..1or1..*; empty for the default multipleboolean- true when the field is an array or a list
defaultValueString- the value used when the option is absent, or null;
${env:NAME}reads an environment variable splitString- a separator that splits one value into several, or null
negatableboolean- whether
--no-<name>sets a flag to false hiddenboolean- whether it is left out of the help
Method details
names
public String[] names()Every name of the option.
longestName
public String longestName()The longest name, which the usage line and error messages print.
negatable
public boolean negatable()Whether
--no-<name> sets the flag to false.usageHelp
public boolean usageHelp()Whether this is the built-in
--help.versionHelp
public boolean versionHelp()Whether this is the built-in
--version.