public class SubCommand extends Object
Constructor and Description |
---|
SubCommand(IDefinition definition,
ResourceBundle rb,
String name,
List mandatoryOptions,
List optionalOptions,
List optionAliases,
String implClassName,
boolean webSupport,
String deprecationWarning)
Creates a sub command object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkboxUI(String opt)
Returns
true if option is to be displayed as checkbox in
web based CLI. |
void |
execute(RequestContext rc)
Services a CLI request.
|
String |
getDeprecationWarning() |
String |
getDescription()
Returns description of the sub command.
|
String |
getLongOptionName(String name)
Returns long argument/option name given its short name.
|
List |
getMandatoryOptions()
Returns list of mandatory argument/options.
|
String |
getName()
Returns name of the sub command.
|
List |
getOptionAliases(String name)
Returns option aliases.
|
Set |
getOptionAliasesGroup(String fullName)
Returns option aliases group.
|
List |
getOptionalOptions()
Returns list of optional argument/options.
|
String |
getOptionDescription(String name)
Returns the description of an argument/option.
|
String |
getOptionDescription(String name,
boolean isWeb)
Returns the description of an argument/option.
|
static String |
getReservedLongOptionName(String shortName)
Returns long reserved argument/option name given its short name.
|
static String |
getReservedShortOptionName(String longName)
Returns short reserved argument/option name given its long name.
|
ResourceBundle |
getResourceBundle()
Returns resource bundle of the sub command.
|
String |
getShortOptionName(String name)
Returns short argument/option name given its long name.
|
boolean |
isBinaryOption(String cmdName)
Returns
true if option is binary. |
boolean |
isOptionAlias(String name)
Returns
true if option is an alias. |
static boolean |
isReservedLongOption(String name)
Returns
true if an argument/option is reserved. |
static boolean |
isReservedShortOption(String name)
Returns
true if an argument/option is reserved. |
boolean |
isSupportedOption(String name)
Returns
|
boolean |
isUnaryOption(String cmdName)
Returns
true if option is unary. |
boolean |
textareaUI(String opt)
Returns
true if option is to be displayed as text area in
web based CLI. |
boolean |
validateOptions(Map options,
SSOToken ssoToken)
Returns
true if the given options are valid in the
context of this sub command. |
boolean |
webEnabled()
Returns
true if this command is supported on web browser. |
public SubCommand(IDefinition definition, ResourceBundle rb, String name, List mandatoryOptions, List optionalOptions, List optionAliases, String implClassName, boolean webSupport, String deprecationWarning) throws CLIException
definition
- Definition class.rb
- Resource Bundle.name
- Name of the Sub Command.mandatoryOptions
- Formated list of mandatory argument/options.optionalOptions
- Formated list of optional argument/options.optionAliases
- Formated list of argument/options aliases.implClassName
- Implementation class name.webSupport
- true
if this command is supported on the web browser.deprecationWarning
- if set to a non zero length string (default is "") then print this warning.CLIException
- if this object cannot be constructed.public static boolean isReservedShortOption(String name)
true
if an argument/option is reserved.name
- Short name of argument/option.true
if an argument/option is reserved.public static boolean isReservedLongOption(String name)
true
if an argument/option is reserved.name
- Full name of argument/option.true
if an argument/option is reserved.public static String getReservedShortOptionName(String longName)
longName
- Long name of reserved argument/option.public static String getReservedLongOptionName(String shortName)
shortName
- Short name of reserved argument/option.public String getName()
public String getDescription()
public List getOptionalOptions()
public List getMandatoryOptions()
public List getOptionAliases(String name)
name
- Full name of argument/option.public Set getOptionAliasesGroup(String fullName)
fullName
- Full name of argument/option.public boolean isOptionAlias(String name)
true
if option is an alias.name
- Full name of argument/option.true
if option is an alias.public void execute(RequestContext rc) throws CLIException
rc
- Request Context.CLIException
- if request cannot be serviced.public boolean validateOptions(Map options, SSOToken ssoToken)
true
if the given options are valid in the
context of this sub command.options
- Map of argument/option full name to its values (List).ssoToken
- Single Sign On token of the user.true
if the given options are valid.public String getLongOptionName(String name)
name
- short name of argument/option.public String getShortOptionName(String name)
name
- Long name of argument/option.public boolean isSupportedOption(String name)
name
- Name of the argument/option.public String getOptionDescription(String name)
name
- Name of the argument/option.public String getOptionDescription(String name, boolean isWeb)
name
- Name of the argument/option.isWeb
- true
if CLI is accessed via browser.public ResourceBundle getResourceBundle()
public boolean isUnaryOption(String cmdName)
true
if option is unary.true
if option is unary.public boolean isBinaryOption(String cmdName)
true
if option is binary.true
if option is binary.public boolean webEnabled()
true
if this command is supported on web browser.true
if this command is supported on web browser.public String getDeprecationWarning()
public boolean textareaUI(String opt)
true
if option is to be displayed as text area in
web based CLI.opt
- Name of option.true
if option is to be displayed as text area.public boolean checkboxUI(String opt)
true
if option is to be displayed as checkbox in
web based CLI.opt
- Name of option.true
if option is to be displayed as checkbox.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.