Examples of SpelExpressionParser


Examples of org.springframework.expression.spel.standard.SpelExpressionParser

   * @param parser
   * @param factory
   */
  private SpELContext(PropertyAccessor accessor, SpelExpressionParser parser, BeanFactory factory) {

    this.parser = parser == null ? new SpelExpressionParser() : parser;
    this.accessor = accessor;
    this.factory = factory;
  }
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser

        this.argDefinitions=argDefinitions;
    }
   
    public List<String> getStepArgs(Map<String,Object> local,List<String> flowArgs) {
        SpringStepContext stepContext=new SpringStepContext(flowArgs,local);
        ExpressionParser parser = new SpelExpressionParser();
        List<String> stepArgs=new ArrayList<>();
       
        for(String that:argDefinitions) {
            Expression e=parser.parseExpression(that);
            StandardEvaluationContext c=new StandardEvaluationContext(stepContext);
            stepContext.assignVariables(c);
            String value = e.getValue(c,String.class);
            logger.trace("parsing ["+that+"] with result +["+value+"]");
            stepArgs.add(value);
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser

     */
   
    public Map<String,Object> process(final Map<String,Object> local,final List<String> flowArgs) {
        HashMap<String, Object> output = new HashMap<>(local);
        SpringStepContext stepContext=new SpringStepContext(flowArgs,local);
        ExpressionParser parser = new SpelExpressionParser();
       
        for(Assignment that:assignments) {
            Expression e=parser.parseExpression(that.getExpression());
            StandardEvaluationContext c=new StandardEvaluationContext(stepContext);
            stepContext.assignVariables(c);
            Object value = e.getValue(c);
            logger.trace("parsing ["+that+"] with result +["+value+"]");
            if (output.containsKey(that.getAssignTo())) {
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser

*/
public class SpElValueExpressionEvaluator implements ValueExpressionEvaluator {

    /** {@inheritDoc } */
    public Object evaluate(Object context, String expression) {
        final ExpressionParser parser = new SpelExpressionParser();
        return parser.parseExpression(expression).getValue(context);
    }
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser

public class ELRequestMatcher implements RequestMatcher {

    private final Expression expression;

    public ELRequestMatcher(String el) {
        SpelExpressionParser parser = new SpelExpressionParser();
        expression = parser.parseExpression(el);
    }
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser

    /**
     * Parses the supplied expressions as Spring-EL.
     */
    AbstractExpressionBasedMethodConfigAttribute(String filterExpression, String authorizeExpression) throws ParseException {
        Assert.isTrue(filterExpression != null || authorizeExpression != null, "Filter and authorization Expressions cannot both be null");
        SpelExpressionParser parser = new SpelExpressionParser();
        this.filterExpression = filterExpression == null ? null : parser.parseExpression(filterExpression);
        this.authorizeExpression = authorizeExpression == null ? null : parser.parseExpression(authorizeExpression);
    }
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser

public class ELRequestMatcher implements RequestMatcher {

    private final Expression expression;

    public ELRequestMatcher(String el) {
        SpelExpressionParser parser = new SpelExpressionParser();
        expression = parser.parseExpression(el);
    }
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser

        handler.setExpressionParser(null);
    }

    @Test
    public void setExpressionParser() {
        SpelExpressionParser parser = new SpelExpressionParser();
        handler.setExpressionParser(parser);
        assertTrue(parser == handler.getExpressionParser());
    }
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser

    private final Expression expression;
    private final MapExpressionMethods methods;

    public MapPartitionResolver(String expression, EvaluationContext evaluationContext) {
      ExpressionParser parser = new SpelExpressionParser();
      this.expression = parser.parseExpression(expression);
      this.methods = new MapExpressionMethods(evaluationContext);
      log.info("Using expression=[" + this.expression.getExpressionString() + "]");
    }
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser

    }
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    HttpServletRequest request = ServletActionContext.getRequest();
    CustomWebSecurityExpressionHandler filterSecurityInterceptor = (CustomWebSecurityExpressionHandler)StorageService.ctx.getBean("customExpressionHandler");
    EvaluationContext ctx = filterSecurityInterceptor.createEvaluationContext(authentication, request);
    Expression expr = new SpelExpressionParser().parseExpression(expression);
    if(ExpressionUtils.evaluateAsBoolean(expr, ctx))
    {
      result = true;
    }
    return result;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.