@Override
    protected T instance(Mapping mapping, ConfigurationContext context) throws ConfiguratorException {
        final ExtensionList<T> list = Jenkins.get().getExtensionList(target);
        if (list.size() != 1) {
            throw new ConfiguratorException("Expected a unique instance of extension " + target);
        }
        return list.get(0);
    }
A generic {@link io.jenkins.plugins.casc.Configurator} for {@link hudson.Extension} singletons
@author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
plugin/src/main/java/io/jenkins/plugins/casc/impl/configurators/ExtensionConfigurator.java