public TemplateAssertionException(final String assertionExpression, final String templateName) { super(createMessage(assertionExpression, templateName, null, null)); }
@Override protected final void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final IElementTagStructureHandler structureHandler) { if (StringUtils.isEmptyOrWhitespace(attributeValue)) { return; } final ExpressionSequence expressionSequence = ExpressionSequenceUtils.parseExpressionSequence(context, attributeValue); final List<IStandardExpression> expressions = expressionSequence.getExpressions(); for (final IStandardExpression expression : expressions) { final Object expressionResult = expression.execute(context); final boolean expressionBooleanResult = EvaluationUtils.evaluateAsBoolean(expressionResult); if (!expressionBooleanResult) { throw new TemplateAssertionException( expression.getStringRepresentation(), tag.getTemplateName(), tag.getAttribute(attributeName).getLine(), tag.getAttribute(attributeName).getCol()); } } }
@Override protected final void checkAssertions(final Arguments arguments, final Element element, final String attributeName, final String attributeValue) { if (StringUtils.isEmptyOrWhitespace(attributeValue)) { return; } final Configuration configuration = arguments.getConfiguration(); final ExpressionSequence expressionSequence = ExpressionSequenceUtils.parseExpressionSequence(configuration, arguments, attributeValue); final List<IStandardExpression> expressions = expressionSequence.getExpressions(); for (final IStandardExpression expression : expressions) { final Object expressionResult = expression.execute(arguments.getConfiguration(), arguments); final boolean expressionBooleanResult = EvaluationUtil.evaluateAsBoolean(expressionResult); if (!expressionBooleanResult) { throw new TemplateAssertionException(expression.getStringRepresentation(), arguments.getTemplateName(), element.getLineNumber()); } } }
public TemplateAssertionException(final String assertionExpression, final String templateName, final int line, final int col) { super(createMessage(assertionExpression, templateName, Integer.valueOf(line), Integer.valueOf(col))); }
public TemplateAssertionException(final String assertionExpression, final String templateName) { super(createMessage(assertionExpression, templateName, null)); }
public TemplateAssertionException(final String assertionExpression, final String templateName, final Integer line) { super(createMessage(assertionExpression, templateName, line)); }