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

com.iqiny.silly.starter.StarterSillyProperties Maven / Gradle / Ivy

There is a newer version: 1.2.9
Show newest version
/*
 *  Copyright  iqiny.com
 *
 *  https://gitee.com/iqiny/silly
 *
 *  project name:silly-spring-boot-starter
 *  project description:top silly project pom.xml file
 */
package com.iqiny.silly.starter;

import com.iqiny.silly.core.base.SillyAdminProperties;
import com.iqiny.silly.core.base.SillyProperties;
import com.iqiny.silly.core.base.core.SillyRootData;
import com.iqiny.silly.core.base.impl.DefaultSillyRootData;
import com.iqiny.silly.core.config.property.SillyProcessProperty;
import com.iqiny.silly.core.config.property.SillyPropertyHandle;
import com.iqiny.silly.core.config.property.impl.DefaultProcessProperty;
import com.iqiny.silly.core.engine.SillyEngineService;
import com.iqiny.silly.core.filter.SillyFilter;
import com.iqiny.silly.core.group.DefaultSillyTaskCategoryGroup;
import com.iqiny.silly.core.group.SillyTaskCategoryGroup;
import com.iqiny.silly.core.resume.SillyResumeService;
import com.iqiny.silly.core.savehandle.SillyOnceSourceData;
import com.iqiny.silly.core.savehandle.data.DefaultSillyOnceSourceData;
import com.iqiny.silly.core.service.SillyReadService;
import com.iqiny.silly.core.service.SillyWriteService;
import com.iqiny.silly.core.service.crud.SillyCrudService;
import com.iqiny.silly.service.impl.DefaultMySillyReadService;
import com.iqiny.silly.service.impl.DefaultMySillyWriteService;
import com.iqiny.silly.spring.spel.SillySpelPropertyHandle;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.stereotype.Component;

import javax.servlet.Filter;

@Component
@ConfigurationProperties(prefix = StarterSillyProperties.PREFIX)
public class StarterSillyProperties implements SillyProperties {

    public static final String PREFIX = "silly";

    private String processPattern = "classpath*:/silly/*.json";

    private String entityScanPackage;

    private String[] categories;

    private Class processPropertyClazz = DefaultProcessProperty.class;

    private Class propertyHandleClazz = SillySpelPropertyHandle.class;

    private Class sillyRootDataClazz = DefaultSillyRootData.class;

    private Class defaultReadServiceClazz = DefaultMySillyReadService.class;

    private Class defaultWriteServiceClazz = DefaultMySillyWriteService.class;

    private Class defaultEngineServiceClazz;

    private Class defaultCrudServiceClazz;

    private Class defaultResumeServiceClazz;

    private int filterOrder = 1;

    private String filterUrlPatterns = "/*";

    private String filterParamName = "category";

    @NestedConfigurationProperty
    private SillyAdminProperties admin;

    {
        try {
            defaultEngineServiceClazz = (Class) Class.forName("com.iqiny.silly.service.process.DefaultSillyProcessEngineService");
        } catch (ClassNotFoundException ignore) {
        }
        try {
            defaultCrudServiceClazz = (Class) Class.forName("com.iqiny.silly.service.crud.DefaultSillyCrudService");
        } catch (ClassNotFoundException ignore) {
        }
        try {
            defaultResumeServiceClazz = (Class) Class.forName("com.iqiny.silly.service.resume.DefaultSillyResumeService");
        } catch (ClassNotFoundException ignore) {
        }
    }


    private Class defaultTaskCategoryGroupClazz = DefaultSillyTaskCategoryGroup.class;

    private Class defaultNodeSourceDataClazz = DefaultSillyOnceSourceData.class;

    private Class defaultSillyFilterClazz = SillyFilter.class;

    private Boolean autoRefresh = Boolean.FALSE;

    @Override
    public String getProcessPattern() {
        return processPattern;
    }

    public void setProcessPattern(String processPattern) {
        this.processPattern = processPattern;
    }

    @Override
    public String getEntityScanPackage() {
        return entityScanPackage;
    }

    public void setEntityScanPackage(String entityScanPackage) {
        this.entityScanPackage = entityScanPackage;
    }

    @Override
    public Class getProcessPropertyClazz() {
        return processPropertyClazz;
    }

