createValueExpression
来源:互联网 发布:java编程题app 编辑:程序博客网 时间:2024/05/16 17:47
javax.el
Class ExpressionFactory
java.lang.Object javax.el.ExpressionFactory
public abstract class ExpressionFactory
- extends Object
ExpressionFactory()
abstract Object
coerceToType(Object obj, Class<?> targetType)
Coerces an object to a specific type according to the EL type conversion rules.
abstract MethodExpression
createMethodExpression(ELContext context, String expression, Class<?> expectedReturnType, Class<?>[] expectedParamTypes)
Parses an expression into a
MethodExpression
for later evaluation.abstract ValueExpression
createValueExpression(ELContext context, String expression, Class<?> expectedType)
Parses an expression into a
ValueExpression
for later evaluation.abstract ValueExpression
createValueExpression(Object instance, Class<?> expectedType)
Creates a ValueExpression that wraps an object instance.
static ExpressionFactory
newInstance()
Creates a new instance of a
ExpressionFactory
.static ExpressionFactory
newInstance(Properties properties)
Create a new instance of a
ExpressionFactory
, with optional properties. clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
ExpressionFactory
public ExpressionFactory()
newInstance
public static ExpressionFactory newInstance()
- Creates a new instance of a
ExpressionFactory
. This method uses the following ordered lookup procedure to determine theExpressionFactory
implementation class to load:- Use the Services API (as detailed in the JAR specification). If a resource with the name of
META-INF/services/javax.el.ExpressionFactory
exists, then its first line, if present, is used as the UTF-8 encoded name of the implementation class. - Use the properties file "lib/el.properties" in the JRE directory. If this file exists and it is readable by the
java.util.Properties.load(InputStream)
method, and it contains an entry whose key is "javax.el.ExpressionFactory", then the value of that entry is used as the name of the implementation class. - Use the
javax.el.ExpressionFactory
system property. If a system property with this name is defined, then its value is used as the name of the implementation class. - Use a platform default implementation.
- Use the Services API (as detailed in the JAR specification). If a resource with the name of
newInstance
public static ExpressionFactory newInstance(Properties properties)
Create a new instance of a
ExpressionFactory
, with optional properties. This method uses the same lookup procedure as the one used innewInstance()
.If the argument
properties
is not null, and if the implementation contains a constructor with a single parameter of typejava.util.Properties
, then the constructor is used to create the instance.Properties are optional and can be ignored by an implementation.
The name of a property should start with "javax.el."
The following are some suggested names for properties.
- javax.el.cacheSize
- Parameters:
properties
- Properties passed to the implementation. If null, then no properties.
createValueExpression
public abstract ValueExpression createValueExpression(ELContext context, String expression, Class<?> expectedType)
- Parses an expression into a
ValueExpression
for later evaluation. Use this method for expressions that refer to values.This method should perform syntactic validation of the expression. If in doing so it detects errors, it should raise an
ELException
. - Parameters:
context
- The EL context used to parse the expression. TheFunctionMapper
andVariableMapper
stored in the ELContext are used to resolve functions and variables found in the expression. They can benull
, in which case functions or variables are not supported for this expression. The object returned must invoke the same functions and access the same variable mappings regardless of whether the mappings in the providedFunctionMapper
andVariableMapper
instances change between callingExpressionFactory.createValueExpression()
and any method onValueExpression
.Note that within the EL, the ${} and #{} syntaxes are treated identically. This includes the use of VariableMapper and FunctionMapper at expression creation time. Each is invoked if not null, independent of whether the #{} or ${} syntax is used for the expression.
expression
- The expression to parseexpectedType
- The type the result of the expression will be coerced to after evaluation.- Returns:
- The parsed expression
- Throws:
NullPointerException
- Thrown if expectedType is null.ELException
- Thrown if there are syntactical errors in the provided expression.
- createValueExpression
- awk笔记
- 客户端自行连苹果服务器验证购买完成返回的receipt
- Android基础-04
- FireBlue QN9020 QN9021 QN902x Proximity Reportor profile(防丢器) 之源码分析 (三)广播
- 【架构】 Nginx动静分离
- createValueExpression
- Managing Jobs
- 面试前,你最该做的一件事情!
- tomcat启动报错java.lang.LinkageError
- Java中的三种对字符串反向输出的方法
- 主干测试总流程
- Linux Fdisk 分区使用手册
- Linux装机利器Cobbler安装配置
- 快速学Python 和 易犯错误(文本处理)