Package org.thymeleaf.exceptions

Examples of org.thymeleaf.exceptions.TemplateProcessingException


     */
    public String formatISO(final Calendar target) {
        try {
            return DateUtils.formatISO(target);
        } catch (final Exception e) {
            throw new TemplateProcessingException("Error formatting calendar as ISO8601", e);
        }
    }
View Full Code Here


   
    public String formatInteger(final Number target, final Integer minIntegerDigits) {
        try {
            return NumberUtils.format(target, minIntegerDigits, this.locale);
        } catch (final Exception e) {
            throw new TemplateProcessingException(
                    "Error formatting integer with minimum integer digits = " + minIntegerDigits, e);
        }
    }
View Full Code Here

   
   
    public String formatInteger(final Number target, final Integer minIntegerDigits, final String thousandsPointType) {
        final NumberPointType thousandsNumberPointType = NumberPointType.match(thousandsPointType);
        if (thousandsNumberPointType == null) {
            throw new TemplateProcessingException(
                    "Unrecognized point format \"" + thousandsPointType + "\"");
        }
        try {
            return NumberUtils.format(target, minIntegerDigits, thousandsNumberPointType, this.locale);
        } catch (final Exception e) {
            throw new TemplateProcessingException(
                    "Error formatting integer with minimum integer digits = " +
                    minIntegerDigits + " and thousands point type = " + thousandsPointType, e);
        }
    }
View Full Code Here

   
    public String formatDecimal(final Number target, final Integer minIntegerDigits, final Integer decimalDigits) {
        try {
            return NumberUtils.format(target, minIntegerDigits, decimalDigits, this.locale);
        } catch (final Exception e) {
            throw new TemplateProcessingException(
                    "Error formatting decimal with minimum integer digits = " + minIntegerDigits +
                    " and decimal digits " + decimalDigits, e);
        }
    }
View Full Code Here

   
   
    public String formatDecimal(final Number target, final Integer minIntegerDigits, final Integer decimalDigits, final String decimalPointType) {
        final NumberPointType decimalNumberPointType = NumberPointType.match(decimalPointType);
        if (decimalNumberPointType == null) {
            throw new TemplateProcessingException(
                    "Unrecognized point format \"" + decimalPointType + "\"");
        }
        try {
            return NumberUtils.format(target, minIntegerDigits, decimalDigits, decimalNumberPointType, this.locale);
        } catch (final Exception e) {
            throw new TemplateProcessingException(
                    "Error formatting decimal with minimum integer digits = " + minIntegerDigits +
                    ", decimal digits = " + decimalDigits + " and decimal point type = " + decimalPointType, e);
        }
    }
View Full Code Here

   
   
    public String formatDecimal(final Number target, final Integer minIntegerDigits, final String thousandsPointType, final Integer decimalDigits, final String decimalPointType) {
        final NumberPointType decimalNumberPointType = NumberPointType.match(decimalPointType);
        if (decimalNumberPointType == null) {
            throw new TemplateProcessingException(
                    "Unrecognized point format \"" + decimalPointType + "\"");
        }
        final NumberPointType thousandsNumberPointType = NumberPointType.match(thousandsPointType);
        if (thousandsNumberPointType == null) {
            throw new TemplateProcessingException(
                    "Unrecognized point format \"" + thousandsPointType + "\"");
        }
        try {
            return NumberUtils.format(target, minIntegerDigits, thousandsNumberPointType, decimalDigits, decimalNumberPointType, this.locale);
        } catch (final Exception e) {
            throw new TemplateProcessingException(
                    "Error formatting decimal with minimum integer digits = " + minIntegerDigits +
                    ", thousands point type = " + thousandsPointType + ", decimal digits = " + decimalDigits +
                    " and decimal point type = " + decimalPointType, e);
        }
    }
View Full Code Here

        String targetTemplateName = getTemplateName();
        if (targetTemplateName == null) {
            if (context != null && context instanceof Arguments) {
                targetTemplateName = ((Arguments)context).getTemplateName();
            } else {
                throw new TemplateProcessingException(
                        "In order to extract fragment from current template (templateName == null), processing context " +
                        "must be a non-null instance of the Arguments class (but is: " +
                        (context == null? null : context.getClass().getName()) + ")");
            }
        }
View Full Code Here

        }
        if (expression instanceof LessOrEqualToExpression) {
            return LessOrEqualToExpression.executeLessOrEqualTo(configuration, processingContext, (LessOrEqualToExpression)expression, expContext);
        }

        throw new TemplateProcessingException("Unrecognized complex expression: " + expression.getClass().getName());
       
    }
View Full Code Here

                    StandardExpressions.getConversionService(configuration);

            return conversionService.convert(configuration, processingContext, result, String.class);
           
        } catch (final OgnlException e) {
            throw new TemplateProcessingException(
                    "Exception evaluating OGNL expression: \"" + expression + "\"", e);
        }
       
    }
View Full Code Here

        if (expression instanceof ComplexExpression) {
            return ComplexExpression.executeComplex(
                    configuration, processingContext, (ComplexExpression)expression, expContext);
        }

        throw new TemplateProcessingException("Unrecognized expression: " + expression.getClass().getName());
       
    }
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.