Package org.thymeleaf.exceptions

Examples of org.thymeleaf.exceptions.TemplateProcessingException


        if (operandNumberValue != null) {
            // Addition will act as a mathematical 'plus'
            return operandNumberValue.multiply(BigDecimal.valueOf(-1));
        }
       
        throw new TemplateProcessingException(
            "Cannot execute minus: operand is \"" + LiteralValue.unwrap(operandValue) + "\"");
       
    }
View Full Code Here


     */
    public Integer getPreviousIDSeq(final String id) {
        Validate.notNull(id, "ID cannot be null");
        final Integer count = this.idCounts.get(id);
        if (count == null) {
            throw new TemplateProcessingException(
                    "Cannot obtain previous ID count for ID \"" + id + "\"");
        }
        return Integer.valueOf(count.intValue() - 1);
    }
View Full Code Here

    public final ProcessorResult processAttribute(final Arguments arguments, final Element element, final String attributeName) {
       
        final Map<String,Object> newLocalVariables =
            getNewLocalVariables(arguments, element, attributeName);
        if (newLocalVariables == null) {
            throw new TemplateProcessingException("Null variables map for \"" + attributeName + "\" attribute not allowed");
        }

        element.removeAttribute(attributeName);
       
        return ProcessorResult.setLocalVariables(newLocalVariables);
View Full Code Here

    public final ProcessorResult processAttribute(final Arguments arguments, final Element element, final String attributeName) {
       
        final Map<String,String> modifiedAttributeValues =
            getModifiedAttributeValues(arguments, element, attributeName);
        if (modifiedAttributeValues == null) {
            throw new TemplateProcessingException(
                    "Null new attribute value map specified for: \"" + attributeName + "\"");
        }
       
        for (final Map.Entry<String,String> modifiedAttributeEntry : modifiedAttributeValues.entrySet()) {
View Full Code Here

       
        final String exceptionMessage =
                (this.message != null ?
                        this.message :
                        "Access to variable \"" + variableName + "\" is forbidden in this context");
        throw new TemplateProcessingException(exceptionMessage);
       
    }
View Full Code Here

            final OGNLVariablesMapPropertyAccessor accessor = new OGNLVariablesMapPropertyAccessor();
            OgnlRuntime.setPropertyAccessor(VariablesMap.class, accessor);

        } catch (final Exception e) {
            // We will not ignore this: there's a problem creating an instance of the new property accessor!
            throw new TemplateProcessingException("Exception while configuring OGNL variables map property accessor", e);
        }

    }
View Full Code Here

        String resourceValue = attributeValue;

        Expression expression = StandardExpressionProcessor.parseExpression(arguments, attributeValue);
        if (!(expression instanceof LinkExpression)) {
            throw new TemplateProcessingException("Could not parse as expression: \"" + attributeValue + "\"");
        }

        String linkBase = getExpressionBaseUrl((LinkExpression) expression);

        if (!StringUtils.hasText(linkBase)) {
            throw new TemplateProcessingException("Could not parse as expression: \"" + attributeValue + "\"");
        }

        if(staticContentURL != null && !staticContentURL.isEmpty() && !"${CloudFrontURL}".equals(staticContentURL)) {
            resourceValue = staticContentURL + linkBase;
        } else {

            String processedPath;
            try {
                processedPath = (String) StandardExpressionProcessor.processExpression(arguments, attributeValue);
            } catch (Exception e) {
                throw new TemplateProcessingException("Could not parse as expression: \"" + attributeValue + "\"");
            }

            if (StringUtils.hasText(processedPath)) {
                resourceValue = processedPath;
            }
View Full Code Here

        }

        final Each each = internalParseEach(preprocessedInput.trim());

        if (each == null) {
            throw new TemplateProcessingException("Could not parse as each: \"" + input + "\"");
        }

        if (configuration != null) {
            ExpressionCache.putEachIntoCache(configuration, preprocessedInput, each);
        }
View Full Code Here

        if (leftNumberValue != null && rightNumberValue != null) {
            // Addition will act as a mathematical 'plus'
            return leftNumberValue.multiply(rightNumberValue);
        }
       
        throw new TemplateProcessingException(
            "Cannot execute multiplication: operands are \"" + LiteralValue.unwrap(leftValue) + "\" and \"" + LiteralValue.unwrap(rightValue) + "\"");
       
    }
View Full Code Here

        final AssignationSequence assignationSequence =
                internalParseAssignationSequence(preprocessedInput.trim(), allowParametersWithoutValue);

        if (assignationSequence == null) {
            throw new TemplateProcessingException("Could not parse as assignation sequence: \"" + input + "\"");
        }

        if (configuration != null) {
            ExpressionCache.putAssignationSequenceIntoCache(configuration, preprocessedInput, assignationSequence);
        }
View Full Code Here

TOP

Related Classes of org.thymeleaf.exceptions.TemplateProcessingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.