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

io.swagger.jaxrs.ext.SwaggerExtensions Maven / Gradle / Ivy

There is a newer version: 1.5.7
Show newest version
package io.swagger.jaxrs.ext;

import io.swagger.jaxrs.DefaultParameterExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ServiceLoader;

public class SwaggerExtensions {
    static Logger LOGGER = LoggerFactory.getLogger(SwaggerExtensions.class);

    private static List extensions = null;

    public static List getExtensions() {
        return extensions;
    }

    public static void setExtensions(List ext) {
        extensions = ext;
    }

    public static Iterator chain() {
        return extensions.iterator();
    }

    static {
        extensions = new ArrayList();
        ServiceLoader loader = ServiceLoader.load(SwaggerExtension.class);
        Iterator itr = loader.iterator();
        while (itr.hasNext()) {
            SwaggerExtension ext = itr.next();
            LOGGER.debug("adding extension " + ext);
            extensions.add(ext);
        }
        extensions.add(new DefaultParameterExtension());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy