Package org.thymeleaf.standard.expression

Examples of org.thymeleaf.standard.expression.IStandardConversionService


            if (!expContext.getPerformTypeConversion()) {
                return exp.getValue(evaluationContext, evaluationRoot);
            }

            final IStandardConversionService conversionService =
                    StandardExpressions.getConversionService(configuration);

            if (conversionService instanceof SpringStandardConversionService) {
                // The conversion service is a mere bridge with the Spring ConversionService, therefore
                // this makes use of the complete Spring type conversion infrastructure, without needing
                // to manually execute the conversion.
                return exp.getValue(evaluationContext, evaluationRoot, String.class);
            }

            // We need type conversion, but conversion service is not a mere bridge to the Spring one,
            // so we need manual execution.
            final Object result = exp.getValue(evaluationContext, evaluationRoot);
            return conversionService.convert(configuration, processingContext, result, String.class);


        } catch (final TemplateProcessingException e) {
            throw e;
        } catch(final Exception e) {
View Full Code Here


            if (!expContext.getPerformTypeConversion()) {
                return exp.getValue(evaluationContext, evaluationRoot);
            }

            final IStandardConversionService conversionService =
                    StandardExpressions.getConversionService(configuration);

            if (conversionService instanceof SpringStandardConversionService) {
                // The conversion service is a mere bridge with the Spring ConversionService, therefore
                // this makes use of the complete Spring type conversion infrastructure, without needing
                // to manually execute the conversion.
                return exp.getValue(evaluationContext, evaluationRoot, String.class);
            }

            // We need type conversion, but conversion service is not a mere bridge to the Spring one,
            // so we need manual execution.
            final Object result = exp.getValue(evaluationContext, evaluationRoot);
            return conversionService.convert(configuration, processingContext, result, String.class);


        } catch (final TemplateProcessingException e) {
            throw e;
        } catch(final Exception e) {
View Full Code Here

    }


    public Object convert(final Object target, final Class<?> clazz) {

        final IStandardConversionService conversionService =
                StandardExpressions.getConversionService(this.configuration);
        return conversionService.convert(this.configuration, this.processingContext, target, clazz);
    }
View Full Code Here

TOP

Related Classes of org.thymeleaf.standard.expression.IStandardConversionService

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.