All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.picocli.runtime.PicocliBeansFactory Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
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