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

org.artifact.builder.template.DesignTemplate Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package org.artifact.builder.template;

import java.io.File;

import org.artifact.builder.AbstractModeleBuilder;

/**
 * @author : DengYing
 * @CreateDate : 2018年2月26日 下午5:39:35
 * @Description :设计模板
 */
public abstract class DesignTemplate {
	
	private AbstractModeleBuilder builder;
	
	public DesignTemplate(AbstractModeleBuilder builder) {
		super();
		this.builder = builder;
	}
	
	/** 创建文件夹 */
	public void mkdir(String sourcePath){
		File file = new File(getPath());
		if (!file.exists() || !file.isDirectory()) {
			file.mkdirs();
		}
	}
	
	/** 取得文件后缀 */
	public String getFileSuffix(){
		return ".java";
	}
	
	public abstract String getClassSuffix();
	
	/** 取得模板名称 */
	public abstract String getTemplateName();
	
	/** 取得物理路径 */
	public abstract String getPath();
	
	/** 取得包名称 */
	public abstract String getPackage();
	
//	/** 取得文件名称 */
//	public String getClassName(String tableName){
//		// 1.去除前缀
//		String fileName = StrUtil.removePrefix(tableName,"t_");
//		// 2.转驼峰
//		fileName = StrUtil.toCamelCase(fileName);
//		// 3. 首字母大写
//		fileName = StrUtil.upperFirst(fileName);
//		return fileName;
//	}

	
	public AbstractModeleBuilder getBuilder() {
		return builder;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy