com.iqiny.silly.starter.StarterSillyProperties Maven / Gradle / Ivy
/*
* 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 extends SillyProcessProperty> processPropertyClazz = DefaultProcessProperty.class;
private Class extends SillyPropertyHandle> propertyHandleClazz = SillySpelPropertyHandle.class;
private Class extends SillyRootData> sillyRootDataClazz = DefaultSillyRootData.class;
private Class extends SillyReadService> defaultReadServiceClazz = DefaultMySillyReadService.class;
private Class extends SillyWriteService> defaultWriteServiceClazz = DefaultMySillyWriteService.class;
private Class extends SillyEngineService> defaultEngineServiceClazz;
private Class extends SillyCrudService> defaultCrudServiceClazz;
private Class extends SillyResumeService> defaultResumeServiceClazz;
private int filterOrder = 1;
private String filterUrlPatterns = "/*";
private String filterParamName = "category";
@NestedConfigurationProperty
private SillyAdminProperties admin;
{
try {
defaultEngineServiceClazz = (Class extends SillyEngineService>) Class.forName("com.iqiny.silly.service.process.DefaultSillyProcessEngineService");
} catch (ClassNotFoundException ignore) {
}
try {
defaultCrudServiceClazz = (Class extends SillyCrudService>) Class.forName("com.iqiny.silly.service.crud.DefaultSillyCrudService");
} catch (ClassNotFoundException ignore) {
}
try {
defaultResumeServiceClazz = (Class extends SillyResumeService>) Class.forName("com.iqiny.silly.service.resume.DefaultSillyResumeService");
} catch (ClassNotFoundException ignore) {
}
}
private Class extends SillyTaskCategoryGroup> defaultTaskCategoryGroupClazz = DefaultSillyTaskCategoryGroup.class;
private Class extends SillyOnceSourceData> defaultNodeSourceDataClazz = DefaultSillyOnceSourceData.class;
private Class extends Filter> 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 extends SillyProcessProperty> getProcessPropertyClazz() {
return processPropertyClazz;
}
public void setProcessPropertyClazz(Class extends SillyProcessProperty> processPropertyClazz) {
this.processPropertyClazz = processPropertyClazz;
}
@Override
public Class extends SillyPropertyHandle> getPropertyHandleClazz() {
return propertyHandleClazz;
}
public void setPropertyHandleClazz(Class extends SillyPropertyHandle> propertyHandleClazz) {
this.propertyHandleClazz = propertyHandleClazz;
}
@Override
public Class extends SillyRootData> getSillyRootDataClazz() {
return sillyRootDataClazz;
}
public void setSillyRootDataClazz(Class extends SillyRootData> sillyRootDataClazz) {
this.sillyRootDataClazz = sillyRootDataClazz;
}
@Override
public String[] getCategories() {
return categories;
}
public void setCategories(String[] categories) {
this.categories = categories;
}
@Override
public Class extends SillyReadService> getDefaultReadServiceClazz() {
return defaultReadServiceClazz;
}
public void setDefaultReadServiceClazz(Class extends SillyReadService> defaultReadServiceClazz) {
this.defaultReadServiceClazz = defaultReadServiceClazz;
}
@Override
public Class extends SillyWriteService> getDefaultWriteServiceClazz() {
return defaultWriteServiceClazz;
}
public void setDefaultWriteServiceClazz(Class extends SillyWriteService> defaultWriteServiceClazz) {
this.defaultWriteServiceClazz = defaultWriteServiceClazz;
}
@Override
public Class extends SillyEngineService> getDefaultEngineServiceClazz() {
return defaultEngineServiceClazz;
}
public void setDefaultEngineServiceClazz(Class extends SillyEngineService> defaultEngineServiceClazz) {
this.defaultEngineServiceClazz = defaultEngineServiceClazz;
}
@Override
public Class extends SillyCrudService> getDefaultCrudServiceClazz() {
return defaultCrudServiceClazz;
}
public void setDefaultCrudServiceClazz(Class extends SillyCrudService> defaultCrudServiceClazz) {
this.defaultCrudServiceClazz = defaultCrudServiceClazz;
}
@Override
public Class extends SillyResumeService> getDefaultResumeServiceClazz() {
return defaultResumeServiceClazz;
}
public void setDefaultResumeServiceClazz(Class extends SillyResumeService> defaultResumeServiceClazz) {
this.defaultResumeServiceClazz = defaultResumeServiceClazz;
}
@Override
public Class extends SillyTaskCategoryGroup> getDefaultTaskCategoryGroupClazz() {
return defaultTaskCategoryGroupClazz;
}
public void setDefaultTaskCategoryGroupClazz(Class extends SillyTaskCategoryGroup> defaultTaskCategoryGroupClazz) {
this.defaultTaskCategoryGroupClazz = defaultTaskCategoryGroupClazz;
}
@Override
public Class extends SillyOnceSourceData> getDefaultNodeSourceDataClazz() {
return defaultNodeSourceDataClazz;
}
public void setDefaultNodeSourceDataClazz(Class extends SillyOnceSourceData> 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 extends Filter> getDefaultSillyFilterClazz() {
return defaultSillyFilterClazz;
}
public void setDefaultSillyFilterClazz(Class extends Filter> 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;
}
}