本文整理汇总了Java中org.stringtemplate.v4.STGroupFile.setListener方法的典型用法代码示例。如果您正苦于以下问题:Java STGroupFile.setListener方法的具体用法?Java STGroupFile.setListener怎么用?Java STGroupFile.setListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.stringtemplate.v4.STGroupFile
的用法示例。
在下文中一共展示了STGroupFile.setListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: retrieveUncachedGroup
import org.stringtemplate.v4.STGroupFile; //导入方法依赖的package包/类
/**
* Retrieves the string template group.
* @param path the path.
* @param lookupPaths the lookup paths.
* @param errorListener the {@link STErrorListener} instance.
* @param charset the charset.
* @return such instance.
*/
@NotNull
protected STGroup retrieveUncachedGroup(
@NotNull final String path,
@NotNull final List<String> lookupPaths,
@NotNull final STErrorListener errorListener,
@NotNull final Charset charset)
{
@NotNull final STGroupFile result = new STGroupFile(path, charset.displayName());
// STGroup.verbose = true;
// result.importTemplates(new STGroupDir("org/acmsl/queryj/dao", charset.displayName()));
// result.importTemplates(new STGroupDir("org/acmsl/queryj/vo", charset.displayName()));
for (@Nullable final String lookupPath : lookupPaths)
{
if (lookupPath != null)
{
result.importTemplates(new STGroupDir(lookupPath, charset.displayName()));
}
}
result.isDefined(Literals.SOURCE);
result.setListener(errorListener);
// STGroup.registerGroupLoader(loader);
// STroup.registerDefaultLexer(AngleBracketTemplateLexer.class);
// result = STGroup.loadGroup(path);
return result;
}
示例2: createTemplate
import org.stringtemplate.v4.STGroupFile; //导入方法依赖的package包/类
public static STGroupFile createTemplate(String fname) {
String path = Util.findConfigFileLocation(fname);
if (path == null) {
path = Util.tb_resource + "/" + fname;
}
STGroupFile templates = new STGroupFile(path);
templates.setListener(listener);
return templates;
}
示例3: getPerVmConfigDefs
import org.stringtemplate.v4.STGroupFile; //导入方法依赖的package包/类
public String getPerVmConfigDefs() {
String result = "";
String configFileName =
Util.getStringValueOpt(m.getProcessorImpl(), VM_CONFIG_FILE);
ST st;
if (configFileName != null) {
File aadlDirectory = Util.getDirectory(m.getProcessorImpl());
File srcFilePath = new File(aadlDirectory, configFileName);
STGroupFile templates = new STGroupFile(srcFilePath.getAbsolutePath());
templates.setListener(Util.getListener());
st = templates.getInstanceOf("VmConfig");
if (st == null) {
throw new TbException("Error: Vm configuration file: " + srcFilePath + " not found, or does not contain a template named 'VmConfig'");
}
} else {
st = Util.createTemplate("CamkesVmConfig.stg").getInstanceOf("VmConfig");
}
st.add("model", this);
result += st.render();
for (PortListEmitterCamkesVM pe: EmitterListRegistry.getVMPortListEmitters()) {
result += pe.getCamkesAddAssemblyFileVMConfigDeclarations(m, m.getVmCrossingPorts());
}
return result;
}
示例4: createTemplateInternal
import org.stringtemplate.v4.STGroupFile; //导入方法依赖的package包/类
protected STGroupFile createTemplateInternal(String fname) {
String path = Util.findConfigFileLocation(fname);
if (path == null) {
path = Util.tb_resource + "/" + fname;
}
STGroupFile templates = new STGroupFile(path);
templates.setListener(listener);
return templates;
}