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

com.codingapi.springboot.permission.analyzer.SqlAnalyzerConfiguration Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.codingapi.springboot.permission.analyzer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * @author lorne
 * @since 1.0.0
 */
@Configuration
public class SqlAnalyzerConfiguration {

    static class SqlAnalyzerFilterBeanInit {
        public SqlAnalyzerFilterBeanInit(List filters) {
            if(filters!=null&&filters.size()>0) {
                AnalyzerFilterContext.getInstance().addFilters(filters);
            }
        }
    }

    @Bean
    @ConditionalOnMissingBean
    public SqlAnalyzerFilterBeanInit sqlAnalyzerFilterInit(@Autowired(required = false) List filters){
        return new SqlAnalyzerFilterBeanInit(filters);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy