public class PicocliSpringFactory
extends java.lang.Object
implements picocli.CommandLine.IFactory
CommandLine.IFactory implementation that
looks up classes in a given org.springframework.context.ApplicationContext.
This allows picocli subcommands (and other objects that are instantiated as needed)
to have javax.inject annotations that will be populated
by Spring's dependency injection framework.| Constructor and Description |
|---|
PicocliSpringFactory(org.springframework.context.ApplicationContext applicationContext)
Constructs a PicocliSpringFactory with the specified Application context,
and picocli's
default factory as the fallback factory
for classes not found in the application context. |
PicocliSpringFactory(org.springframework.context.ApplicationContext applicationContext,
picocli.CommandLine.IFactory fallbackFactory)
Constructs a PicocliSpringFactory with the specified Application context,
and the specified fallback factory
for classes not found in the application context.
|
| Modifier and Type | Method and Description |
|---|---|
<K> K |
create(java.lang.Class<K> clazz) |
public PicocliSpringFactory(org.springframework.context.ApplicationContext applicationContext)
default factory as the fallback factory
for classes not found in the application context.applicationContext - the application context to look up classes in; must be non-nullpublic PicocliSpringFactory(org.springframework.context.ApplicationContext applicationContext,
picocli.CommandLine.IFactory fallbackFactory)
applicationContext - the application context to look up classes in; must be non-nullfallbackFactory - the factory used to instantiate classes that are
not found in the specified application context; must be non-null