Examples of ExpressionParser


Examples of org.springframework.expression.ExpressionParser

        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.ExpressionParser

     */
   
    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.ExpressionParser

*/
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.ExpressionParser

    }

    public PreInvocationAttribute createPreInvocationAttribute(String preFilterAttribute, String filterObject, String preAuthorizeAttribute) {
        try {
            // TODO: Optimization of permitAll
            ExpressionParser parser = getParser();
            Expression preAuthorizeExpression = preAuthorizeAttribute == null ? parser.parseExpression("permitAll") : parser.parseExpression(preAuthorizeAttribute);
            Expression preFilterExpression = preFilterAttribute == null ? null : parser.parseExpression(preFilterAttribute);
            return new PreInvocationExpressionAttribute(preFilterExpression, filterObject, preAuthorizeExpression);
        } catch (ParseException e) {
            throw new IllegalArgumentException("Failed to parse expression '" + e.getExpressionString() + "'", e);
        }
    }
View Full Code Here

Examples of org.springframework.expression.ExpressionParser

        }
    }

    public PostInvocationAttribute createPostInvocationAttribute(String postFilterAttribute, String postAuthorizeAttribute) {
        try {
            ExpressionParser parser = getParser();
            Expression postAuthorizeExpression = postAuthorizeAttribute == null ? null : parser.parseExpression(postAuthorizeAttribute);
            Expression postFilterExpression = postFilterAttribute == null ? null : parser.parseExpression(postFilterAttribute);

            if (postFilterExpression != null || postAuthorizeExpression != null) {
                return new PostInvocationExpressionAttribute(postFilterExpression, postAuthorizeExpression);
            }
        } catch (ParseException e) {
View Full Code Here

Examples of org.springframework.expression.ExpressionParser

        bean.getConstructorArgumentValues().addGenericArgumentValue("ROLE_A");
        appContext.registerBeanDefinition("role", bean);
        handler.setApplicationContext(appContext);

        EvaluationContext ctx = handler.createEvaluationContext(mock(Authentication.class), mock(FilterInvocation.class));
        ExpressionParser parser = handler.getExpressionParser();
        assertTrue(parser.parseExpression("@role.getAttribute() == 'ROLE_A'").getValue(ctx, Boolean.class));
        assertTrue(parser.parseExpression("@role.attribute == 'ROLE_A'").getValue(ctx, Boolean.class));
    }
View Full Code Here

Examples of org.springframework.expression.ExpressionParser

    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 tcg.common.util.ExpressionParser

    // protect against "X" or "x"
    inExpression = inExpression.toLowerCase();

    // create the parser
    ecParser = new ExpressionParser(inExpression, type);

    // create the input variable
    ecParser.createVariable("x", type, initInputValue);

    // try to evaluate
View Full Code Here

Examples of tcg.common.util.ExpressionParser

    // parse the expression
    String parsedExpression = _parseExpression(inDpList, inExpression,
        params, varnames, vartypes, varvalues);

    // create the parser
    expressionParser = new ExpressionParser(parsedExpression, type);

    // create all the variables
    for (int i = 0; i < varnames.size(); i++)
    {
      expressionParser.createVariable(varnames.get(i), vartypes.get(i),
View Full Code Here

Examples of tcg.common.util.ExpressionParser

    // parse the expression
    String parsedExpression = _parseExpression(inDpList, inExpression,
        params, varnames, vartypes, varvalues);

    // create the parser
    rccParser = new ExpressionParser(parsedExpression, type);

    // create all the variables
    for (int i = 0; i < varnames.size(); i++)
    {
      rccParser.createVariable(varnames.get(i), vartypes.get(i),
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.