org.jboss.resteasy.reactive.server.model.Features 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.core.Feature;
import org.jboss.resteasy.reactive.common.model.ResourceFeature;
import org.jboss.resteasy.reactive.spi.BeanFactory;
public class Features {
private final List resourceFeatures = new ArrayList<>();
public void addFeature(ResourceFeature resourceFeature) {
resourceFeatures.add(resourceFeature);
}
public List getResourceFeatures() {
return resourceFeatures;
}
public void initializeDefaultFactories(Function> factoryCreator) {
for (ResourceFeature i : resourceFeatures) {
if (i.getFactory() == null) {
i.setFactory((BeanFactory) factoryCreator.apply(i.getClassName()));
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy