public static interface CommandLine.IFactory
CommandLine.Command.subcommands()
, CommandLine.Option.converter()
, CommandLine.Parameters.converter()
and CommandLine.Command.versionProvider()
.
The default factory implementation simply creates a new instance of the specified class when create(Class)
is invoked.
You may provide a custom implementation of this interface. For example, a custom factory implementation could delegate to a dependency injection container that provides the requested instance.
Modifier and Type | Method | Description |
---|---|---|
<K> K |
create(Class<K> cls) |
Returns an instance of the specified class.
|
<K> K create(Class<K> cls) throws Exception
K
- the type of the object to returncls
- the class of the object to returnException
- an exception detailing what went wrong when creating or obtaining the instanceCopyright © 2017–2019. All rights reserved.