当前位置: 首页>>代码示例>>Java>>正文


Java IElementTagStructureHandler.setBody方法代码示例

本文整理汇总了Java中org.thymeleaf.processor.element.IElementTagStructureHandler.setBody方法的典型用法代码示例。如果您正苦于以下问题:Java IElementTagStructureHandler.setBody方法的具体用法?Java IElementTagStructureHandler.setBody怎么用?Java IElementTagStructureHandler.setBody使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.thymeleaf.processor.element.IElementTagStructureHandler的用法示例。


在下文中一共展示了IElementTagStructureHandler.setBody方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doProcess

import org.thymeleaf.processor.element.IElementTagStructureHandler; //导入方法依赖的package包/类
@Override
protected void doProcess(ITemplateContext context, IProcessableElementTag tag, AttributeName attributeName,
        String attributeValue, IElementTagStructureHandler structureHandler) {

    // Compose message with parameters:
    // {0} first reg. position
    // {1} latest page reg. position
    // {2} total elements
    // pagination.summary=Showing {0} to {1} of {2} entries

    Locale locale = context.getLocale();
    Page<?> page = PageUtils.findPage(context);
    int firstItem = PageUtils.getFirstItemInPage(page);
    int latestItem = PageUtils.getLatestItemInPage(page);
    int totalElements = (int) page.getTotalElements();
    boolean isEmpty = page.getTotalElements() == 0;

    String attrValue = String.valueOf(attributeValue).trim();
    String messageTemplate = COMPACT.equals(attrValue) ? COMPACT_MESSAGE_KEY : DEFAULT_MESSAGE_KEY;
    String messageKey = isEmpty ? NO_VALUES_MESSAGE_KEY : messageTemplate;
    String message = Messages.getMessage(BUNDLE_NAME, messageKey, locale, firstItem, latestItem, totalElements);

    structureHandler.setBody(message, false);
}
 
开发者ID:jpenren,项目名称:thymeleaf-spring-data-dialect,代码行数:25,代码来源:PaginationSummaryAttrProcessor.java

示例2: doProcess

import org.thymeleaf.processor.element.IElementTagStructureHandler; //导入方法依赖的package包/类
@Override
protected void doProcess(ITemplateContext context, IProcessableElementTag tag, AttributeName attributeName,
        String attributeValue, IElementTagStructureHandler structureHandler) {

    Locale locale = context.getLocale();
    loadSelectorValues(locale);
    String selectorStyle = String.valueOf(attributeValue).trim();
    String messageKey = getMessageKey(selectorStyle);
    String options = composeSelectorOptions(selectorStyle, context);
    String message = Messages.getMessage(BUNDLE_NAME, messageKey, locale, options);

    structureHandler.setBody(message, false);
}
 
开发者ID:jpenren,项目名称:thymeleaf-spring-data-dialect,代码行数:14,代码来源:PageSizeSelectorAttrProcessor.java

示例3: doProcess

import org.thymeleaf.processor.element.IElementTagStructureHandler; //导入方法依赖的package包/类
@Override
protected void doProcess(ITemplateContext context, IProcessableElementTag tag, AttributeName attributeName,
        String attributeValue, IElementTagStructureHandler structureHandler) {

    String attrValue = String.valueOf(attributeValue).trim();
    PaginationDecorator decorator = PaginationDecoratorRegistry.getInstance().getDecorator(attrValue);
    String html = decorator.decorate(tag, context);

    boolean isUlNode = Strings.UL.equalsIgnoreCase(tag.getElementCompleteName());
    if (isUlNode) {
        structureHandler.replaceWith(html, false);
    } else {
        structureHandler.setBody(html, false);
    }
}
 
开发者ID:jpenren,项目名称:thymeleaf-spring-data-dialect,代码行数:16,代码来源:PaginationAttrProcessor.java

示例4: doProcess

import org.thymeleaf.processor.element.IElementTagStructureHandler; //导入方法依赖的package包/类
@Override
protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final Object expressionResult, final IElementTagStructureHandler structureHandler) {
    structureHandler.setBody(RelativeDateFormat.format((Date) expressionResult), false);
}
 
开发者ID:qjx378,项目名称:wenku,代码行数:5,代码来源:PrettytimeProcessor.java

示例5: doProcess

import org.thymeleaf.processor.element.IElementTagStructureHandler; //导入方法依赖的package包/类
@Override
protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final Object expressionResult, final IElementTagStructureHandler structureHandler) {
    structureHandler.setBody(PropertiesUtil.getValue(CastUtil.castString(expressionResult)), false);
}
 
开发者ID:qjx378,项目名称:wenku,代码行数:5,代码来源:PropertiesProcessor.java


注:本文中的org.thymeleaf.processor.element.IElementTagStructureHandler.setBody方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。