Esempio n. 1
0
        public ExpressionState(IEvaluationContext context, ITypedValue rootObject, SpelParserOptions configuration)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            _relatedContext = context;
            _rootObject     = rootObject;
            _configuration  = configuration;
        }
Esempio n. 2
0
        public void IndexIntoGenericPropertyContainingNullList()
        {
            var configuration = new SpelParserOptions(true, true);
            var parser        = new SpelExpressionParser(configuration);
            var expression    = parser.ParseExpression("Property");

            Assert.Equal(typeof(object), expression.GetValueType(this));
            Assert.Equal(Property, expression.GetValue(this));
            expression = parser.ParseExpression("Property[0]");
            try
            {
                Assert.Equal("bar", expression.GetValue(this));
            }
            catch (EvaluationException ex)
            {
                Assert.StartsWith("EL1027E", ex.Message);
            }
        }
Esempio n. 3
0
        public void IndexIntoGenericPropertyContainingGrowingList2()
        {
            var property2 = new ArrayList();

            Property2 = property2;
            var configuration = new SpelParserOptions(true, true);
            var parser        = new SpelExpressionParser(configuration);
            var expression    = parser.ParseExpression("Property2");

            Assert.Equal(typeof(ArrayList), expression.GetValueType(this));
            Assert.Equal(property2, expression.GetValue(this));
            expression = parser.ParseExpression("Property2[0]");
            try
            {
                Assert.Equal("bar", expression.GetValue(this));
            }
            catch (EvaluationException ex)
            {
                Assert.StartsWith("EL1053E", ex.Message);
            }
        }
Esempio n. 4
0
 public ExpressionState(IEvaluationContext context, SpelParserOptions configuration)
     : this(context, context.RootObject, configuration)
 {
 }