org.jboss.resteasy.reactive.server.model.DynamicFeatures Maven / Gradle / Ivy
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