本文整理汇总了Java中com.mitchellbosecke.pebble.extension.Extension类的典型用法代码示例。如果您正苦于以下问题:Java Extension类的具体用法?Java Extension怎么用?Java Extension使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Extension类属于com.mitchellbosecke.pebble.extension包,在下文中一共展示了Extension类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: pebbleEngine
import com.mitchellbosecke.pebble.extension.Extension; //导入依赖的package包/类
@Bean
public PebbleEngine pebbleEngine() {
PebbleEngine.Builder builder = new PebbleEngine.Builder();
builder.loader(this.pebbleLoader);
builder.extension(this.pebbleSpringExtension());
if (this.extensions != null && !this.extensions.isEmpty()) {
builder.extension(this.extensions.toArray(new Extension[this.extensions.size()]));
}
if (!this.properties.isCache()) {
builder.cacheActive(false);
}
if (this.properties.getDefaultLocale() != null) {
builder.defaultLocale(this.properties.getDefaultLocale());
}
builder.strictVariables(this.properties.isStrictVariables());
return builder.build();
}
开发者ID:PebbleTemplates,项目名称:pebble-spring-boot-starter,代码行数:18,代码来源:PebbleAutoConfiguration.java
示例2: getPebbleEngine
import com.mitchellbosecke.pebble.extension.Extension; //导入依赖的package包/类
public PebbleEngine getPebbleEngine() {
final PebbleEngine.Builder builder = new PebbleEngine.Builder()
.loader(this.loader)
.extension(extensions.toArray(new Extension[extensions.size()]));
if (cache) {
builder.templateCache(CacheBuilder.newBuilder().maximumSize(cacheSize).build())
.tagCache(CacheBuilder.newBuilder().maximumSize(cacheSize).build());
} else {
builder.templateCache(CacheBuilder.newBuilder().maximumSize(0).build())
.tagCache(CacheBuilder.newBuilder().maximumSize(0).build());
}
log.debug("PebbleEngine built! 这里不写几个汉字不显眼!!!");
return builder.build();
}
开发者ID:LionelWoody,项目名称:spring-boot-starter-pebble,代码行数:18,代码来源:PebbleEngineConfigurer.java
示例3: asExtension
import com.mitchellbosecke.pebble.extension.Extension; //导入依赖的package包/类
public Extension asExtension() {
return new AbstractExtension() {
@Override
public List<AttributeResolver> getAttributeResolver() {
return ImmutableList.of(CustomPebbleAttributeResolver.this);
}
};
}
开发者ID:flapdoodle-oss,项目名称:de.flapdoodle.solid,代码行数:9,代码来源:CustomPebbleAttributeResolver.java
示例4: PebbleEngine
import com.mitchellbosecke.pebble.extension.Extension; //导入依赖的package包/类
/**
* Constructor for the Pebble Engine given an instantiated Loader. This
* method does only load those userProvidedExtensions listed here.
*
* @param loader The template loader for this engine
* @param syntax the syntax to use for parsing the templates.
* @param extensions The userProvidedExtensions which should be loaded.
*/
private PebbleEngine(Loader<?> loader, Syntax syntax, boolean strictVariables, Locale defaultLocale,
Cache<BaseTagCacheKey, Object> tagCache, Cache<Object, PebbleTemplate> templateCache,
ExecutorService executorService, Collection<? extends Extension> extensions) {
this.loader = loader;
this.syntax = syntax;
this.strictVariables = strictVariables;
this.defaultLocale = defaultLocale;
this.tagCache = tagCache;
this.executorService = executorService;
this.templateCache = templateCache;
this.extensionRegistry = new ExtensionRegistry(extensions);
}
开发者ID:flapdoodle-oss,项目名称:de.flapdoodle.solid,代码行数:22,代码来源:PebbleEngine.java
示例5: configure
import com.mitchellbosecke.pebble.extension.Extension; //导入依赖的package包/类
@Override
protected void configure() {
// Pebble Extensions
addToSet(Extension.class,
PebbleFunctionsExtension.class,
PebbleTagsExtension.class);
addToSet(OrchidEventListener.class,
PebbleCompiler.class);
}
开发者ID:JavaEden,项目名称:Orchid,代码行数:11,代码来源:PebbleModule.java
示例6: PebbleCompiler
import com.mitchellbosecke.pebble.extension.Extension; //导入依赖的package包/类
@Inject
public PebbleCompiler(Provider<OrchidContext> contextProvider, PebbleTemplateLoader loader, Set<Extension> extensions) {
super(10000);
Extension[] extensionArray = new Extension[extensions.size()];
extensions.toArray(extensionArray);
this.contextProvider = contextProvider;
this.executor = Executors.newFixedThreadPool(10);
this.engine = new PebbleEngine.Builder()
.loader(loader)
.executorService(executor)
.extension(extensionArray)
.build();
}
开发者ID:JavaEden,项目名称:Orchid,代码行数:16,代码来源:PebbleCompiler.java
示例7: PebbleEngineProvider
import com.mitchellbosecke.pebble.extension.Extension; //导入依赖的package包/类
public PebbleEngineProvider(Extension... extensions) {
this.extensions = extensions;
}
开发者ID:jjfidalgo,项目名称:ninja-pebble,代码行数:4,代码来源:PebbleEngineProvider.java
示例8: NinjaPebbleModule
import com.mitchellbosecke.pebble.extension.Extension; //导入依赖的package包/类
public NinjaPebbleModule(Extension... extensions) {
this.extensions = extensions;
}
开发者ID:jjfidalgo,项目名称:ninja-pebble,代码行数:4,代码来源:NinjaPebbleModule.java
示例9: testExtension
import com.mitchellbosecke.pebble.extension.Extension; //导入依赖的package包/类
@Bean
public Extension testExtension() {
return new TestExtension();
}
开发者ID:PebbleTemplates,项目名称:pebble-spring-boot-starter,代码行数:5,代码来源:Application.java
示例10: registerExtension
import com.mitchellbosecke.pebble.extension.Extension; //导入依赖的package包/类
public void registerExtension(final Object extension) {
if (extension instanceof Extension) {
this.extensions.add((Extension) extension);
}
}
开发者ID:LionelWoody,项目名称:spring-boot-starter-pebble,代码行数:6,代码来源:PebbleEngineConfigurer.java
注:本文中的com.mitchellbosecke.pebble.extension.Extension类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论