Java Code Examples for org.thymeleaf.processor.element.IElementTagStructureHandler#removeTags()

The following examples show how to use org.thymeleaf.processor.element.IElementTagStructureHandler#removeTags() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HasAllRolesElementProcessor.java    From thymeleaf-extras-shiro with Apache License 2.0 5 votes vote down vote up
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    final String rawValue = getRawValue(iProcessableElementTag, "name");
    final List<String> values = evaluateAsStringsWithDelimiter(iTemplateContext, rawValue, DELIMITER);

    if (ShiroFacade.hasAllRoles(values)) {
        iElementTagStructureHandler.removeTags();
    } else {
        iElementTagStructureHandler.removeElement();
    }
}
 
Example 2
Source File: AuthenticatedElementProcessor.java    From thymeleaf-extras-shiro with Apache License 2.0 5 votes vote down vote up
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    if (ShiroFacade.isAuthenticated()) {
        iElementTagStructureHandler.removeTags();
    } else {
        iElementTagStructureHandler.removeElement();
    }
}
 
Example 3
Source File: HasAnyPermissionsElementProcessor.java    From thymeleaf-extras-shiro with Apache License 2.0 5 votes vote down vote up
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    final String rawValue = getRawValue(iProcessableElementTag, "name");
    final List<String> values = evaluateAsStringsWithDelimiter(iTemplateContext, rawValue, DELIMITER);

    if (ShiroFacade.hasAnyPermissions(values)) {
        iElementTagStructureHandler.removeTags();
    } else {
        iElementTagStructureHandler.removeElement();
    }
}
 
Example 4
Source File: HasPermissionElementProcessor.java    From thymeleaf-extras-shiro with Apache License 2.0 5 votes vote down vote up
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    final String rawValue = getRawValue(iProcessableElementTag, "name");
    final List<String> values = evaluateAsStringsWithDelimiter(iTemplateContext, rawValue, DELIMITER);

    if (ShiroFacade.hasAllPermissions(values)) {
        iElementTagStructureHandler.removeTags();
    } else {
        iElementTagStructureHandler.removeElement();
    }
}
 
Example 5
Source File: UserElementProcessor.java    From thymeleaf-extras-shiro with Apache License 2.0 5 votes vote down vote up
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    if (ShiroFacade.isUser()) {
        iElementTagStructureHandler.removeTags();
    } else {
        iElementTagStructureHandler.removeElement();
    }
}
 
Example 6
Source File: NotAuthenticatedElementProcessor.java    From thymeleaf-extras-shiro with Apache License 2.0 5 votes vote down vote up
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    if (ShiroFacade.isNotAuthenticated()) {
        iElementTagStructureHandler.removeTags();
    } else {
        iElementTagStructureHandler.removeElement();
    }
}
 
Example 7
Source File: LacksRoleElementProcessor.java    From thymeleaf-extras-shiro with Apache License 2.0 5 votes vote down vote up
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    final String rawValue = getRawValue(iProcessableElementTag, "name");
    final List<String> values = evaluateAsStringsWithDelimiter(iTemplateContext, rawValue, DELIMITER);

    if (!ShiroFacade.hasAnyRoles(values)) {
        iElementTagStructureHandler.removeTags();
    } else {
        iElementTagStructureHandler.removeElement();
    }
}
 
Example 8
Source File: HasRoleElementProcessor.java    From thymeleaf-extras-shiro with Apache License 2.0 5 votes vote down vote up
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    final String rawValue = getRawValue(iProcessableElementTag, "name");
    final List<String> values = evaluateAsStringsWithDelimiter(iTemplateContext, rawValue, DELIMITER);

    if (ShiroFacade.hasAllRoles(values)) {
        iElementTagStructureHandler.removeTags();
    } else {
        iElementTagStructureHandler.removeElement();
    }
}
 
Example 9
Source File: LacksPermissionElementProcessor.java    From thymeleaf-extras-shiro with Apache License 2.0 5 votes vote down vote up
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    final String rawValue = getRawValue(iProcessableElementTag, "name");
    final List<String> values = evaluateAsStringsWithDelimiter(iTemplateContext, rawValue, DELIMITER);

    if (!ShiroFacade.hasAnyPermissions(values)) {
        iElementTagStructureHandler.removeTags();
    } else {
        iElementTagStructureHandler.removeElement();
    }
}
 
Example 10
Source File: HasAnyRolesElementProcessor.java    From thymeleaf-extras-shiro with Apache License 2.0 5 votes vote down vote up
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    final String rawValue = getRawValue(iProcessableElementTag, "name");
    final List<String> values = evaluateAsStringsWithDelimiter(iTemplateContext, rawValue, DELIMITER);

    if (ShiroFacade.hasAnyRoles(values)) {
        iElementTagStructureHandler.removeTags();
    } else {
        iElementTagStructureHandler.removeElement();
    }
}
 
Example 11
Source File: HasAllPermissionsElementProcessor.java    From thymeleaf-extras-shiro with Apache License 2.0 5 votes vote down vote up
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    final String rawValue = getRawValue(iProcessableElementTag, "name");
    final List<String> values = evaluateAsStringsWithDelimiter(iTemplateContext, rawValue, DELIMITER);

    if (ShiroFacade.hasAllPermissions(values)) {
        iElementTagStructureHandler.removeTags();
    } else {
        iElementTagStructureHandler.removeElement();
    }
}
 
Example 12
Source File: GuestElementProcessor.java    From thymeleaf-extras-shiro with Apache License 2.0 5 votes vote down vote up
@Override
protected void doProcess(ITemplateContext iTemplateContext,
                         IProcessableElementTag iProcessableElementTag,
                         IElementTagStructureHandler iElementTagStructureHandler) {
    if (ShiroFacade.isGuest()) {
        iElementTagStructureHandler.removeTags();
    } else {
        iElementTagStructureHandler.removeElement();
    }
}