Search in sources :

Example 1 with ExpressionParser

use of org.springframework.binding.expression.ExpressionParser in project cas by apereo.

the class AbstractCasWebflowConfigurer method createMappingToSubflowState.

/**
     * Create mapping to subflow state.
     *
     * @param name     the name
     * @param value    the value
     * @param required the required
     * @param type     the type
     * @return the default mapping
     */
protected DefaultMapping createMappingToSubflowState(final String name, final String value, final boolean required, final Class type) {
    final ExpressionParser parser = this.flowBuilderServices.getExpressionParser();
    final Expression source = parser.parseExpression(value, new FluentParserContext());
    final Expression target = parser.parseExpression(name, new FluentParserContext());
    final DefaultMapping mapping = new DefaultMapping(source, target);
    mapping.setRequired(required);
    final ConversionExecutor typeConverter = new RuntimeBindingConversionExecutor(type, this.flowBuilderServices.getConversionService());
    mapping.setTypeConverter(typeConverter);
    return mapping;
}
Also used : FluentParserContext(org.springframework.binding.expression.support.FluentParserContext) RuntimeBindingConversionExecutor(org.springframework.binding.convert.service.RuntimeBindingConversionExecutor) ConversionExecutor(org.springframework.binding.convert.ConversionExecutor) Expression(org.springframework.binding.expression.Expression) LiteralExpression(org.springframework.binding.expression.support.LiteralExpression) SpringELExpressionParser(org.springframework.binding.expression.spel.SpringELExpressionParser) ExpressionParser(org.springframework.binding.expression.ExpressionParser) SpelExpressionParser(org.springframework.expression.spel.standard.SpelExpressionParser) DefaultMapping(org.springframework.binding.mapping.impl.DefaultMapping) RuntimeBindingConversionExecutor(org.springframework.binding.convert.service.RuntimeBindingConversionExecutor)

Aggregations

ConversionExecutor (org.springframework.binding.convert.ConversionExecutor)1 RuntimeBindingConversionExecutor (org.springframework.binding.convert.service.RuntimeBindingConversionExecutor)1 Expression (org.springframework.binding.expression.Expression)1 ExpressionParser (org.springframework.binding.expression.ExpressionParser)1 SpringELExpressionParser (org.springframework.binding.expression.spel.SpringELExpressionParser)1 FluentParserContext (org.springframework.binding.expression.support.FluentParserContext)1 LiteralExpression (org.springframework.binding.expression.support.LiteralExpression)1 DefaultMapping (org.springframework.binding.mapping.impl.DefaultMapping)1 SpelExpressionParser (org.springframework.expression.spel.standard.SpelExpressionParser)1