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


Java IProcessableElementTag.getAttributeValue方法代码示例

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


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

示例1: getContents

import org.thymeleaf.model.IProcessableElementTag; //导入方法依赖的package包/类
static Contents getContents(final ITemplateContext context,
                            final IProcessableElementTag tag) {
    final Contents contents;
    final String from = tag.getAttributeValue(ATTR_FROM);
    if (from != null) {
        final IEngineConfiguration configuration = context.getConfiguration();
        final IStandardExpressionParser parser = getExpressionParser(configuration);
        final IStandardExpression expression = parser.parseExpression(context, from);
        contents = (Contents) expression.execute(context);
    } else {
        Object contentsVar = context.getVariable(DEFAULT_VAR_CONTENTS);
        if (contentsVar != null) {
            contents = (Contents) contentsVar;
        } else {
            contents = null;
        }
    }
    if (contents != null) {
        return contents;
    } else {
        throw new IllegalStateException(
                "Unable to get RxComposer Contents. " +
                        "You should either provide a template variable named 'contents' or " +
                        "provide it using attribute 'from': '<rxc:fragment from='${myContents}' position='A' />");
    }
}
 
开发者ID:otto-de,项目名称:rx-composer,代码行数:27,代码来源:RxcFragmentElementProcessor.java

示例2: doProcess

import org.thymeleaf.model.IProcessableElementTag; //导入方法依赖的package包/类
@Override
protected void doProcess(
		final ITemplateContext context, final IProcessableElementTag tag,
		final IElementTagStructureHandler structureHandler) {

	final String allRolesStr = tag.getAttributeValue("name");

	final String[] roles = StringUtils.split(allRolesStr, DELIMITER);

	if(ShiroFacade.hasAllRoles(roles)){
		structureHandler.removeTags();
	} else {
		structureHandler.removeElement();
	}

}
 
开发者ID:usydapeng,项目名称:thymeleaf3-shiro,代码行数:17,代码来源:HasRoleElementTagProcessor.java

示例3: doProcess

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

    String attrValue = String.valueOf(Expressions.evaluate(context, attributeValue)).trim();
    Page<?> page = PageUtils.findPage(context);
    String url = PageUtils.createSortUrl(context, attrValue);

    // Append class to the element if sorted by this field
    Sort sort = page.getSort();
    boolean isSorted = sort != null && sort.getOrderFor(attrValue) != null;
    String clas = isSorted
            ? SORTED_PREFIX.concat(sort.getOrderFor(attrValue).getDirection().toString().toLowerCase())
            : EMPTY;

    structureHandler.setAttribute(HREF, url);
    String currentClass = tag.getAttributeValue(CLASS);
    structureHandler.setAttribute(CLASS, Strings.concat(currentClass, BLANK, clas));
}
 
开发者ID:jpenren,项目名称:thymeleaf-spring-data-dialect,代码行数:20,代码来源:PaginationSortAttrProcessor.java

示例4: doProcess

import org.thymeleaf.model.IProcessableElementTag; //导入方法依赖的package包/类
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         AttributeName attributeName,
                         String attributeValue,
                         IElementTagStructureHandler iElementTagStructureHandler) {

    final String type = iProcessableElementTag.getAttributeValue("type");
    final String property = iProcessableElementTag.getAttributeValue("property");

    final String text = ShiroFacade.getPrincipalText(type, property);
    final String elementCompleteName = iProcessableElementTag.getElementCompleteName();

    final IModelFactory modelFactory = iTemplateContext.getModelFactory();
    final IModel model = modelFactory.createModel();

    model.add(modelFactory.createOpenElementTag(elementCompleteName));
    model.add(modelFactory.createText(HtmlEscape.escapeHtml5(text)));
    model.add(modelFactory.createCloseElementTag(elementCompleteName));

    iElementTagStructureHandler.replaceWith(model, false);
}
 
开发者ID:theborakompanioni,项目名称:thymeleaf-extras-shiro,代码行数:23,代码来源:PrincipalAttrProcessor.java

示例5: getPosition

import org.thymeleaf.model.IProcessableElementTag; //导入方法依赖的package包/类
static Position getPosition(final ITemplateContext context,
                            final IProcessableElementTag tag) {
    String position = tag.getAttributeValue("position");
    try {
        final IEngineConfiguration configuration = context.getConfiguration();
        final IStandardExpressionParser parser = getExpressionParser(configuration);
        final IStandardExpression expression = parser.parseExpression(context, position);
        return () -> expression.execute(context).toString();
    } catch (final Exception e) {
        return () -> position;
    }
}
 
开发者ID:otto-de,项目名称:rx-composer,代码行数:13,代码来源:RxcFragmentElementProcessor.java

示例6: doProcess

import org.thymeleaf.model.IProcessableElementTag; //导入方法依赖的package包/类
@Override
protected void doProcess(
		final ITemplateContext context, final IProcessableElementTag tag,
		final IElementTagStructureHandler structureHandler) {

	final String allRolesStr = tag.getAttributeValue("name");

	final String[] roles = StringUtils.split(allRolesStr, DELIMITER);

	if(!ShiroFacade.hasAnyRoles(roles)){
		structureHandler.removeTags();
	} else {
		structureHandler.removeElement();
	}
}
 
开发者ID:usydapeng,项目名称:thymeleaf3-shiro,代码行数:16,代码来源:LacksRoleElementTagProcessor.java

示例7: doProcess

