Search in sources :

Example 1 with StrKit

use of com.jfinal.kit.StrKit in project jboot by yangfuhai.

the class JbootServiceImplGenerator method generate.

public void generate(List<TableMeta> tableMetas) {
    System.out.println("Generate Service Impl ...");
    System.out.println("Service Impl Output Dir: " + outputDir);
    Engine engine = Engine.create("forServiceImpl");
    engine.setSourceFactory(new ClassPathSourceFactory());
    engine.addSharedMethod(new StrKit());
    engine.addSharedObject("getterTypeMap", getterTypeMap);
    engine.addSharedObject("javaKeyword", JavaKeyword.me);
    for (TableMeta tableMeta : tableMetas) {
        genBaseModelContent(tableMeta);
    }
    writeToFile(tableMetas);
}
Also used : ClassPathSourceFactory(com.jfinal.template.source.ClassPathSourceFactory) TableMeta(com.jfinal.plugin.activerecord.generator.TableMeta) StrKit(com.jfinal.kit.StrKit) Engine(com.jfinal.template.Engine)

Example 2 with StrKit

use of com.jfinal.kit.StrKit in project jboot by yangfuhai.

the class JbootServiceInterfaceGenerator method generate.

@Override
public void generate(List<TableMeta> tableMetas) {
    System.out.println("Generate base model ...");
    System.out.println("Base Model Output Dir: " + baseModelOutputDir);
    Engine engine = Engine.create("forService");
    engine.setSourceFactory(new ClassPathSourceFactory());
    engine.addSharedMethod(new StrKit());
    engine.addSharedObject("getterTypeMap", getterTypeMap);
    engine.addSharedObject("javaKeyword", javaKeyword);
    for (TableMeta tableMeta : tableMetas) {
        genBaseModelContent(tableMeta);
    }
    writeToFile(tableMetas);
}
Also used : ClassPathSourceFactory(com.jfinal.template.source.ClassPathSourceFactory) TableMeta(com.jfinal.plugin.activerecord.generator.TableMeta) StrKit(com.jfinal.kit.StrKit) Engine(com.jfinal.template.Engine)

Example 3 with StrKit

use of com.jfinal.kit.StrKit in project jfinal by jfinal.

the class BaseModelGenerator method initEngine.

protected void initEngine() {
    engine = new Engine();
    // 从 class path 内读模板文件
    engine.setToClassPathSourceFactory();
    engine.addSharedMethod(new StrKit());
    engine.addSharedObject("getterTypeMap", getterTypeMap);
    engine.addSharedObject("javaKeyword", javaKeyword);
}
Also used : StrKit(com.jfinal.kit.StrKit) Engine(com.jfinal.template.Engine)

Example 4 with StrKit

use of com.jfinal.kit.StrKit in project jfinal by jfinal.

the class MappingKitGenerator method initEngine.

protected void initEngine() {
    engine = new Engine();
    engine.setToClassPathSourceFactory();
    engine.addSharedMethod(new StrKit());
}
Also used : StrKit(com.jfinal.kit.StrKit) Engine(com.jfinal.template.Engine)

Example 5 with StrKit

use of com.jfinal.kit.StrKit in project jfinal by jfinal.

the class ModelGenerator method initEngine.

protected void initEngine() {
    engine = new Engine();
    engine.setToClassPathSourceFactory();
    engine.addSharedMethod(new StrKit());
}
Also used : StrKit(com.jfinal.kit.StrKit) Engine(com.jfinal.template.Engine)

Aggregations

StrKit (com.jfinal.kit.StrKit)5 Engine (com.jfinal.template.Engine)5 TableMeta (com.jfinal.plugin.activerecord.generator.TableMeta)2 ClassPathSourceFactory (com.jfinal.template.source.ClassPathSourceFactory)2