001/*002 * Copyright 2002-2018 the original author or authors.003 *004 * Licensed under the Apache License, Version 2.0 (the "License");005 * you may not use this file except in compliance with the License.006 * You may obtain a copy of the License at007 *008 * https://www.apache.org/licenses/LICENSE-2.0009 *010 * Unless required by applicable law or agreed to in writing, software011 * distributed under the License is distributed on an "AS IS" BASIS,012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.013 * See the License for the specific language governing permissions and014 * limitations under the License.015 */016017package org.springframework.expression.spel.support;018019import java.lang.reflect.Method;020import java.util.ArrayList;021import java.util.List;022import java.util.Map;023import java.util.concurrent.ConcurrentHashMap;024025import org.springframework.core.convert.TypeDescriptor;026import org.springframework.expression.BeanResolver;027import org.springframework.expression.ConstructorResolver;028import org.springframework.expression.EvaluationContext;029import org.springframework.expression.MethodFilter;030import org.springframework.expression.MethodResolver;031import org.springframework.expression.OperatorOverloader;032import org.springframework.expression.PropertyAccessor;033import org.springframework.expression.TypeComparator;034import org.springframework.expression.TypeConverter;035import org.springframework.expression.TypeLocator;036import org.springframework.expression.TypedValue;037import org.springframework.lang.Nullable;038import org.springframework.util.Assert;039040/**041 * A powerful and highly configurable {@link EvaluationContext} implementation.042 * This context uses standard implementations of all applicable strategies,043 * based on reflection to resolve properties, methods and fields.044 *045 * <p>For a simpler builder-style context variant for data-binding purposes,046 * consider using {@link SimpleEvaluationContext} instead which allows for047 * opting into several SpEL features as needed by specific evaluation cases.048 *049 * @author Andy Clement050 * @author Juergen Hoeller051 * @author Sam Brannen052 * @since 3.0053 * @see SimpleEvaluationContext054 * @see ReflectivePropertyAccessor055 * @see ReflectiveConstructorResolver056 * @see ReflectiveMethodResolver057 * @see StandardTypeLocator058 * @see StandardTypeConverter059 * @see StandardTypeComparator060 * @see StandardOperatorOverloader061 */062public class StandardEvaluationContext implements EvaluationContext {063064 private TypedValue rootObject;065066 @Nullable067 private volatile List<PropertyAccessor> propertyAccessors;068069 @Nullable070 private volatile List<ConstructorResolver> constructorResolvers;071072 @Nullable073 private volatile List<MethodResolver> methodResolvers;074075 @Nullable076 private volatile ReflectiveMethodReso