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

cn.featherfly.common.gentool.exception.GeneratorRunner Maven / Gradle / Ivy

There is a newer version: 0.2.3
Show newest version

package cn.featherfly.common.gentool.exception;

import java.util.ArrayList;
import java.util.List;

import cn.featherfly.common.gentool.GenerateConfig;

/**
 * 

* GeneratorRunner *

* * @author zhongj */ public class GeneratorRunner { public static void main(String[] args) throws Exception { String configFile = null; List yamlFiles = new ArrayList<>(); if (args.length == 0) { throw new IllegalArgumentException("args error args.length must > 0"); } if (args.length == 1) { yamlFiles.add(args[0]); } else if (args.length > 1) { configFile = args[0]; for (int i = 0; i < args.length; i++) { if (i > 0) { yamlFiles.add(args[i]); } } } GenerateConfig config = new GenerateConfig(); if (configFile != null) { config.load(configFile); // config = GenerateConfig.create(configFile); } else { config.setTemplateSuffix(".template"); config.setTemplateDir("cn/featherfly/common/gentool/exception/template/"); } Generator generator = new Generator(config); yamlFiles.forEach(yamlFile -> { try { generator.generate(yamlFile); } catch (Exception e) { e.printStackTrace(); } }); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy