org.zodiac.autoconfigure.bootstrap.rule.AppRuleBootstrapConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.bootstrap.rule;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.core.Ordered;
import org.zodiac.autoconfigure.bootstrap.condition.ConditionalOnRuleEnabled;
import org.zodiac.core.bootstrap.rule.AppRuleConfigPropertySourceLocator;
import org.zodiac.core.bootstrap.rule.AppRuleProviderCustomizer;
import org.zodiac.core.constants.AppOrderConstants;
import java.util.stream.Collectors;
@SpringBootConfiguration
@ConditionalOnRuleEnabled
public class AppRuleBootstrapConfiguration implements Ordered {
@Bean
protected AppRuleConfigPropertySourceLocator
metadataConfigPropertySourceLocator(ObjectProvider objectProvider) {
return new AppRuleConfigPropertySourceLocator(objectProvider.stream().collect(Collectors.toList()));
}
@Override
public int getOrder() {
return AppOrderConstants.BootstrapOrder.RULE_ORDER;
}
}