本文整理汇总了Java中com.mitchellbosecke.pebble.extension.Filter类的典型用法代码示例。如果您正苦于以下问题:Java Filter类的具体用法?Java Filter怎么用?Java Filter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Filter类属于com.mitchellbosecke.pebble.extension包,在下文中一共展示了Filter类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getFilters
import com.mitchellbosecke.pebble.extension.Filter; //导入依赖的package包/类
@Override
public Map<String, Filter> getFilters() {
Map<String, Filter> filters = new HashMap<>();
filters.put("noArgumentsButCanAccessContext", new Filter() {
@Override
public List<String> getArgumentNames() {
return null;
}
@Override
public String apply(Object input, Map<String, Object> args, PebbleTemplate self, EvaluationContext context, int lineNumber) {
if (context != null && self != null) {
return "success";
} else {
return "failure";
}
}
});
return filters;
}
开发者ID:flapdoodle-oss,项目名称:de.flapdoodle.solid,代码行数:25,代码来源:ExtendingPebbleTest.java
示例2: getFilters
import com.mitchellbosecke.pebble.extension.Filter; //导入依赖的package包/类
@Override
public Map<String, Filter> getFilters() {
Map<String, Filter> filters = new HashMap<>();
filters.put("noArgumentsButCanAccessContext", new Filter() {
@Override
public List<String> getArgumentNames() {
return null;
}
@Override
public String apply(Object input, Map<String, Object> args) {
EvaluationContext context = (EvaluationContext) args.get("_context");
PebbleTemplateImpl pebbleTemplate = (PebbleTemplateImpl) args.get("_self");
if (context != null && pebbleTemplate != null) {
return "success";
} else {
return "failure";
}
}
});
return filters;
}
开发者ID:LionelWoody,项目名称:spring-boot-starter-pebble,代码行数:26,代码来源:CustomPebbleExtension.java
示例3: getFilters
import com.mitchellbosecke.pebble.extension.Filter; //导入依赖的package包/类
@Override
public Map<String, Filter> getFilters() {
Map<String, Filter> filters = new HashMap<>();
filters.put("escape", filter);
filters.put("raw", new RawFilter());
return filters;
}
开发者ID:flapdoodle-oss,项目名称:de.flapdoodle.solid,代码行数:8,代码来源:EscaperExtension.java
示例4: getFilters
import com.mitchellbosecke.pebble.extension.Filter; //导入依赖的package包/类
@Override
public Map<String, Filter> getFilters() {
Map<String, Filter> map = new HashMap<>();
map.put("myUpper", new MyUpperFilter());
return map;
}
开发者ID:jjfidalgo,项目名称:ninja-pebble,代码行数:9,代码来源:CustomExtension.java
示例5: getFilters
import com.mitchellbosecke.pebble.extension.Filter; //导入依赖的package包/类
@Override
public Map<String, Filter> getFilters() {
Map<String, Filter> filterMap = new HashMap<>();
for (TemplateFunction function : templateFunctions) {
filterMap.put(function.getName(), new PebbleWrapperTemplateFilter(
contextProvider,
function.getName(),
Arrays.asList(function.parameters()),
function.getClass()));
}
return filterMap;
}
开发者ID:JavaEden,项目名称:Orchid,代码行数:15,代码来源:PebbleFunctionsExtension.java
示例6: getFilters
import com.mitchellbosecke.pebble.extension.Filter; //导入依赖的package包/类
@Override
public Map<String, Filter> getFilters() {
Map<String, Filter> map = new HashMap<String, Filter>();
map.put("formatDate", new DateTimeFormaterFilter());
map.put("title", new TitleFilter());
map.put("head", new IterableHeadFilter());
map.put("tail", new IterableTailFilter());
map.put("length", new LengthFilter());
map.put("reverse", new ReverseFilter());
return ImmutableMap.copyOf(map);
}
开发者ID:FenixEdu,项目名称:fenixedu-cms,代码行数:12,代码来源:CMSExtensions.java
示例7: getFilters
import com.mitchellbosecke.pebble.extension.Filter; //导入依赖的package包/类
@Override
public Map<String, Filter> getFilters() {
Map<String, Filter> f = new HashMap<>();
f.put(TestFilter.FILTER_NAME, new TestFilter());
return f;
}
开发者ID:flapdoodle-oss,项目名称:de.flapdoodle.solid,代码行数:7,代码来源:PebbleExtension.java
示例8: getFilters
import com.mitchellbosecke.pebble.extension.Filter; //导入依赖的package包/类
@Override
public Map<String, Filter> getFilters() {
return Collections.EMPTY_MAP;
}
开发者ID:mvc-spec,项目名称:ozark,代码行数:5,代码来源:CustomExtensionTwo.java
示例9: getFilters
import com.mitchellbosecke.pebble.extension.Filter; //导入依赖的package包/类
@Override
public Map<String, Filter> getFilters() {
return null;
}
开发者ID:JavaEden,项目名称:Orchid,代码行数:5,代码来源:AbstractPebbleExtension.java
示例10: getFilters
import com.mitchellbosecke.pebble.extension.Filter; //导入依赖的package包/类
@Override
public Map<String, Filter> getFilters() {
return Collections.emptyMap();
}
开发者ID:hectorlf,项目名称:pebble-shiro-extension,代码行数:5,代码来源:ShiroExtension.java
示例11: getFilters
import com.mitchellbosecke.pebble.extension.Filter; //导入依赖的package包/类
@Override
public Map<String, Filter> getFilters() {
Map<String, Filter> filters = new HashMap<>();
filters.put("formatTime", new FormatTimeFilter());
return filters;
}
开发者ID:decebals,项目名称:pippo,代码行数:7,代码来源:FormatTimeExtension.java
示例12: getFilters
import com.mitchellbosecke.pebble.extension.Filter; //导入依赖的package包/类
@Override
public Map<String, Filter> getFilters() {
Map<String, Filter> filters = new HashMap<>();
filters.put("prettyTime", new PrettyTimeFilter());
return filters;
}
开发者ID:decebals,项目名称:pippo,代码行数:7,代码来源:PrettyTimeExtension.java
注:本文中的com.mitchellbosecke.pebble.extension.Filter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论