接口的使用
org.springframework.expression.EvaluationContext
使用EvaluationContext的程序包 程序包 说明 org.springframework.context.expression Expression parsing support within a Spring application context.org.springframework.expression Core abstractions behind the Spring Expression Language.org.springframework.expression.common Common utility classes behind the Spring Expression Language.org.springframework.expression.spel SpEL's central implementation package.org.springframework.expression.spel.ast SpEL's abstract syntax tree.org.springframework.expression.spel.standard SpEL's standard parser implementation.org.springframework.expression.spel.support SpEL's default implementations for various core abstractions.org.springframework.context.expression中EvaluationContext的使用
实现EvaluationContext的org.springframework.context.expression中的类 修饰符和类型 类 说明 classMethodBasedEvaluationContextA method-basedEvaluationContextthat provides explicit support for method-based invocations.参数类型为EvaluationContext的org.springframework.context.expression中的方法 修饰符和类型 方法 说明 booleanBeanExpressionContextAccessor. canRead(EvaluationContext context, Object target, String name)booleanBeanFactoryAccessor. canRead(EvaluationContext context, Object target, String name)booleanEnvironmentAccessor. canRead(EvaluationContext context, Object target, String name)Can read anyEnvironment, thus always returns true.booleanMapAccessor. canRead(EvaluationContext context, Object target, String name)booleanBeanExpressionContextAccessor. canWrite(EvaluationContext context, Object target, String name)booleanBeanFactoryAccessor. canWrite(EvaluationContext context, Object target, String name)booleanEnvironmentAccessor. canWrite(EvaluationContext context, Object target, String name)Read-only: returnsfalse.booleanMapAccessor. canWrite(EvaluationContext context, Object target, String name)TypedValueBeanExpressionContextAccessor. read(EvaluationContext context, Object target, String name)TypedValueBeanFactoryAccessor. read(EvaluationContext context, Object target, String name)TypedValueEnvironmentAccessor. read(EvaluationContext context, Object target, String name)Access the given target object by resolving the given property name against the given target environment.TypedValueMapAccessor. read(EvaluationContext context, Object target, String name)ObjectBeanFactoryResolver. resolve(EvaluationContext context, String beanName)voidBeanExpressionContextAccessor. write(EvaluationContext context, Object target, String name, Object newValue)voidBeanFactoryAccessor. write(EvaluationContext context, Object target, String name, Object newValue)voidEnvironmentAccessor. write(EvaluationContext context, Object target, String name, Object newValue)Read-only: no-op.voidMapAccessor. write(EvaluationContext context, Object target, String name, Object newValue)org.springframework.expression中EvaluationContext的使用
参数类型为EvaluationContext的org.springframework.expression中的方法 修饰符和类型 方法 说明 booleanPropertyAccessor. canRead(EvaluationContext context, Object target, String name)Called to determine if a resolver instance is able to access a specified property on a specified target object.booleanPropertyAccessor. canWrite(EvaluationContext context, Object target, String name)Called to determine if a resolver instance is able to write to a specified property on a specified target object.TypedValueConstructorExecutor. execute(EvaluationContext context, Object... arguments)Execute a constructor in the specified context using the specified arguments.TypedValueMethodExecutor. execute(EvaluationContext context, Object target, Object... arguments)Execute a command using the specified arguments, and using the specified expression state.ObjectExpression. getValue(EvaluationContext context)Evaluate this expression in the provided context and return the result of evaluation.<T> TExpression. getValue(EvaluationContext context, Class<T> desiredResultType)Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc.ObjectExpression. getValue(EvaluationContext context, Object rootObject)Evaluate this expression in the provided context and return the result of evaluation, but use the supplied root context as an override for any default root object specified in the context.<T> TExpression. getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType)Evaluate the expression in a specified context which can resolve references to properties, methods, types, etc.Class<?>Expression. getValueType(EvaluationContext context)Return the most general type that can be passed to theExpression.setValue(EvaluationContext, Object)method for the given context.Class<?>Expression. getValueType(EvaluationContext context, Object rootObject)Return the most general type that can be passed to theExpression.setValue(EvaluationContext, Object, Object)method for the given context.TypeDescriptorExpression. getValueTypeDescriptor(EvaluationContext context)Return the most general type that can be passed to theExpression.setValue(EvaluationContext, Object)method for the given context.TypeDescriptorExpression. getValueTypeDescriptor(EvaluationContext context, Object rootObject)Return the most general type that can be passed to theExpression.setValue(EvaluationContext, Object, Object)method for the given context.booleanExpression. isWritable(EvaluationContext context)Determine if an expression can be written to, i.e. setValue() can be called.booleanExpression. isWritable(EvaluationContext context, Object rootObject)Determine if an expression can be written to, i.e. setValue() can be called.TypedValuePropertyAccessor. read(EvaluationContext context, Object target, String name)Called to read a property from a specified target object.ObjectBeanResolver. resolve(EvaluationContext context, String beanName)Look up a bean by the given name and return a corresponding instance for it.ConstructorExecutorConstructorResolver. resolve(EvaluationContext context, String typeName, List<TypeDescriptor> argumentTypes)Within the supplied context determine a suitable constructor on the supplied type that can handle the specified arguments.MethodExecutorMethodResolver. resolve(EvaluationContext context, Object targetObject, String name, List<TypeDescriptor> argumentTypes)Within the supplied context determine a suitable method on the supplied object that can handle the specified arguments.voidExpression. setValue(EvaluationContext context, Object value)Set this expression in the provided context to the value provided.voidExpression. setValue(EvaluationContext context, Object rootObject, Object value)Set this expression in the provided context to the value provided.voidPropertyAccessor. write(EvaluationContext context, Object target, String name, Object newValue)Called to write to a property on a specified target object.org.springframework.expression.common中EvaluationContext的使用
参数类型为EvaluationContext的org.springframework.expression.common中的方法 修饰符和类型 方法 说明 static <T> TExpressionUtils. convertTypedValue(EvaluationContext context, TypedValue typedValue, Class<T> targetType)Determines if there is a type converter available in the specified context and attempts to use it to convert the supplied value to the specified type.StringCompositeStringExpression. getValue(EvaluationContext context)<T> TCompositeStringExpression. getValue(EvaluationContext context, Class<T> expectedResultType)StringCompositeStringExpression. getValue(EvaluationContext context, Object rootObject)<T> TCompositeStringExpression. getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType)StringLiteralExpression. getValue(EvaluationContext context)<T> TLiteralExpression. getValue(EvaluationContext context, Class<T> expectedResultType)StringLiteralExpression. getValue(EvaluationContext context, Object rootObject)<T> TLiteralExpression. getValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType)Class<?>CompositeStringExpression. getValueType(EvaluationContext context)Class<?>CompositeStringExpression. getValueType(EvaluationContext context, Object rootObject)Class<?>LiteralExpression. getValueType(EvaluationContext context)Class<?>LiteralExpression. getValueType(EvaluationContext context, Object rootObject)TypeDescriptorCompositeStringExpression. getValueTypeDescriptor(EvaluationContext context)TypeDescriptorCompositeStringExpression. getValueTypeDescriptor(EvaluationContext context, Object rootObject)TypeDescriptorLiteralExpression. getValueTypeDescriptor(EvaluationContext context)TypeDescriptorLiteralExpression. getValueTypeDescriptor(EvaluationContext context, Object rootObject)booleanCompositeStringExpression. isWritable(EvaluationContext context)booleanCompositeStringExpression. isWritable(EvaluationContext context, Object rootObject)booleanLiteralExpression. isWritable(EvaluationContext context)booleanLiteralExpression. isWritable(EvaluationContext context, Object rootObject)voidCompositeStringExpression. setValue(EvaluationContext context, Object value)voidCompositeStringExpression. setValue(EvaluationContext context, Object rootObject, Object value)voidLiteralExpression. setValue(EvaluationContext context, Object value)voidLiteralExpression. setValue(EvaluationContext context, Object rootObject, Object value)org.springframework.expression.spel中EvaluationContext的使用
返回EvaluationContext的org.springframework.expression.spel中的方法 修饰符和类型 方法 说明 EvaluationContextExpressionState. getEvaluationContext()参数类型为EvaluationContext的org.springframework.expression.spel中的方法 修饰符和类型 方法 说明 abstract ObjectCompiledExpression. getValue(Object target, EvaluationContext context)Subclasses of CompiledExpression generated by SpelCompiler will provide an implementation of this method.参数类型为EvaluationContext的org.springframework.expression.spel中的构造器 构造器 说明 ExpressionState(EvaluationContext context)ExpressionState(EvaluationContext context, SpelParserConfiguration configuration)ExpressionState(EvaluationContext context, TypedValue rootObject)ExpressionState(EvaluationContext context, TypedValue rootObject, SpelParserConfiguration configuration)org.springframework.expression.spel.ast中EvaluationContext的使用
参数类型为EvaluationContext的org.springframework.expression.spel.ast中的方法 修饰符和类型 方法 说明 static booleanOperator. equalityCheck(EvaluationContext context, Object left, Object right)Perform an equality check for the given operand values.booleanPropertyOrFieldReference. isWritableProperty(String name, TypedValue contextObject, EvaluationContext evalContext)org.springframework.expression.spel.standard中EvaluationContext的使用
返回EvaluationContext的org.springframework.expression.spel.standard中的方法 修饰符和类型 方法 说明 EvaluationContextSpelExpression. getEvaluationContext()Return the default evaluation context that will be used if none is supplied on an evaluation call.参数类型为EvaluationContext的org.springframework.expression.spel.standard中的方法 修饰符和类型 方法 说明 ObjectSpelExpression. getValue(EvaluationContext context)<T> TSpelExpression. getValue(EvaluationContext context, Class<T> expectedResultType)ObjectSpelExpression. getValue(EvaluationContext context, Object rootObject)<T> TSpelExpression. getValue(EvaluationContext context, Object rootObject, Class<T> expectedResultType)Class<?>SpelExpression. getValueType(EvaluationContext context)Class<?>SpelExpression. getValueType(EvaluationContext context, Object rootObject)TypeDescriptorSpelExpression. getValueTypeDescriptor(EvaluationContext context)TypeDescriptorSpelExpression. getValueTypeDescriptor(EvaluationContext context, Object rootObject)booleanSpelExpression. isWritable(EvaluationContext context)booleanSpelExpression. isWritable(EvaluationContext context, Object rootObject)voidSpelExpression. setEvaluationContext(EvaluationContext evaluationContext)Set the evaluation context that will be used if none is specified on an evaluation call.voidSpelExpression. setValue(EvaluationContext context, Object value)voidSpelExpression. setValue(EvaluationContext context, Object rootObject, Object value)org.springframework.expression.spel.support中EvaluationContext的使用
实现EvaluationContext的org.springframework.expression.spel.support中的类 修饰符和类型 类 说明 classSimpleEvaluationContextA basic implementation ofEvaluationContextthat focuses on a subset of essential SpEL features and customization options, targeting simple condition evaluation and in particular data binding scenarios.classStandardEvaluationContextA powerful and highly configurableEvaluationContextimplementation.参数类型为EvaluationContext的org.springframework.expression.spel.support中的方法 修饰符和类型 方法 说明 booleanReflectivePropertyAccessor. canRead(EvaluationContext context, Object target, String name)booleanReflectivePropertyAccessor.OptimalPropertyAccessor. canRead(EvaluationContext context, Object target, String name)booleanReflectivePropertyAccessor. canWrite(EvaluationContext context, Object target, String name)booleanReflectivePropertyAccessor.OptimalPropertyAccessor. canWrite(EvaluationContext context, Object target, String name)PropertyAccessorReflectivePropertyAccessor. createOptimalAccessor(EvaluationContext context, Object target, String name)Attempt to create an optimized property accessor tailored for a property of a particular name on a particular class.TypedValueReflectiveConstructorExecutor. execute(EvaluationContext context, Object... arguments)TypedValueReflectiveMethodExecutor. execute(EvaluationContext context, Object target, Object... arguments)TypedValueReflectivePropertyAccessor.OptimalPropertyAccessor. read(EvaluationContext context, Object target, String name)TypedValueReflectivePropertyAccessor. read(EvaluationContext context, Object target, String name)MethodExecutorDataBindingMethodResolver. resolve(EvaluationContext context, Object targetObject, String name, List<TypeDescriptor> argumentTypes)ConstructorExecutorReflectiveConstructorResolver. resolve(EvaluationContext context, String typeName, List<TypeDescriptor> argumentTypes)Locate a constructor on the type.MethodExecutorReflectiveMethodResolver. resolve(EvaluationContext context, Object targetObject, String name, List<TypeDescriptor> argumentTypes)Locate a method on a type.voidReflectivePropertyAccessor.OptimalPropertyAccessor. write(EvaluationContext context, Object target, String name, Object newValue)voidReflectivePropertyAccessor. write(EvaluationContext context, Object target, String name, Object newValue)