com.sun.el
类 ExpressionFactoryImpl

java.lang.Object
  继承者 javax.el.ExpressionFactory
      继承者 com.sun.el.ExpressionFactoryImpl

public class ExpressionFactoryImpl
extends ExpressionFactory

版本:
$Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: hmalphett $
作者:
Jacob Hookom [jacob@hookom.net]
另请参见:
ExpressionFactory

构造方法摘要
ExpressionFactoryImpl()
           
 
方法摘要
 Object coerceToType(Object obj, Class type)
          Coerces an object to a specific type according to the EL type conversion rules.
 MethodExpression createMethodExpression(ELContext context, String expression, Class expectedReturnType, Class[] expectedParamTypes)
          Parses an expression into a MethodExpression for later evaluation.
 ValueExpression createValueExpression(ELContext context, String expression, Class expectedType)
          Parses an expression into a ValueExpression for later evaluation.
 ValueExpression createValueExpression(Object instance, Class expectedType)
          Creates a ValueExpression that wraps an object instance.
 
从类 javax.el.ExpressionFactory 继承的方法
newInstance, newInstance
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ExpressionFactoryImpl

public ExpressionFactoryImpl()
方法详细信息

coerceToType

public Object coerceToType(Object obj,
                           Class type)
从类 ExpressionFactory 复制的描述
Coerces an object to a specific type according to the EL type conversion rules.

An ELException is thrown if an error results from applying the conversion rules.

指定者:
ExpressionFactory 中的 coerceToType
参数:
obj - The object to coerce.
type - The target type for the coercion.

createMethodExpression

public MethodExpression createMethodExpression(ELContext context,
                                               String expression,
                                               Class expectedReturnType,
                                               Class[] expectedParamTypes)
从类 ExpressionFactory 复制的描述
Parses an expression into a MethodExpression for later evaluation. Use this method for expressions that refer to methods.

If the expression is a String literal, a MethodExpression is created, which when invoked, returns the String literal, coerced to expectedReturnType. An ELException is thrown if expectedReturnType is void or if the coercion of the String literal to the expectedReturnType yields an error (see Section "1.16 Type Conversion").

This method should perform syntactic validation of the expression. If in doing so it detects errors, it should raise an ELException.

指定者:
ExpressionFactory 中的 createMethodExpression
参数:
context - The EL context used to parse the expression. The FunctionMapper and VariableMapper stored in the ELContext are used to resolve functions and variables found in the expression. They can be null, 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 provided FunctionMapper and VariableMapper instances change between calling ExpressionFactory.createMethodExpression() and any method on MethodExpression.

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 parse
expectedReturnType - The expected return type for the method to be found. After evaluating the expression, the MethodExpression must check that the return type of the actual method matches this type. Passing in a value of null indicates the caller does not care what the return type is, and the check is disabled.
expectedParamTypes - The expected parameter types for the method to be found. Must be an array with no elements if there are no parameters expected. It is illegal to pass null, unless the method is specified with arugments in the EL expression, in which case these arguments are used for method selection, and this parameter is ignored.
返回:
The parsed expression

createValueExpression

public ValueExpression createValueExpression(ELContext context,
                                             String expression,
                                             Class expectedType)
从类 ExpressionFactory 复制的描述
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.

指定者:
ExpressionFactory 中的 createValueExpression
参数:
context - The EL context used to parse the expression. The FunctionMapper and VariableMapper stored in the ELContext are used to resolve functions and variables found in the expression. They can be null, 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 provided FunctionMapper and VariableMapper instances change between calling ExpressionFactory.createValueExpression() and any method on ValueExpression.

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 parse
expectedType - The type the result of the expression will be coerced to after evaluation.
返回:
The parsed expression

createValueExpression

public ValueExpression createValueExpression(Object instance,
                                             Class expectedType)
从类 ExpressionFactory 复制的描述
Creates a ValueExpression that wraps an object instance. This method can be used to pass any object as a ValueExpression. The wrapper ValueExpression is read only, and returns the wrapped object via its getValue() method, optionally coerced.

指定者:
ExpressionFactory 中的 createValueExpression
参数:
instance - The object instance to be wrapped.
expectedType - The type the result of the expression will be coerced to after evaluation. There will be no coercion if it is Object.class,


Copyright © 2013. All Rights Reserved.