io.quarkus.picocli.runtime.PicocliBeansFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-picocli Show documentation
Show all versions of quarkus-picocli Show documentation
Develop command line applications with Picocli
package io.quarkus.picocli.runtime;
import io.quarkus.arc.Arc;
import io.quarkus.arc.InstanceHandle;
import picocli.CommandLine;
class PicocliBeansFactory implements CommandLine.IFactory {
private final CommandLine.IFactory defaultFactory = CommandLine.defaultFactory();
@Override
public K create(Class aClass) throws Exception {
InstanceHandle instance = Arc.container().instance(aClass);
if (instance.isAvailable()) {
return instance.get();
}
return defaultFactory.create(aClass);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy