Examples of EvaluationContext


Examples of org.jboss.el.lang.EvaluationContext

     *
     * @see javax.el.ValueExpression#getValue(javax.el.ELContext)
     */
    public Object getValue(ELContext context) throws PropertyNotFoundException,
            ELException {
        EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
                this.varMapper);
        Object value = this.getNode().getValue(ctx);
        if (this.expectedType != null) {
            return ELSupport.coerceToType(value, this.expectedType);
        }
View Full Code Here

Examples of org.jboss.el.lang.EvaluationContext

     *
     * @see javax.el.ValueExpression#isReadOnly(javax.el.ELContext)
     */
    public boolean isReadOnly(ELContext context)
            throws PropertyNotFoundException, ELException {
        EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
                this.varMapper);
        return this.getNode().isReadOnly(ctx);
    }
View Full Code Here

Examples of org.jboss.el.lang.EvaluationContext

     *      java.lang.Object)
     */
    public void setValue(ELContext context, Object value)
            throws PropertyNotFoundException, PropertyNotWritableException,
            ELException {
        EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
                this.varMapper);
        this.getNode().setValue(ctx, value);
    }
View Full Code Here

Examples of org.noname.designer.core.interfaces.EvaluationContext

  }

  @Override
  protected IStatus run(IProgressMonitor monitor) {
    if (componentType != null) {
      EvaluationContext context = createContext();
      TypeDeclaration typeDec = getCompTypeDeclaration();
      if (typeDec != null) {
        MethodDeclaration constructor = getConstructor(typeDec);
        if (constructor != null) {
          IEvaluator evaluator = (IEvaluator) Platform
              .getAdapterManager().getAdapter(constructor,
                  IEvaluator.class);
          if (evaluator != null) {
            int result = evaluator.evaluate(context);
            FrameContext consFrame = context.popup();
            if (result == IEvaluator.RETURN) {
              System.out.println("this="
                  + context.getThisObject());
              for (String fieldName : context.getFieldNames()) {
                System.out.println(fieldName + "="
                    + context.getField(fieldName));
              }
            } else if (result == IEvaluator.THROW) {
              Throwable throwable = (Throwable) consFrame.getResult();
              throwable.printStackTrace();
            }
View Full Code Here

Examples of org.noname.designer.core.interfaces.EvaluationContext

    return Status.CANCEL_STATUS;
  }

  private EvaluationContext createContext() {
    Object thisObj = createObject(componentType);
    EvaluationContext context = new EvaluationContext(thisObj);
    FrameContext frame = new FrameContext();
    context.push(frame);
    VariableContext arguments = new VariableContext();
    frame.push(arguments);
    return context;
  }
View Full Code Here

Examples of org.springframework.expression.EvaluationContext

                    expr + "\"", e);
        }

        final FilterInvocation filterInvocation = new FilterInvocation(request, response, DUMMY_CHAIN);
       
        final EvaluationContext evaluationContext = handler.createEvaluationContext(authentication, filterInvocation);
       
        /*
         * Initialize the context variables map.
         *
         * This will allow SpringSecurity expressions to include any variables from
         * the IContext just by accessing them as properties of the "#vars" utility object.
         */
        Map<String,Object> contextVariables = null;
        if (processingContext instanceof Arguments) {
            // Try to initialize the context variables by asking the SpEL expression
            // evaluator object (which might be a subclass of the standard one) to create
            // this variable map.
           
            final Arguments arguments = (Arguments) processingContext;
            final IStandardVariableExpressionEvaluator expressionEvaluator =
                    StandardExpressions.getVariableExpressionEvaluator(arguments.getConfiguration());

            contextVariables =
                    SpringVersionSpecificUtils.computeExpressionObjectsFromExpressionEvaluator(arguments, expressionEvaluator);

        }
       
        if (contextVariables == null) {
            // if we could not create it the more integrated way, just do it the hard-wired way
            contextVariables = new HashMap<String, Object>();
           
            final Map<String,Object> expressionObjects = processingContext.getExpressionObjects();
            if (expressionObjects != null) {
                contextVariables.putAll(expressionObjects);
            }
           
        }
       
       
        // We add Thymeleaf's wrapper on top of the SpringSecurity basic evaluation context
        final EvaluationContext wrappedEvaluationContext =
                SpringVersionSpecificUtils.wrapEvaluationContext(evaluationContext, contextVariables);

       
        if (ExpressionUtils.evaluateAsBoolean(expressionObject, wrappedEvaluationContext)) {

View Full Code Here

Examples of org.springframework.expression.EvaluationContext

  }

  private Object evaluateExpression(String expression, Object[] args) {

    DefaultParameters parameters = new DefaultParameters(method);
    EvaluationContext evaluationContext = provider.getEvaluationContext(parameters, args);
    return new SpelExpressionParser().parseExpression(expression).getValue(evaluationContext);
  }
View Full Code Here

Examples of org.springframework.expression.EvaluationContext

        SpelExpressionParser parser = new SpelExpressionParser();
        expression = parser.parseExpression(el);
    }

    public boolean matches(HttpServletRequest request) {
        EvaluationContext context = createELContext(request);
        return expression.getValue(context, Boolean.class).booleanValue();
    }
View Full Code Here

Examples of org.springframework.expression.EvaluationContext

public class ExpressionBasedPreInvocationAdvice implements PreInvocationAuthorizationAdvice {
    private MethodSecurityExpressionHandler expressionHandler = new DefaultMethodSecurityExpressionHandler();

    public boolean before(Authentication authentication, MethodInvocation mi, PreInvocationAttribute attr) {
        PreInvocationExpressionAttribute preAttr = (PreInvocationExpressionAttribute) attr;
        EvaluationContext ctx = expressionHandler.createEvaluationContext(authentication, mi);
        Expression preFilter = preAttr.getFilterExpression();
        Expression preAuthorize = preAttr.getAuthorizeExpression();

        if (preFilter != null) {
            Object filterTarget = findFilterTarget(preAttr.getFilterTarget(), ctx, mi);
View Full Code Here

Examples of org.springframework.expression.EvaluationContext

    }

    public Object after(Authentication authentication, MethodInvocation mi,
            PostInvocationAttribute postAttr, Object returnedObject) throws AccessDeniedException{
        PostInvocationExpressionAttribute pia = (PostInvocationExpressionAttribute) postAttr;
        EvaluationContext ctx = expressionHandler.createEvaluationContext(authentication, mi);
        Expression postFilter = pia.getFilterExpression();
        Expression postAuthorize = pia.getAuthorizeExpression();

        if (postFilter != null) {
            if (logger.isDebugEnabled()) {
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.