本文整理汇总了Java中com.google.template.soy.parseinfo.SoyFileInfo类的典型用法代码示例。如果您正苦于以下问题:Java SoyFileInfo类的具体用法?Java SoyFileInfo怎么用?Java SoyFileInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SoyFileInfo类属于com.google.template.soy.parseinfo包,在下文中一共展示了SoyFileInfo类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTofuSupplier
import com.google.template.soy.parseinfo.SoyFileInfo; //导入依赖的package包/类
/** Returns a memoized supplier containing compiled tofu. */
public static Supplier<SoyTofu> createTofuSupplier(final SoyFileInfo... soyInfos) {
return memoize(
() -> {
ConsoleDebug debugMode = ConsoleDebug.get();
SoyFileSet.Builder builder = SoyFileSet.builder();
for (SoyFileInfo soyInfo : soyInfos) {
builder.add(getResource(soyInfo.getClass(), soyInfo.getFileName()));
}
Map<String, Object> globals = new HashMap<>();
try {
globals.putAll(SoyUtils.parseCompileTimeGlobals(asCharSource(SOY_GLOBALS, UTF_8)));
} catch (SoySyntaxException | IOException e) {
throw new RuntimeException("Failed to load soy globals", e);
}
globals.put("DEBUG", debugMode.ordinal());
builder.setCompileTimeGlobals(globals);
return builder.build().compileToTofu();
});
}
示例2: setSoyTemplate
import com.google.template.soy.parseinfo.SoyFileInfo; //导入依赖的package包/类
protected void setSoyTemplate(SoyFileInfo soyFileInfo, SoyTemplateInfo soyRenderer) {
this.soyFileInfo = soyFileInfo;
this.soyRenderer = soyRenderer;
}