    public void setProcessPropertyClazz(Class processPropertyClazz) {
        this.processPropertyClazz = processPropertyClazz;
    }

    @Override
    public Class getPropertyHandleClazz() {
        return propertyHandleClazz;
    }

    public void setPropertyHandleClazz(Class propertyHandleClazz) {
        this.propertyHandleClazz = propertyHandleClazz;
    }

    @Override
    public Class getSillyRootDataClazz() {
        return sillyRootDataClazz;
    }

    public void setSillyRootDataClazz(Class sillyRootDataClazz) {
        this.sillyRootDataClazz = sillyRootDataClazz;
    }

    @Override
    public String[] getCategories() {
        return categories;
    }

    public void setCategories(String[] categories) {
        this.categories = categories;
    }

    @Override
    public Class getDefaultReadServiceClazz() {
        return defaultReadServiceClazz;
    }

    public void setDefaultReadServiceClazz(Class defaultReadServiceClazz) {
        this.defaultReadServiceClazz = defaultReadServiceClazz;
    }

    @Override
    public Class getDefaultWriteServiceClazz() {
        return defaultWriteServiceClazz;
    }

    public void setDefaultWriteServiceClazz(Class defaultWriteServiceClazz) {
        this.defaultWriteServiceClazz = defaultWriteServiceClazz;
    }

    @Override
    public Class getDefaultEngineServiceClazz() {
        return defaultEngineServiceClazz;
    }

    public void setDefaultEngineServiceClazz(Class defaultEngineServiceClazz) {
        this.defaultEngineServiceClazz = defaultEngineServiceClazz;
    }

    @Override
    public Class getDefaultCrudServiceClazz() {
        return defaultCrudServiceClazz;
    }

    public void setDefaultCrudServiceClazz(Class defaultCrudServiceClazz) {
        this.defaultCrudServiceClazz = defaultCrudServiceClazz;
    }

    @Override
    public Class getDefaultResumeServiceClazz() {
        return defaultResumeServiceClazz;
    }

    public void setDefaultResumeServiceClazz(Class defaultResumeServiceClazz) {
        this.defaultResumeServiceClazz = defaultResumeServiceClazz;
    }

    @Override
    public Class getDefaultTaskCategoryGroupClazz() {
        return defaultTaskCategoryGroupClazz;
    }

    public void setDefaultTaskCategoryGroupClazz(Class defaultTaskCategoryGroupClazz) {
        this.defaultTaskCategoryGroupClazz = defaultTaskCategoryGroupClazz;
    }

    @Override
    public Class getDefaultNodeSourceDataClazz() {
        return defaultNodeSourceDataClazz;
    }

    public void setDefaultNodeSourceDataClazz(Class defaultNodeSourceDataClazz) {
        this.defaultNodeSourceDataClazz = defaultNodeSourceDataClazz;
    }

    @Override
    public int getFilterOrder() {
        return filterOrder;
    }

    public void setFilterOrder(int filterOrder) {
        this.filterOrder = filterOrder;
    }

    @Override
    public String getFilterUrlPatterns() {
        return filterUrlPatterns;
    }

    public void setFilterUrlPatterns(String filterUrlPatterns) {
        this.filterUrlPatterns = filterUrlPatterns;
    }

    @Override
    public String getFilterParamName() {
        return filterParamName;
    }

    public void setFilterParamName(String filterParamName) {
        this.filterParamName = filterParamName;
    }

    @Override
    public Class getDefaultSillyFilterClazz() {
        return defaultSillyFilterClazz;
    }

    public void setDefaultSillyFilterClazz(Class defaultSillyFilterClazz) {
        this.defaultSillyFilterClazz = defaultSillyFilterClazz;
    }

    @Override
    public boolean autoRefresh() {
        return autoRefresh == null ? Boolean.FALSE : autoRefresh;
    }

    @Override
    public SillyAdminProperties getAdmin() {
        return admin;
    }

    public void setAdmin(SillyAdminProperties sillyAdminProperties) {
        this.admin = sillyAdminProperties;
    }

    public Boolean getAutoRefresh() {
        return autoRefresh;
    }

    public void setAutoRefresh(Boolean autoRefresh) {
        this.autoRefresh = autoRefresh;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy