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

org.jboss.resteasy.reactive.server.model.ParamConverterProviders Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package org.jboss.resteasy.reactive.server.model;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;

import jakarta.ws.rs.ext.ParamConverterProvider;

import org.jboss.resteasy.reactive.common.model.ResourceParamConverterProvider;
import org.jboss.resteasy.reactive.spi.BeanFactory;

public class ParamConverterProviders {

    private final List paramConverterProviders = new ArrayList<>();

    public void addParamConverterProviders(ResourceParamConverterProvider resourceFeature) {
        paramConverterProviders.add(resourceFeature);
    }

    public List getParamConverterProviders() {
        return paramConverterProviders;
    }

    public void sort() {
        Collections.sort(paramConverterProviders);
    }

    public void initializeDefaultFactories(Function> factoryCreator) {
        for (ResourceParamConverterProvider i : paramConverterProviders) {
            i.setFactory((BeanFactory) factoryCreator.apply(i.getClassName()));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy