structureHandler.setBody(text, false);
structureHandler.replaceWith(stringWriter.toString(), false); } else { structureHandler.setBody(stringWriter.toString(), false); structureHandler.replaceWith(model, true); } else { structureHandler.setBody(model, true); structureHandler.replaceWith(fragmentModel, true); } else { structureHandler.setBody(fragmentModel, true);
String trim = result.trim(); theStructureHandler.setBody(trim, true);
@Override protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final String attrValue = (attributeValue == null? null : attributeValue.trim()); if (attrValue == null || attrValue.length() == 0) { return; } final Authentication authentication = AuthUtils.getAuthenticationObject(context); final Object authenticationProperty = AuthUtils.getAuthenticationProperty(authentication, attrValue); if (authenticationProperty == null) { return; } structureHandler.setBody(authenticationProperty.toString(), false); }
@Override protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final String attrValue = (attributeValue == null? null : attributeValue.trim()); if (attrValue == null || attrValue.length() == 0) { return; } final Authentication authentication = AuthUtils.getAuthenticationObject(); final Object authenticationProperty = AuthUtils.getAuthenticationProperty(authentication, attrValue); if (authenticationProperty == null) { return; } structureHandler.setBody(authenticationProperty.toString(), false); }
@Override protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final String attrValue = (attributeValue == null? null : attributeValue.trim()); if (attrValue == null || attrValue.length() == 0) { return; } final Authentication authentication = AuthUtils.getAuthenticationObject(); final Object authenticationProperty = AuthUtils.getAuthenticationProperty(authentication, attrValue); if (authenticationProperty == null) { return; } structureHandler.setBody(authenticationProperty.toString(), false); }
@Override protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final String attrValue = (attributeValue == null? null : attributeValue.trim()); if (attrValue == null || attrValue.length() == 0) { return; } final Authentication authentication = AuthUtils.getAuthenticationObject(context); final Object authenticationProperty = AuthUtils.getAuthenticationProperty(authentication, attrValue); if (authenticationProperty == null) { return; } structureHandler.setBody(authenticationProperty.toString(), false); }
@Override protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final String attrValue = (attributeValue == null? null : attributeValue.trim()); if (attrValue == null || attrValue.length() == 0) { return; } final Authentication authentication = AuthUtils.getAuthenticationObject(); final Object authenticationProperty = AuthUtils.getAuthenticationProperty(authentication, attrValue); if (authenticationProperty == null) { return; } structureHandler.setBody(authenticationProperty.toString(), false); }
@Override protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final String attrValue = (attributeValue == null? null : attributeValue.trim()); if (attrValue == null || attrValue.length() == 0) { return; } final Authentication authentication = AuthUtils.getAuthenticationObject(); final Object authenticationProperty = AuthUtils.getAuthenticationProperty(authentication, attrValue); if (authenticationProperty == null) { return; } structureHandler.setBody(authenticationProperty.toString(), false); }
@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); } }
@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); } }
@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); }
@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); }
@Override protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final BindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue); if (bindStatus.isError()) { final StringBuilder strBuilder = new StringBuilder(); final String[] errorMsgs = bindStatus.getErrorMessages(); for (int i = 0; i < errorMsgs.length; i++) { if (i > 0) { strBuilder.append(ERROR_DELIMITER); } final String displayString = ValueFormatterWrapper.getDisplayString(errorMsgs[i], false); strBuilder.append(displayString); } structureHandler.setBody(strBuilder.toString(), false); // Just in case we also have a th:errorclass in this tag structureHandler.setLocalVariable(SpringContextVariableNames.SPRING_FIELD_BIND_STATUS, bindStatus); } else { structureHandler.removeElement(); } }
@Override protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final BindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue); if (bindStatus.isError()) { final StringBuilder strBuilder = new StringBuilder(); final String[] errorMsgs = bindStatus.getErrorMessages(); for (int i = 0; i < errorMsgs.length; i++) { if (i > 0) { strBuilder.append(ERROR_DELIMITER); } final String displayString = ValueFormatterWrapper.getDisplayString(errorMsgs[i], false); strBuilder.append(displayString); } structureHandler.setBody(strBuilder.toString(), false); // Just in case we also have a th:errorclass in this tag structureHandler.setLocalVariable(SpringContextVariableNames.SPRING_FIELD_BIND_STATUS, bindStatus); } else { structureHandler.removeElement(); } }
@Override protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final IThymeleafBindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue); if (bindStatus.isError()) { final StringBuilder strBuilder = new StringBuilder(); final String[] errorMsgs = bindStatus.getErrorMessages(); for (int i = 0; i < errorMsgs.length; i++) { if (i > 0) { strBuilder.append(ERROR_DELIMITER); } final String displayString = SpringValueFormatter.getDisplayString(errorMsgs[i], false); strBuilder.append(displayString); } structureHandler.setBody(strBuilder.toString(), false); // Just in case we also have a th:errorclass in this tag structureHandler.setLocalVariable(SpringContextVariableNames.THYMELEAF_FIELD_BIND_STATUS, bindStatus); } else { structureHandler.removeElement(); } }
@Override protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final BindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue); if (bindStatus.isError()) { final StringBuilder strBuilder = new StringBuilder(); final String[] errorMsgs = bindStatus.getErrorMessages(); for (int i = 0; i < errorMsgs.length; i++) { if (i > 0) { strBuilder.append(ERROR_DELIMITER); } final String displayString = ValueFormatterWrapper.getDisplayString(errorMsgs[i], false); strBuilder.append(HtmlEscape.escapeHtml4Xml(displayString)); } structureHandler.setBody(strBuilder.toString(), false); // Just in case we also have a th:errorclass in this tag structureHandler.setLocalVariable(SpringContextVariableNames.SPRING_FIELD_BIND_STATUS, bindStatus); } else { structureHandler.removeElement(); } }
@Override protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final IThymeleafBindStatus bindStatus = FieldUtils.getBindStatus(context, attributeValue); if (bindStatus.isError()) { final StringBuilder strBuilder = new StringBuilder(); final String[] errorMsgs = bindStatus.getErrorMessages(); for (int i = 0; i < errorMsgs.length; i++) { if (i > 0) { strBuilder.append(ERROR_DELIMITER); } final String displayString = SpringValueFormatter.getDisplayString(errorMsgs[i], false); strBuilder.append(HtmlEscape.escapeHtml4Xml(displayString)); } structureHandler.setBody(strBuilder.toString(), false); // Just in case we also have a th:errorclass in this tag structureHandler.setLocalVariable(SpringContextVariableNames.THYMELEAF_FIELD_BIND_STATUS, bindStatus); } else { structureHandler.removeElement(); } }
@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); }