mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 01:28:24 +08:00
style: 添加 GeneratorFactory 注释。
This commit is contained in:
parent
12e563fc7a
commit
ab2c5b706a
@ -22,6 +22,11 @@ import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 代码生成器工厂,用于创建各种类型文件的生成。
|
||||
*
|
||||
* @see GenTypeConst
|
||||
*/
|
||||
public class GeneratorFactory {
|
||||
|
||||
private static final Map<String, IGenerator> generators = new HashMap<>();
|
||||
@ -37,17 +42,36 @@ public class GeneratorFactory {
|
||||
registerGenerator(GenTypeConst.PACKAGE_INFO, new PackageInfoGenerator());
|
||||
}
|
||||
|
||||
private GeneratorFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定类型文件的生成器。
|
||||
*
|
||||
* @param genType 生成类型
|
||||
* @return 该类型的文件生成器
|
||||
*/
|
||||
public static IGenerator getGenerator(String genType) {
|
||||
return generators.get(genType);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有的文件生成器。
|
||||
*
|
||||
* @return 所有的文件生成器
|
||||
*/
|
||||
public static Collection<IGenerator> getGenerators() {
|
||||
return generators.values();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 注册文件生成器。
|
||||
*
|
||||
* @param name 生成器名称
|
||||
* @param generator 生成器
|
||||
*/
|
||||
public static void registerGenerator(String name, IGenerator generator) {
|
||||
generators.put(name, generator);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user