Examples of StandardEvaluationContext


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

    executor.execute(context, new Object(), 0, 0);
  }

  @Test
  public void testNegativeBucketSize() throws Exception {
    StandardEvaluationContext context = new StandardEvaluationContext();
    HashMethodExecutor executor = new HashMethodExecutor();
    TypedValue value = executor.execute(context, new Object(), 3, -2);
    assertThat((String) value.getValue(), is("1_hash"));
  }
View Full Code Here

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

    assertThat((String) value.getValue(), is("1_hash"));
  }

  @Test
  public void testNegativeHashcode() throws Exception {
    StandardEvaluationContext context = new StandardEvaluationContext();
    HashMethodExecutor executor = new HashMethodExecutor();
    TypedValue value = executor.execute(context, new Object(), -9, 2);
    assertThat((String) value.getValue(), is("1_hash"));
  }
View Full Code Here

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

    assertThat((String) value.getValue(), is("1_hash"));
  }

  @Test
  public void testNegativeHashcodeBucketSizeBigger() throws Exception {
    StandardEvaluationContext context = new StandardEvaluationContext();
    HashMethodExecutor executor = new HashMethodExecutor();
    TypedValue value = executor.execute(context, new Object(), -9, 12);
    assertThat((String) value.getValue(), is("9_hash"));
    value = executor.execute(context, new Object(), -9, 24);
    assertThat((String) value.getValue(), is("9_hash"));
View Full Code Here

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

   * (non-Javadoc)
   * @see org.springframework.data.mapping.model.SpELContext#getEvaluationContext(java.lang.Object)
   */
  public EvaluationContext getEvaluationContext(Object source) {

    StandardEvaluationContext evaluationContext = new StandardEvaluationContext(source);

    if (accessor != null) {
      evaluationContext.addPropertyAccessor(accessor);
    }

    if (factory != null) {
      evaluationContext.setBeanResolver(new BeanFactoryResolver(factory));
    }

    return evaluationContext;
  }
View Full Code Here

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

   */
  @Override
  public <T extends Parameters<T, ? extends Parameter>> StandardEvaluationContext getEvaluationContext(T parameters,
      Object[] parameterValues) {

    StandardEvaluationContext ec = new StandardEvaluationContext();

    if (beanFactory != null) {
      ec.setBeanResolver(new BeanFactoryResolver(beanFactory));
    }

    ExtensionAwarePropertyAccessor accessor = new ExtensionAwarePropertyAccessor(getExtensions());

    ec.addPropertyAccessor(accessor);
    ec.addPropertyAccessor(new ReflectivePropertyAccessor());
    ec.addMethodResolver(accessor);

    // Add parameters for indexed access
    ec.setRootObject(parameterValues);
    ec.setVariables(collectVariables(parameters, parameterValues));

    return ec;
  }
View Full Code Here

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

            throw new IllegalStateException("Unable to find a ConfigurableBeanFactory");
         }

         BeanExpressionContext beanEvaluationContext = new BeanExpressionContext(beanFactory, null);

         StandardEvaluationContext sec = new StandardEvaluationContext();
         sec.setRootObject(beanEvaluationContext);
         sec.addPropertyAccessor(new BeanExpressionContextAccessor());
         sec.addPropertyAccessor(new BeanFactoryAccessor());
         sec.addPropertyAccessor(new MapAccessor());
         sec.setBeanResolver(new BeanFactoryResolver(beanEvaluationContext.getBeanFactory()));
         sec.setTypeLocator(new StandardTypeLocator(beanEvaluationContext.getBeanFactory().getBeanClassLoader()));
         ConversionService conversionService = beanEvaluationContext.getBeanFactory().getConversionService();
         if (conversionService != null) {
            sec.setTypeConverter(new StandardTypeConverter(conversionService));
         }

         _evaluationContext = sec;
      }
View Full Code Here

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

   * Create a new entity.
   * @param typeInformation the type information of the entity.
   */
  public BasicCouchbasePersistentEntity(final TypeInformation<T> typeInformation) {
    super(typeInformation);
    context = new StandardEvaluationContext();
  }
View Full Code Here

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

        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.support.StandardEvaluationContext

        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())) {
                throw new IllegalArgumentException("Cannot overwrite existing local variable ["+that.getAssignTo()+"]");
View Full Code Here

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

     * Subclasses can override this methode if they want to use a different EL root context
     *
     * @return EL root context which is used to evaluate the expression
     */
    public EvaluationContext createELContext(HttpServletRequest request) {
        return new StandardEvaluationContext(new ELRequestMatcherContext(request));
    }
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.