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

org.jboss.resteasy.reactive.server.model.DynamicFeatures 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.List;
import java.util.function.Function;

import jakarta.ws.rs.container.DynamicFeature;

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

/**
 * Container for {@link jakarta.ws.rs.container.DynamicFeature}
 */
public class DynamicFeatures {

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

    public void addFeature(ResourceDynamicFeature resourceFeature) {
        resourceDynamicFeatures.add(resourceFeature);
    }

    public List getResourceDynamicFeatures() {
        return resourceDynamicFeatures;
    }

    public void initializeDefaultFactories(Function> factoryCreator) {
        for (ResourceDynamicFeature i : resourceDynamicFeatures) {
            if (i.getFactory() == null) {
                i.setFactory((BeanFactory) factoryCreator.apply(i.getClassName()));
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy