com.github.chuanzh.doctool.CreateNote Maven / Gradle / Ivy
The newest version!
package com.github.chuanzh.doctool;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringWriter;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import com.github.chuanzh.eop.annotation.DescNotNull;
import com.github.chuanzh.eop.annotation.DescNote;
import com.github.chuanzh.util.FuncStatic;
import freemarker.template.Configuration;
import freemarker.template.DefaultObjectWrapper;
import freemarker.template.Template;
/**
* 创建文档注释
*
*/
public class CreateNote {
private Logger logger = Logger.getLogger(CreateNote.class);
private static Configuration cfg = new Configuration();
private Template temp = null;
private static String encode = "UTF-8";
static {
cfg.setClassForTemplateLoading(CreateNote.class,"./");
cfg.setDefaultEncoding(encode);
cfg.setObjectWrapper(new DefaultObjectWrapper());
cfg.setNumberFormat("#.######");
}
public void create(String notePath, String packageName) throws IOException, ClassNotFoundException {
File file = new File(notePath);
if(!file.exists()) {
file.createNewFile();
logger.info("mkdir "+notePath);
}
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy