本文整理汇总了Java中jetbrick.template.JetEngine类的典型用法代码示例。如果您正苦于以下问题:Java JetEngine类的具体用法?Java JetEngine怎么用?Java JetEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JetEngine类属于jetbrick.template包,在下文中一共展示了JetEngine类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import jetbrick.template.JetEngine; //导入依赖的package包/类
private void init()
{
Properties properties = new Properties();
String templatePath = _config.get("view.jade.templates",
"classpath:/templates");
if (templatePath.startsWith("classpath:")) {
String root = templatePath.substring("classpath:".length());
properties.put("jetx.template.loaders", "jetbrick.template.loader.ClasspathResourceLoader");
properties.put("jetbrick.template.loader.ClasspathResourceLoader.root", root);
}
else {
}
_engine = JetEngine.create(properties);
}
开发者ID:baratine,项目名称:baratine,代码行数:19,代码来源:ViewJetbrick.java
示例2: JetTemplateCodeVisitor
import jetbrick.template.JetEngine; //导入依赖的package包/类
public JetTemplateCodeVisitor(JetEngine engine, VariableResolver resolver, JetSecurityManager securityManager, JetTemplateParser parser, Resource resource) {
this.engine = engine;
this.parser = parser;
this.resolver = resolver;
this.securityManager = securityManager;
this.resource = resource;
this.globalSafeCall = engine.getConfig().isSyntaxSafecall();
this.trimDirectiveLine = engine.getConfig().isTrimDirectiveLine();
this.trimDirectiveComments = engine.getConfig().isTrimDirectiveComments();
this.commentsPrefix = engine.getConfig().getTrimDirectiveCommentsPrefix();
this.commentsSuffix = engine.getConfig().getTrimDirectiveCommentsSuffix();
this.textCache = new HashMap<String, TextCode>(32);
this.forStack = new ArrayDeque<String>(8);
// 专门处理是否存在未完成的解析 (1.2.8 在 parser.g4 中添加 EOF,此处代码已经无用)
//Token token = parser.getCurrentToken();
//if (token.getType() != Token.EOF) {
// throw reportError("Invalid " + token.getText() + " directive in here.", token);
//}
}
开发者ID:subchen,项目名称:jetbrick-template-1x,代码行数:22,代码来源:JetTemplateCodeVisitor.java
示例3: initialize
import jetbrick.template.JetEngine; //导入依赖的package包/类
@Override
public void initialize(JetEngine engine, String basepath, String encoding) {
basepath = PathUtils.getStandardizedTemplateRoot(basepath, true);
int separator = basepath.indexOf(JarResource.JAR_FILE_SEPARATOR);
if (separator > 0) {
this.jarFile = new File(basepath.substring(0, separator));
this.entryName = basepath.substring(separator + JarResource.JAR_FILE_SEPARATOR.length());
} else {
this.jarFile = new File(basepath);
this.entryName = "";
}
this.jarFile = PathUtils.getCanonicalFile(this.jarFile);
this.entryName = PathUtils.getStandardizedTemplateRoot(this.entryName, false);
this.suffix = engine.getConfig().getTemplateSuffix();
this.encoding = encoding;
}
开发者ID:subchen,项目名称:jetbrick-template-1x,代码行数:18,代码来源:JarResourceLoader.java
示例4: getInternalEngine
import jetbrick.template.JetEngine; //导入依赖的package包/类
protected JetEngine getInternalEngine() throws IOException{
Properties ps = new Properties();
ConfigLoader loader = new ConfigLoader();
try {
LOG.info("Loading config file: {}", JetConfig.DEFAULT_CONFIG_FILE);
loader.load(JetConfig.DEFAULT_CONFIG_FILE);
ps = loader.asProperties();
} catch (Exception e) {
// 默认配置文件不存在
LOG.warn("No default config file found: {}", JetConfig.DEFAULT_CONFIG_FILE);
ps = ConfigUtils.filterWithPrefix("docx4j.jetx.", "docx4j.", Docx4jProperties.getProperties(), true);
}
return JetEngine.create(ps);
}
开发者ID:vindell,项目名称:docx4j-template,代码行数:15,代码来源:WordprocessingMLJetbrickTemplate.java
示例5: JetbrickTemplateEngine
import jetbrick.template.JetEngine; //导入依赖的package包/类
/**
* Constructs a JetBrick template engine.
*
* @param jetEngine the JetEngine
*/
public JetbrickTemplateEngine(JetEngine jetEngine) {
if (null == jetEngine) {
throw new IllegalArgumentException("jetEngine must not be null");
}
this.jetEngine = jetEngine;
}
开发者ID:perwendel,项目名称:spark-template-engines,代码行数:12,代码来源:JetbrickTemplateEngine.java
示例6: initialize
import jetbrick.template.JetEngine; //导入依赖的package包/类
@Override
public void initialize(JetEngine engine, String basepath, String encoding) {
this.servletContext = ((JetWebEngine) engine).getServletContext();
this.basepath = PathUtils.getStandardizedTemplateRoot(basepath, false);
this.suffix = engine.getConfig().getTemplateSuffix();
this.encoding = encoding;
}
开发者ID:subchen,项目名称:jetbrick-template-1x,代码行数:8,代码来源:WebResourceLoader.java
示例7: initialize
import jetbrick.template.JetEngine; //导入依赖的package包/类
@Override
public void initialize(JetEngine engine, String basepath, String encoding) {
List<ResourceLoader> loaders = new ArrayList<ResourceLoader>();
String[] paths = basepath.split(",");
for (String path : paths) {
ResourceLoader loader;
int pos = path.indexOf(':');
if (pos >= 0) {
String klassAlias = path.substring(0, pos).trim();
path = path.substring(pos + 1).trim();
if ("file".equals(klassAlias)) {
loader = new FileSystemResourceLoader();
} else if ("classpath".equals(klassAlias)) {
loader = new ClasspathResourceLoader();
} else if ("jar".equals(klassAlias)) {
loader = new JarResourceLoader();
} else if ("webapp".equals(klassAlias)) {
loader = new WebResourceLoader();
} else {
// 可能是用户自定义的 ResourceLoader
try {
Class<?> klass = ClassLoaderUtils.loadClass(klassAlias);
loader = (ResourceLoader) klass.newInstance();
} catch (Throwable e) {
throw ExceptionUtils.uncheck(e);
}
}
} else {
path = path.trim();
loader = new FileSystemResourceLoader();
}
loader.initialize(engine, path, encoding);
loaders.add(loader);
}
this.loaders = loaders.toArray(new ResourceLoader[loaders.size()]);
}
开发者ID:subchen,项目名称:jetbrick-template-1x,代码行数:41,代码来源:MultipathResourceLoader.java
示例8: main
import jetbrick.template.JetEngine; //导入依赖的package包/类
public static void main(String[] args) {
Properties config = new Properties();
//config.put(JetConfig.COMPILE_TOOL, JdtCompiler.class.getName());
JetEngine engine = JetEngine.create(config);
JetTemplate template = engine.createTemplate("是否登录");
StringWriter out = new StringWriter();
template.render(new HashMap<String, Object>(), out);
System.out.println(out.toString());
}
开发者ID:subchen,项目名称:jetbrick-template-1x,代码行数:11,代码来源:EncodingTestCase.java
示例9: JetbrickEngine
import jetbrick.template.JetEngine; //导入依赖的package包/类
public JetbrickEngine(Map<String, Object> model) throws IOException {
super(model);
Properties props = new Properties();
props.setProperty(JetConfig.TEMPLATE_PATH, UtilIO.getResource("jt").getPath());
props.setProperty(JetConfig.COMPILE_DEBUG, "false");
engine = JetEngine.create(props);
}
开发者ID:takeseem-com,项目名称:test-template,代码行数:8,代码来源:JetbrickEngine.java
示例10: init
import jetbrick.template.JetEngine; //导入依赖的package包/类
@Override
public final void init(Properties properties) throws Exception {
templateUrl = "/templates/jetx.html";
Properties prop = new Properties();
prop.setProperty(JetConfig.COMPILE_DEBUG, "false");
prop.setProperty(JetConfig.INPUT_ENCODING, properties.getProperty("inputEncoding", "UTF-8"));
prop.setProperty(JetConfig.OUTPUT_ENCODING, properties.getProperty("outputEncoding", "UTF-8"));
engine = JetEngine.create(prop);
}
开发者ID:boilit,项目名称:ebm,代码行数:11,代码来源:JetbrickTemplate.java
示例11: getEngine
import jetbrick.template.JetEngine; //导入依赖的package包/类
public JetEngine getEngine() throws IOException {
return engine == null ? getInternalEngine() : engine;
}
开发者ID:vindell,项目名称:docx4j-template,代码行数:4,代码来源:WordprocessingMLJetbrickTemplate.java
示例12: setEngine
import jetbrick.template.JetEngine; //导入依赖的package包/类
public void setEngine(JetEngine engine) {
this.engine = engine;
}
开发者ID:vindell,项目名称:docx4j-template,代码行数:4,代码来源:WordprocessingMLJetbrickTemplate.java
示例13: getEngine
import jetbrick.template.JetEngine; //导入依赖的package包/类
public JetEngine getEngine() {
return engine;
}
开发者ID:Teddy-Zhu,项目名称:SilentGo,代码行数:4,代码来源:JetTemplateRender.java
示例14: getJetEngine
import jetbrick.template.JetEngine; //导入依赖的package包/类
public static JetEngine getJetEngine() {
if (engine == null) {
throw new IllegalStateException("Please add JetWebEngineLoader as listener into web.xml");
}
return engine;
}
开发者ID:subchen,项目名称:jetbrick-template-1x,代码行数:7,代码来源:JetWebEngineLoader.java
示例15: initialize
import jetbrick.template.JetEngine; //导入依赖的package包/类
@Override
public void initialize(JetEngine engine, String basepath, String encoding) {
}
开发者ID:subchen,项目名称:jetbrick-template-1x,代码行数:4,代码来源:CompiledClassResourceLoader.java
示例16: initialize
import jetbrick.template.JetEngine; //导入依赖的package包/类
@Override
public void initialize(JetEngine engine, String basepath, String encoding) {
this.basepath = PathUtils.getStandardizedTemplateRoot(basepath, true);
this.encoding = encoding;
this.suffix = engine.getConfig().getTemplateSuffix();
}
开发者ID:subchen,项目名称:jetbrick-template-1x,代码行数:7,代码来源:FileSystemResourceLoader.java
示例17: initialize
import jetbrick.template.JetEngine; //导入依赖的package包/类
@Override
public void initialize(JetEngine engine, String basepath, String encoding) {
this.basepath = PathUtils.getStandardizedTemplateRoot(basepath, false);
this.encoding = encoding;
this.suffix = engine.getConfig().getTemplateSuffix();
}
开发者ID:subchen,项目名称:jetbrick-template-1x,代码行数:7,代码来源:ClasspathResourceLoader.java
示例18: initialize
import jetbrick.template.JetEngine; //导入依赖的package包/类
/**
* 初始化 ResourceLoader.
*
* @param engine 模板引擎
* @param basepath 模板根路径
* @param encoding 模板默认输入编码
*/
public void initialize(JetEngine engine, String basepath, String encoding);
开发者ID:subchen,项目名称:jetbrick-template-1x,代码行数:9,代码来源:ResourceLoader.java
注:本文中的jetbrick.template.JetEngine类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论