File tree Expand file tree Collapse file tree 2 files changed +3
-36
lines changed
src/main/java/com/yanglb/codegen Expand file tree Collapse file tree 2 files changed +3
-36
lines changed Original file line number Diff line number Diff line change 1515 */
1616package com .yanglb .codegen .core ;
1717
18- import com .yanglb .codegen .core .generator .IGenerator ;
19- import com .yanglb .codegen .core .model .ParamaModel ;
2018import com .yanglb .codegen .exceptions .CodeGenException ;
21- import com .yanglb .codegen .utils .Conf ;
2219import com .yanglb .codegen .utils .Resources ;
2320
2421public class GenFactory <T > {
2522 // 外部不可创建实例
2623 private GenFactory () {
27-
2824 }
29- //
30- // /**
31- // * 创建生成器
32- // * @param paramaModel 参数模型
33- // * @return IGenerator
34- // * @throws CodeGenException
35- // */
36- // public static IGenerator createGenerator(ParamaModel paramaModel) throws CodeGenException{
37- // IGenerator generator = null;
38- // try {
39- // generator = createByName(paramaModel.getCmdModel().getGenerator());
40- // generator.init(paramaModel);
41- // } catch (Exception e) {
42- // throw new CodeGenException(Resources.getString("E_010"));
43- // }
44- // return generator;
45- // }
46-
25+
4726 /**
4827 * 根据配置文件中配置的名字创建
4928 * @param <T> 创建接口类型
@@ -61,15 +40,7 @@ public static <T> T createByName(String className) throws CodeGenException {
6140 return result ;
6241 }
6342
64- /**
65- * 根据类名创建
66- * @param implName
67- * @return
68- * @throws InstantiationException
69- * @throws IllegalAccessException
70- * @throws ClassNotFoundException
71- */
72- protected T create (String implName )
43+ private T create (String implName )
7344 throws InstantiationException , IllegalAccessException , ClassNotFoundException {
7445 T instance = null ;
7546 if (implName .startsWith ("." )) implName = "com.yanglb.codegen" + implName ;
Original file line number Diff line number Diff line change 1616package com .yanglb .codegen .utils ;
1717
1818import com .yanglb .codegen .core .model .CmdModel ;
19- import jdk .nashorn .internal .ir .CallNode ;
2019import org .yaml .snakeyaml .Yaml ;
2120
2221import java .io .InputStream ;
@@ -48,12 +47,9 @@ public static CmdModel getCmdModel(String cmd) {
4847 return model ;
4948 }
5049
51- public static String CATEGORY_GENERATOR = "generator" ;
5250 public static String CATEGORY_READER = "reader" ;
53- public static String CATEGORY_TRANSLATOR = "translator" ;
5451 public static String CATEGORY_WRITER = "writer" ;
55- public static String CATEGORY_PARSER = "parser" ;
56-
52+
5753 public static String getString (String category , String key ) {
5854 // 初始化
5955 init ();
You can’t perform that action at this time.
0 commit comments