Examples of StandardEvaluationContext


Examples of org.springframework.expression.spel.support.StandardEvaluationContext

     * Return the default evaluation context that will be used if none is supplied on an evaluation call
     * @return the default evaluation context
     */
  public EvaluationContext getEvaluationContext() {
    if (defaultContext == null) {
      defaultContext = new StandardEvaluationContext();
    }
    return defaultContext;
  }
View Full Code Here

Examples of org.springframework.expression.spel.support.StandardEvaluationContext

      Expression expr = this.expressionCache.get(value);
      if (expr == null) {
        expr = this.expressionParser.parseExpression(value, this.beanExpressionParserContext);
        this.expressionCache.put(value, expr);
      }
      StandardEvaluationContext sec = this.evaluationCache.get(evalContext);
      if (sec == null) {
        sec = new StandardEvaluationContext();
        sec.setRootObject(evalContext);
        sec.addPropertyAccessor(new BeanExpressionContextAccessor());
        sec.addPropertyAccessor(new BeanFactoryAccessor());
        sec.addPropertyAccessor(new MapAccessor());
        sec.addPropertyAccessor(new EnvironmentAccessor());
        sec.setBeanResolver(new BeanFactoryResolver(evalContext.getBeanFactory()));
        sec.setTypeLocator(new StandardTypeLocator(evalContext.getBeanFactory().getBeanClassLoader()));
        ConversionService conversionService = evalContext.getBeanFactory().getConversionService();
        if (conversionService != null) {
          sec.setTypeConverter(new StandardTypeConverter(conversionService));
        }
        customizeEvaluationContext(sec);
        this.evaluationCache.put(evalContext, sec);
      }
      return expr.getValue(sec);
View Full Code Here

Examples of org.springframework.expression.spel.support.StandardEvaluationContext

     * Return the default evaluation context that will be used if none is supplied on an evaluation call
     * @return the default evaluation context
     */
  public EvaluationContext getEvaluationContext() {
    if (defaultContext == null) {
      defaultContext = new StandardEvaluationContext();
    }
    return defaultContext;
  }
View Full Code Here

Examples of org.springframework.expression.spel.support.StandardEvaluationContext

      Expression expr = this.expressionCache.get(value);
      if (expr == null) {
        expr = this.expressionParser.parseExpression(value, this.beanExpressionParserContext);
        this.expressionCache.put(value, expr);
      }
      StandardEvaluationContext sec = this.evaluationCache.get(evalContext);
      if (sec == null) {
        sec = new StandardEvaluationContext();
        sec.setRootObject(evalContext);
        sec.addPropertyAccessor(new BeanExpressionContextAccessor());
        sec.addPropertyAccessor(new BeanFactoryAccessor());
        sec.addPropertyAccessor(new MapAccessor());
        sec.addPropertyAccessor(new EnvironmentAccessor());
        sec.setBeanResolver(new BeanFactoryResolver(evalContext.getBeanFactory()));
        sec.setTypeLocator(new StandardTypeLocator(evalContext.getBeanFactory().getBeanClassLoader()));
        ConversionService conversionService = evalContext.getBeanFactory().getConversionService();
        if (conversionService != null) {
          sec.setTypeConverter(new StandardTypeConverter(conversionService));
        }
        customizeEvaluationContext(sec);
        this.evaluationCache.put(evalContext, sec);
      }
      return expr.getValue(sec);
View Full Code Here

Examples of org.springframework.expression.spel.support.StandardEvaluationContext

    }
    return EVAL_PAGE;
  }

  private EvaluationContext createEvaluationContext(PageContext pageContext) {
    StandardEvaluationContext context = new StandardEvaluationContext();
    context.addPropertyAccessor(new JspPropertyAccessor(pageContext));
    context.addPropertyAccessor(new MapAccessor());
    context.addPropertyAccessor(new EnvironmentAccessor());
    context.setBeanResolver(new BeanFactoryResolver(getRequestContext().getWebApplicationContext()));
    ConversionService conversionService = getConversionService(pageContext);
    if (conversionService != null) {
      context.setTypeConverter(new StandardTypeConverter(conversionService));
    }
    return context;
  }
View Full Code Here

Examples of org.springframework.expression.spel.support.StandardEvaluationContext

            Expression parsedExpression = this.expressionCache.get(expression);
            if (parsedExpression == null) {
                parsedExpression = parser.parseExpression(expression, this.parserContext);
                expressionCache.put(expression, parsedExpression);
            }
            StandardEvaluationContext context = new StandardEvaluationContext(root);
            context.setVariables(evaluationContext);
            context.registerFunction("cGet", CONVERSATION_ACCESSOR);
            context.registerFunction("cBeg", CONVERSATION_INITIATOR);
            context.registerFunction("cEnd", CONVERSATION_TERMINATOR);
            context.registerFunction("cCon", CONVERSATION_CONTINUATOR);
            return parsedExpression.getValue(context);
        } catch (Exception e) {
            throw new ExpressionEvaluationException(expression, e);
        }
    }
View Full Code Here

Examples of org.springframework.expression.spel.support.StandardEvaluationContext

public class CustomWebSecurityExpressionHandler extends
    DefaultWebSecurityExpressionHandler {
  private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
  public EvaluationContext createEvaluationContext(
      Authentication authentication, FilterInvocation fi) {
    StandardEvaluationContext ctx = (StandardEvaluationContext) super
        .createEvaluationContext(authentication, fi);
    SecurityExpressionRoot root = new CustomWebSecurityExpressionRoot(
        authentication, fi.getHttpRequest());
    root.setTrustResolver(trustResolver);
//    AuthenticationTrustResolver atr;
    ctx.setRootObject(root);
    return ctx;
  }
View Full Code Here

Examples of org.springframework.expression.spel.support.StandardEvaluationContext

    return ctx;
  }
  public EvaluationContext createEvaluationContext(
      Authentication authentication, HttpServletRequest req) {
   
        StandardEvaluationContext ctx = new StandardEvaluationContext();
        SecurityExpressionRoot root = new CustomWebSecurityExpressionRoot(authentication, req);
        root.setTrustResolver(trustResolver);
//        root.setRoleHierarchy(roleHierarchy);
        ctx.setRootObject(root);
   
   
//    StandardEvaluationContext ctx = (StandardEvaluationContext) super
//        .createEvaluationContext(authentication, fi);
//    SecurityExpressionRoot root = new CustomWebSecurityExpressionRoot(
View Full Code Here

Examples of org.springframework.expression.spel.support.StandardEvaluationContext

  public final Object getValue(ExpressionState expressionState) throws EvaluationException {
    if (expressionState != null) {
      return getValueInternal(expressionState).getValue();
    } else {
      // configuration not set - does that matter?
      return getValue(new ExpressionState(new StandardEvaluationContext()));
    }
  }
View Full Code Here

Examples of org.springframework.expression.spel.support.StandardEvaluationContext

     * Return the default evaluation context that will be used if none is supplied on an evaluation call
     * @return the default evaluation context
     */
  public EvaluationContext getEvaluationContext() {
    if (defaultContext == null) {
      defaultContext = new StandardEvaluationContext();
    }
    return defaultContext;
  }
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.