Java Code Examples for com.jfinal.template.Engine#create()

The following examples show how to use com.jfinal.template.Engine#create() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AppJbootServiceImplGenerator.java    From jboot-admin with Apache License 2.0 6 votes vote down vote up
@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("forServiceImpl");
    engine.setSourceFactory(new ClassPathSourceFactory());
    engine.addSharedMethod(new StrKit());
    engine.addSharedObject("getterTypeMap", getterTypeMap);
    engine.addSharedObject("javaKeyword", javaKeyword);

    for (TableMeta tableMeta : tableMetas) {
        genBaseModelContent(tableMeta);
    }
    writeToFile(tableMetas);
}
 
Example 2
Source File: JbootServiceInterfaceGenerator.java    From jboot with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example 3
Source File: EnjoyTemplateHandler.java    From myexcel with Apache License 2.0 6 votes vote down vote up
@Override
protected Engine getTemplateEngineSupplier(String dirPath) {
    synchronized (EnjoyTemplateHandler.class) {
        Engine engine = CFG_MAP.get(dirPath);
        if (engine != null) {
            return engine;
        }
        engine = Engine.create("myexcel_" + dirPath);
        Engine.setFastMode(true);
        if (Objects.equals(dirPath, CLASSPATH)) {
            engine.setBaseTemplatePath(null);
            engine.setToClassPathSourceFactory();
        } else {
            engine.setBaseTemplatePath(dirPath);
        }
        CFG_MAP.put(dirPath, engine);
        return engine;
    }
}
 
Example 4
Source File: ServiceApiGenerator.java    From jpress with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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);
}
 
Example 5
Source File: ServiceProviderGenerator.java    From jpress with GNU Lesser General Public License v3.0 6 votes vote down vote up
@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("forServiceImpl");
    engine.setSourceFactory(new ClassPathSourceFactory());
    engine.addSharedMethod(new StrKit());
    engine.addSharedObject("getterTypeMap", getterTypeMap);
    engine.addSharedObject("javaKeyword", javaKeyword);

    for (TableMeta tableMeta : tableMetas) {
        genBaseModelContent(tableMeta);
    }
    writeToFile(tableMetas);
}
 
Example 6
Source File: JbootServiceImplGenerator.java    From jboot with Apache License 2.0 5 votes vote down vote up
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);
}