import org.thymeleaf.model.IProcessableElementTag; //导入方法依赖的package包/类
@Override
protected void doProcess(
		final ITemplateContext context, final IProcessableElementTag tag,
		final IElementTagStructureHandler structureHandler) {

	final String allPermissionsStr = tag.getAttributeValue("name");

	final String[] permissions = StringUtils.split(allPermissionsStr, DELIMITER);

	if(ShiroFacade.hasAllPermissions(permissions)){
		structureHandler.removeTags();
	} else {
		structureHandler.removeElement();
	}
}
 
开发者ID:usydapeng,项目名称:thymeleaf3-shiro,代码行数:16,代码来源:HasAllPermissionsElementTagProcessor.java

示例8: doProcess

import org.thymeleaf.model.IProcessableElementTag; //导入方法依赖的package包/类
@Override
protected void doProcess(
		final ITemplateContext context, final IProcessableElementTag tag,
		final IElementTagStructureHandler structureHandler) {

	final String allPermissionsStr = tag.getAttributeValue("name");

	final String[] permissions = StringUtils.split(allPermissionsStr, DELIMITER);

	if(ShiroFacade.hasAnyPermissions(permissions)){
		structureHandler.removeTags();
	} else {
		structureHandler.removeElement();
	}
}
 
开发者ID:usydapeng,项目名称:thymeleaf3-shiro,代码行数:16,代码来源:HasAnyPermissionsElementTagProcessor.java

示例9: doProcess

import org.thymeleaf.model.IProcessableElementTag; //导入方法依赖的package包/类
@Override
protected void doProcess(
		final ITemplateContext context, final IProcessableElementTag tag,
		final IElementTagStructureHandler structureHandler) {

	final String allRolesStr = tag.getAttributeValue("name");

	final String[] roles = StringUtils.split(allRolesStr, DELIMITER);

	if(ShiroFacade.hasAllRoles(roles)){
		structureHandler.removeTags();
	} else {
		structureHandler.removeElement();
	}
}
 
开发者ID:usydapeng,项目名称:thymeleaf3-shiro,代码行数:16,代码来源:HasAllRolesElementTagProcessor.java

示例10: doProcess

import org.thymeleaf.model.IProcessableElementTag; //导入方法依赖的package包/类
@Override
protected void doProcess(
		final ITemplateContext context, final IProcessableElementTag tag,
		final IElementTagStructureHandler structureHandler) {

	final String allPermissionsStr = tag.getAttributeValue("name");

	final String[] permissions = StringUtils.split(allPermissionsStr, DELIMITER);

	if(!ShiroFacade.hasAnyPermissions(permissions)){
		structureHandler.removeTags();
	} else {
		structureHandler.removeElement();
	}
}
 
开发者ID:usydapeng,项目名称:thymeleaf3-shiro,代码行数:16,代码来源:LacksPermissionElementTagProcessor.java

示例11: doProcess

import org.thymeleaf.model.IProcessableElementTag; //导入方法依赖的package包/类
@Override
protected void doProcess(
		final ITemplateContext context, final IProcessableElementTag tag,
		final IElementTagStructureHandler structureHandler) {

	final String allRolesStr = tag.getAttributeValue("name");

	final String[] roles = StringUtils.split(allRolesStr, DELIMITER);

	if(ShiroFacade.hasAnyRoles(roles)){
		structureHandler.removeTags();
	} else {
		structureHandler.removeElement();
	}
}
 
开发者ID:usydapeng,项目名称:thymeleaf3-shiro,代码行数:16,代码来源:HasAnyRolesElementTagProcessor.java

示例12: decorate

import org.thymeleaf.model.IProcessableElementTag; //导入方法依赖的package包/类
public String decorate(final IProcessableElementTag tag, final ITemplateContext context) {

        Page<?> page = PageUtils.findPage(context);

        // laquo
        String firstPage = PageUtils.createPageUrl(context, 0);
        Locale locale = context.getLocale();
        String laquo = PageUtils.isFirstPage(page) ? getLaquo(locale) : getLaquo(firstPage, locale);

        // Previous page
        String previous = getPreviousPageLink(page, context);

        // Links
        String pageLinks = createPageLinks(page, context);

        // Next page
        String next = getNextPageLink(page, context);

        // raquo
        String lastPage = PageUtils.createPageUrl(context, page.getTotalPages() - 1);
        String raquo = page.isLast() ? getRaquo(locale) : getRaquo(lastPage, locale);

        boolean isUl = Strings.UL.equalsIgnoreCase(tag.getElementCompleteName());
        String currentClass = tag.getAttributeValue(Strings.CLASS);
        String clas = (isUl && !Strings.isEmpty(currentClass)) ? currentClass : DEFAULT_CLASS;

        return Messages.getMessage(BUNDLE_NAME, "pagination", locale, clas, laquo, previous, pageLinks, next, raquo);
    }
 
开发者ID:jpenren,项目名称:thymeleaf-spring-data-dialect,代码行数:29,代码来源:FullPaginationDecorator.java

示例13: doProcess

import org.thymeleaf.model.IProcessableElementTag; //导入方法依赖的package包/类
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    final String type = iProcessableElementTag.getAttributeValue("type");
    final String property = iProcessableElementTag.getAttributeValue("property");

    final String text = ShiroFacade.getPrincipalText(type, property);
    iElementTagStructureHandler.replaceWith(text, false);
}
 
开发者ID:theborakompanioni,项目名称:thymeleaf-extras-shiro,代码行数:11,代码来源:PrincipalElementProcessor.java


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