public interface IsApplication extends CategoryIs, HasDescription
Base interface for an application with different option types and default argument parsing.
| Modifier and Type | Method and Description |
|---|---|
default void |
addAllOptions(Iterable<?> options)
Adds options taken from an collection of objects.
|
default void |
addAllOptions(Object[] options)
Adds options taken from an array of objects.
|
default void |
addOption(Object option)
Adds a new option to the application.
|
default void |
appHelpScreen()
Prints a help screen for the application, to be used by an executing component.
|
default void |
appHelpScreen(String arg)
Prints specific help for a command line option of the application.
|
default Apo_SimpleC |
cliSimpleHelpOption()
Returns the required help option.
|
default Apo_TypedC<String> |
cliTypedHelpOption()
Returns the required help option.
|
default Apo_SimpleC |
cliVersionOption()
Returns the required version option.
|
default int |
executeApplication(String[] args)
Executes the application.
|
String |
getAppDescription()
Returns a 1 line description of the application, should not be null.
|
default String |
getAppDisplayName()
Returns the display name of the application.
|
String |
getAppName()
Returns the name of the application, which is the name of the executable object for instance a script.
|
String |
getAppVersion()
Returns version information of the application for command line processing of the version option.
|
default Set<ApoBaseC> |
getCLiALlOptions()
Returns all CLI options as base implementation.
|
App_CliParser |
getCliParser()
Returns the CLI parser.
|
default Set<Apo_SimpleC> |
getCliSimpleOptions()
Returns all CLI simple options.
|
default Set<Apo_TypedC<?>> |
getCliTypedOptions()
Returns all CLI typed options.
|
default int |
getConsoleWidth()
Returns the width of the console window, printable columns.
|
default String |
getDescription()
Returns the description of an object.
|
Set<Apo_TypedE<?>> |
getEnvironmentOptions()
Returns all environment options.
|
Set<Apo_TypedP<?>> |
getPropertyOptions()
Returns all property options.
|
static boolean |
IN_ARRAY(String[] array,
ApoBaseC apo)
Simple utility to test if a CLI option (short or long) is in an array.
|
String |
longDescriptionString(Object longDescription)
Translates an option’s long help object into a string.
|
static boolean IN_ARRAY(String[] array, ApoBaseC apo)
Simple utility to test if a CLI option (short or long) is in an array.
array - the string array to test againstapo - the option to search fordefault void addAllOptions(Iterable<?> options)
Adds options taken from an collection of objects.
options - object array, ignored if null, only application options will be takendefault void addAllOptions(Object[] options)
Adds options taken from an array of objects.
options - object array, ignored if null, only application options will be takendefault void addOption(Object option)
Adds a new option to the application. Depending on its class, the option will be added to the environment options, the property options, and/or the CLI parser. If the class of the option is not supported, it will be ignored. Null values are ignored.
option - the option to be added, ignored if nullIllegalStateException - if the option is already in usedefault void appHelpScreen()
Prints a help screen for the application, to be used by an executing component.
default void appHelpScreen(String arg)
Prints specific help for a command line option of the application.
arg - the command line argument specific help is requested fordefault Apo_SimpleC cliSimpleHelpOption()
Returns the required help option.
default Apo_TypedC<String> cliTypedHelpOption()
Returns the required help option.
default Apo_SimpleC cliVersionOption()
Returns the required version option.
default int executeApplication(String[] args)
Executes the application. The default implementation will try to parse the command line with the application’s CLI object and if that does not return success (0), call the help screen automatically.
args - arguments for executionString getAppDescription()
Returns a 1 line description of the application, should not be null.
default String getAppDisplayName()
Returns the display name of the application. This display name will be used for documentation and general user interaction. The default is the original application name.
getAppName(), must not be blankString getAppName()
Returns the name of the application, which is the name of the executable object for instance a script. This application name will be used for information and error messages and user interactions.
String getAppVersion()
Returns version information of the application for command line processing of the version option.
default Set<ApoBaseC> getCLiALlOptions()
Returns all CLI options as base implementation.
App_CliParser getCliParser()
Returns the CLI parser.
default Set<Apo_SimpleC> getCliSimpleOptions()
Returns all CLI simple options.
default Set<Apo_TypedC<?>> getCliTypedOptions()
Returns all CLI typed options.
default int getConsoleWidth()
Returns the width of the console window, printable columns.
default String getDescription()
HasDescriptionReturns the description of an object.
getDescription in interface HasDescriptionSet<Apo_TypedE<?>> getEnvironmentOptions()
Returns all environment options.
Set<Apo_TypedP<?>> getPropertyOptions()
Returns all property options.
Copyright © 2016–2017. All rights reserved.