DefaultApplicationArguments class
Default implementation of ApplicationArguments that wraps command-line arguments and exposes them via a PropertySource-based backing system.
This class uses SimpleCommandLinePropertySource internally to parse arguments, exposing both options and non-option arguments in a read-only fashion.
Example usage:
final args = DefaultApplicationArguments(['--env=prod', '--debug', 'input.txt']);
print(args.getSourceArgs()); // ['--env=prod', '--debug', 'input.txt']
print(args.getOptionNames()); // {'env', 'debug'}
print(args.containsOption('debug')); // true
print(args.getOptionValues('env')); // ['prod']
print(args.getNonOptionArgs()); // ['input.txt']
This is typically used within the JetLeaf application context during startup to extract configuration flags passed to the executable.
- Implemented types
Constructors
-
DefaultApplicationArguments(List<
String> args) - Default implementation of ApplicationArguments that wraps command-line arguments and exposes them via a PropertySource-based backing system.
Properties
Methods
-
containsOption(
String name) → bool -
Checks whether a given option name is present in the parsed arguments.
override
-
getNonOptionArgs(
) → List< String> -
Returns all non-option arguments (those without
--
prefix).override -
getOptionNames(
) → Set< String> -
Returns the names of all parsed option arguments.
override
-
getOptionValues(
String name) → List< String> ? -
Returns a list of values associated with a given option name.
override
-
getPackageName(
) → String - Represents an abstraction for identifying the package that an object, resource, or service belongs to.
-
getSourceArgs(
) → List< String> -
Returns the raw unprocessed arguments passed to the application.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited