当前位置: 首页>>代码示例>>Java>>正文


Java GStringTemplateEngine类代码示例

本文整理汇总了Java中groovy.text.GStringTemplateEngine的典型用法代码示例。如果您正苦于以下问题:Java GStringTemplateEngine类的具体用法?Java GStringTemplateEngine怎么用?Java GStringTemplateEngine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GStringTemplateEngine类属于groovy.text包,在下文中一共展示了GStringTemplateEngine类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: GroovyDocTemplateEngine

import groovy.text.GStringTemplateEngine; //导入依赖的package包/类
public GroovyDocTemplateEngine(GroovyDocTool tool, ResourceManager resourceManager,
                               String[] docTemplates,
                               String[] packageTemplates,
                               String[] classTemplates,
                               Properties properties) {
    this.resourceManager = resourceManager;
    this.properties = properties;
    this.docTemplatePaths = Arrays.asList(docTemplates);
    this.packageTemplatePaths = Arrays.asList(packageTemplates);
    this.classTemplatePaths = Arrays.asList(classTemplates);
    this.docTemplates = new LinkedHashMap<String, Template>();
    this.packageTemplates = new LinkedHashMap<String, Template>();
    this.classTemplates = new LinkedHashMap<String, Template>();
    engine = new GStringTemplateEngine();

}
 
开发者ID:apache,项目名称:groovy,代码行数:17,代码来源:GroovyDocTemplateEngine.java

示例2: generateScript

import groovy.text.GStringTemplateEngine; //导入依赖的package包/类
public static String generateScript(GroovyMap groovyMap, String templateName) throws GFacException {
    URL templateUrl = ApplicationSettings.loadFile(templateName);
    if (templateUrl == null) {
        String error = "Template file '" + templateName + "' not found";
        throw new GFacException(error);
    }
    File template = new File(templateUrl.getPath());
    TemplateEngine engine = new GStringTemplateEngine();
    Writable make;
    try {
        make = engine.createTemplate(template).make(groovyMap);
    } catch (Exception e) {
        throw new GFacException("Error while generating script using groovy map", e);
    }
    return make.toString();
}
 
开发者ID:apache,项目名称:airavata,代码行数:17,代码来源:GFacUtils.java

示例3: applySearchFormat

import groovy.text.GStringTemplateEngine; //导入依赖的package包/类
protected String applySearchFormat(String searchString, String format) {
    if (StringUtils.isNotEmpty(format)) {
        GStringTemplateEngine engine = new GStringTemplateEngine();
        StringWriter writer = new StringWriter();
        try {
            engine.createTemplate(format).make(ParamsMap.of("searchString", searchString)).writeTo(writer);
            return writer.toString();
        } catch (ClassNotFoundException | IOException e) {
            throw new IllegalStateException(e);
        }
    }
    return searchString;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:14,代码来源:SuggestionFieldQueryLoader.java

示例4: GroovyTemplateGenerator

import groovy.text.GStringTemplateEngine; //导入依赖的package包/类
public GroovyTemplateGenerator(final String template) {
    try {
        this.template = new GStringTemplateEngine().createTemplate(template);
    } catch (ClassNotFoundException | IOException e) {
        throw new BootException(e);
    }
    this.templateText = template;
}
 
开发者ID:sql-boot,项目名称:sql-boot,代码行数:9,代码来源:GroovyTemplateGenerator.java

示例5: parseCommands

import groovy.text.GStringTemplateEngine; //导入依赖的package包/类
static String parseCommands(String value, GroovyMap bindMap) {
    TemplateEngine templateEngine = new GStringTemplateEngine();
    try {
        return templateEngine.createTemplate(value).make(bindMap).toString();
    } catch (ClassNotFoundException | IOException e) {
        throw new IllegalArgumentException("Error while parsing command " + value
                + " , Invalid command or incomplete bind map");
    }
}
 
开发者ID:apache,项目名称:airavata,代码行数:10,代码来源:GFacUtils.java

示例6: getConfig

import groovy.text.GStringTemplateEngine; //导入依赖的package包/类
public Map getConfig() {
    GStringTemplateEngine engine = new GStringTemplateEngine();
    String yaml = null;

    try {
        yaml = engine.createTemplate(config).make(new MissingPropForwardingMap(envVars)).toString();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    return (Map) new Yaml().load(yaml);
}
 
开发者ID:groupon,项目名称:DotCi,代码行数:12,代码来源:GroovyYamlTemplateProcessor.java

示例7: template

import groovy.text.GStringTemplateEngine; //导入依赖的package包/类
public static String template(String name, Map<String, ?> model)
		throws IOException, CompilationFailedException, ClassNotFoundException {
	return template(new GStringTemplateEngine(), name, model);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:GroovyTemplate.java

示例8: groovyTemplateEngine

import groovy.text.GStringTemplateEngine; //导入依赖的package包/类
@Bean
public TemplateEngine groovyTemplateEngine() {
	return new GStringTemplateEngine();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:SpringBootHypermediaApplication.java

示例9: initialize

import groovy.text.GStringTemplateEngine; //导入依赖的package包/类
@Override
public void initialize(VisitorContext context, Object rootNode) {
	this.context = context;
	engine = new GStringTemplateEngine(context.getClassLoader());
	super.initialize(context, rootNode);
}
 
开发者ID:walkmod,项目名称:walkmod-javalang-plugin,代码行数:7,代码来源:GroovyTemplateEngine.java

示例10: GroovyTemplateTestResource

import groovy.text.GStringTemplateEngine; //导入依赖的package包/类
public GroovyTemplateTestResource(TestResource<String> template, Map<String, String> variables) {
    this(new GStringTemplateEngine(), template, variables);
}
 
开发者ID:uoa-group-applications,项目名称:morc,代码行数:4,代码来源:GroovyTemplateTestResource.java

示例11: groovy

import groovy.text.GStringTemplateEngine; //导入依赖的package包/类
/**
 * A way of paramaterizing resources so that values are updated according to Groovy GStrings
 *
 * @param template   A template of the string resource containing GString variables for substitution
 * @param dataSource A list of name=value pairs that will be used for var substitution. Each entry in the
 *                   list will result in another resource being returned
 */
default GroovyTemplateTestResource[] groovy(TestResource<String> template, List<Map<String, String>> dataSource) {
    return groovy(template, dataSource, GStringTemplateEngine.class);
}
 
开发者ID:uoa-group-applications,项目名称:morc,代码行数:11,代码来源:MorcMethods.java


注:本文中的groovy.text.GStringTemplateEngine类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。