@Override protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration()); final IStandardExpression switchExpression = expressionParser.parseExpression(context, attributeValue); structureHandler.setLocalVariable(SWITCH_VARIABLE_NAME, new SwitchStructure(switchExpression)); }
@Override protected final void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration()); final IStandardExpression expression = expressionParser.parseExpression(context, attributeValue); validateSelectionValue(context, tag, attributeName, attributeValue, expression); final Object newSelectionTarget = expression.execute(context); final Map<String,Object> additionalLocalVariables = computeAdditionalLocalVariables(context, tag, attributeName, attributeValue, expression); if (additionalLocalVariables != null && additionalLocalVariables.size() > 0) { for (final Map.Entry<String,Object> variableEntry : additionalLocalVariables.entrySet()) { structureHandler.setLocalVariable(variableEntry.getKey(), variableEntry.getValue()); } } structureHandler.setSelectionTarget(newSelectionTarget); }
} else { structureHandler.setLocalVariable(newVariableName, rightValue);
structureHandler.setLocalVariable(fragmentParameterEntry.getKey(), fragmentParameterEntry.getValue());
@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 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 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( 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 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(); } }
StandardProcessorUtils.setAttribute(structureHandler, this.nameAttributeDefinition, NAME_ATTR_NAME, name); // No need to escape: this is a java-valid token structureHandler.setLocalVariable(OPTION_IN_SELECT_ATTR_NAME, attributeName); structureHandler.setLocalVariable(OPTION_IN_SELECT_ATTR_VALUE, attributeValue);
StandardProcessorUtils.setAttribute(structureHandler, this.nameAttributeDefinition, NAME_ATTR_NAME, name); // No need to escape: this is a java-valid token structureHandler.setLocalVariable(OPTION_IN_SELECT_ATTR_NAME, attributeName); structureHandler.setLocalVariable(OPTION_IN_SELECT_ATTR_VALUE, attributeValue);
StandardProcessorUtils.setAttribute(structureHandler, this.nameAttributeDefinition, NAME_ATTR_NAME, name); // No need to escape: this is a java-valid token structureHandler.setLocalVariable(OPTION_IN_SELECT_ATTR_NAME, attributeName); structureHandler.setLocalVariable(OPTION_IN_SELECT_ATTR_VALUE, attributeValue);
StandardProcessorUtils.setAttribute(structureHandler, this.nameAttributeDefinition, NAME_ATTR_NAME, name); // No need to escape: this is a java-valid token structureHandler.setLocalVariable(OPTION_IN_SELECT_ATTR_NAME, attributeName); structureHandler.setLocalVariable(OPTION_IN_SELECT_ATTR_VALUE, attributeValue);
StandardProcessorUtils.setAttribute(structureHandler, this.nameAttributeDefinition, NAME_ATTR_NAME, name); // No need to escape: this is a java-valid token structureHandler.setLocalVariable(OPTION_IN_SELECT_ATTR_NAME, attributeName); structureHandler.setLocalVariable(OPTION_IN_SELECT_ATTR_VALUE, attributeValue);
structureHandler.setLocalVariable(SpringContextVariableNames.SPRING_FIELD_BIND_STATUS, bindStatus);