本文整理汇总了Java中de.neuland.jade4j.template.TemplateLoader类的典型用法代码示例。如果您正苦于以下问题:Java TemplateLoader类的具体用法?Java TemplateLoader怎么用?Java TemplateLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TemplateLoader类属于de.neuland.jade4j.template包,在下文中一共展示了TemplateLoader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JadeTemplateEngine
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
public JadeTemplateEngine(final CompositeConfiguration config, final ContentStore db, final File destination, final File templatesPath) {
super(config, db, destination, templatesPath);
TemplateLoader loader = new FileTemplateLoader(templatesPath.getAbsolutePath() + File.separatorChar, config.getString(Keys.TEMPLATE_ENCODING));
jadeConfiguration.setTemplateLoader(loader);
jadeConfiguration.setMode(Jade4J.Mode.XHTML);
jadeConfiguration.setPrettyPrint(true);
jadeConfiguration.setFilter(FILTER_CDATA, new CDATAFilter());
jadeConfiguration.setFilter(FILTER_SCRIPT, new JsFilter());
jadeConfiguration.setFilter(FILTER_STYLE, new CssFilter());
jadeConfiguration.getSharedVariables().put("formatter", new FormatHelper());
}
示例2: Parser
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
public Parser(String filename, TemplateLoader templateLoader,ExpressionHandler expressionHandler) throws IOException {
this.filename = filename;
this.templateLoader = templateLoader;
this.expressionHandler = expressionHandler;
lexer = new Lexer(filename, templateLoader,expressionHandler);
characterParser = new CharacterParser();
getContexts().push(this);
}
示例3: createTemplate
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
private static JadeTemplate createTemplate(String filename, TemplateLoader loader, ExpressionHandler expressionHandler) throws IOException {
Parser parser = new Parser(filename, loader,expressionHandler);
Node root = parser.parse();
JadeTemplate template = new JadeTemplate();
template.setExpressionHandler(expressionHandler);
template.setTemplateLoader(loader);
template.setRootNode(root);
return template;
}
示例4: Lexer
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
public Lexer(String filename, TemplateLoader templateLoader,ExpressionHandler expressionHandler) throws IOException {
this.expressionHandler = expressionHandler;
this.filename = ensureJadeExtension(filename);
this.templateLoader = templateLoader;
Reader reader = templateLoader.getReader(this.filename);
options = new LinkedList<String>();
scanner = new Scanner(reader);
deferredTokens = new LinkedList<Token>();
stash = new LinkedList<Token>();
indentStack = new LinkedList<Integer>();
lastIndents = 0;
lineno = 1;
characterParser = new CharacterParser();
}
示例5: jadeConfiguration
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(JadeConfiguration.class)
public JadeConfiguration jadeConfiguration(TemplateLoader jadeTemplateLoader) {
JadeConfiguration configuration = new JadeConfiguration();
configuration.setCaching(false); //Cache is handled by spring
configuration.setPrettyPrint(properties.isPrettyPrint());
configuration.setTemplateLoader(jadeTemplateLoader);
//configuration.setSharedVariables(sharedVariables);
//configuration.setFilter(name, filter);
//configuration.setMode(mode);
return configuration;
}
示例6: jadeTemplateLoader
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(TemplateLoader.class)
public TemplateLoader jadeTemplateLoader() {
JadeResourceTemplateLoader loader = new JadeResourceTemplateLoader(properties.getPrefix(), properties.getSuffix());
loader.setCharSet(properties.getCharSet());
return loader;
}
示例7: jadeConfiguration
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
@Bean
public JadeConfiguration jadeConfiguration(TemplateLoader jadeTemplateLoader) {
JadeConfiguration configuration = new JadeConfiguration();
configuration.setCaching(false);
configuration.setPrettyPrint(true);
configuration.setTemplateLoader(jadeTemplateLoader);
return configuration;
}
示例8: JadeParserException
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public JadeParserException(String filename, int lineNumber, TemplateLoader templateLoader, Class expected, Class got) {
super("expected " + expected + " but got " + got, filename, lineNumber, templateLoader, null);
}
示例9: JadeCompilerException
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
public JadeCompilerException(Node node, TemplateLoader templateLoader, Throwable e) {
super(e.getMessage(), node.getFileName(), node.getLineNumber(), templateLoader, e);
}
示例10: JadeException
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
public JadeException(String message, String filename, int lineNumber, TemplateLoader templateLoader, Throwable e) {
super(message, e);
this.filename = filename;
this.lineNumber = lineNumber;
this.templateLoader = templateLoader;
}
示例11: JadeLexerException
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
public JadeLexerException(String message, String filename, int lineNumber, TemplateLoader templateLoader) {
super(message, filename, lineNumber, templateLoader, null);
}
示例12: getTemplateLoader
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
public TemplateLoader getTemplateLoader() {
return templateLoader;
}
示例13: setTemplateLoader
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
public void setTemplateLoader(TemplateLoader templateLoader) {
this.templateLoader = templateLoader;
}
示例14: JadeEngine
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
public JadeEngine() throws IOException {
this.configuration = new JadeConfiguration();
this.directory = this.directory + "/src/main/resources/templates/";
TemplateLoader loader = new FileTemplateLoader(directory, "UTF-8");
configuration.setTemplateLoader(loader);
}
示例15: jadeTemplateLoader
import de.neuland.jade4j.template.TemplateLoader; //导入依赖的package包/类
@Bean
public TemplateLoader jadeTemplateLoader() {
JadeResourceTemplateLoader loader = new JadeResourceTemplateLoader("classpath:/templates/", ".jade");
loader.setCharSet("utf-8");
return loader;
}