Top Fields Constructors Methods
com.sun.el

public Class ExpressionFactoryImpl

extends ExpressionFactory
Class Inheritance
Imports
java.lang.reflect.Method, java.util.HashMap, .Map, .Properties, javax.el.ELContext, .ELException, .ELResolver, .ExpressionFactory, .MethodExpression, .ValueExpression, com.sun.el.lang.ELSupport, .ExpressionBuilder, com.sun.el.stream.StreamELResolver, com.sun.el.util.MessageFactory

Authors
Jacob Hookom [[email protected]], Kin-man Chung
Version
$Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: kchung $
See Also
javax.el.ExpressionFactory

Field Summary

Modifier and TypeField and Description
private boolean
private Properties

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public Object
coerceToType(Object
The object to coerce.
obj
,
Class<?>
The target type for the coercion.
type
)

Implements abstract javax.el.ExpressionFactory.coerceToType.

Coerces an object to a specific type according to the EL type conversion rules.
public MethodExpression
createMethodExpression(ELContext
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.

context
,
String
The expression to parse
expression
,
Class<?>
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.
expectedReturnType
,
Class<?>[]
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.
expectedParamTypes
)

Implements abstract javax.el.ExpressionFactory.createMethodExpression.

Parses an expression into a MethodExpression for later evaluation.
public ValueExpression
createValueExpression(ELContext
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.

context
,
String
The expression to parse
expression
,
Class<?>
The type the result of the expression will be coerced to after evaluation.
expectedType
)

Implements abstract javax.el.ExpressionFactory.createValueExpression.

Parses an expression into a ValueExpression for later evaluation.
public ValueExpression
createValueExpression(Object
The object instance to be wrapped.
instance
,
Class<?>
The type the result of the expression will be coerced to after evaluation. There will be no coercion if it is Object.class,
expectedType
)

Implements abstract javax.el.ExpressionFactory.createValueExpression.

Creates a ValueExpression that wraps an object instance.
public Map<String, Method>
getInitFunctionMap()

Overrides javax.el.ExpressionFactory.getInitFunctionMap.

Retrieve a function map containing a pre-configured function mapping.
public String
public ELResolver
getStreamELResolver()

Overrides javax.el.ExpressionFactory.getStreamELResolver.

Retrieves an ELResolver that implements the operations in collections.
Inherited from javax.el.ExpressionFactory:
newInstancenewInstance

Field Detail

isBackwardCompatible22back to summary
private boolean isBackwardCompatible22
propertiesback to summary
private Properties properties

Constructor Detail

ExpressionFactoryImplback to summary
public ExpressionFactoryImpl()
ExpressionFactoryImplback to summary
public ExpressionFactoryImpl(Properties properties)

Method Detail

coerceToTypeback to summary
public Object coerceToType(Object obj, Class<?> type)

Implements abstract javax.el.ExpressionFactory.coerceToType.

Doc from javax.el.ExpressionFactory.coerceToType.

Coerces an object to a specific type according to the EL type conversion rules. The custom type conversions in the ELResolvers are not considered.

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

Parameters
obj:Object

The object to coerce.

type:Class<?>

The target type for the coercion.

Annotations
@Override
createMethodExpressionback to summary
public MethodExpression createMethodExpression(ELContext context, String expression, Class<?> expectedReturnType, Class<?>[] expectedParamTypes)

Implements abstract javax.el.ExpressionFactory.createMethodExpression.

Doc from javax.el.ExpressionFactory.createMethodExpression.

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.

Parameters
context:ELContext

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:String

The expression to parse

expectedReturnType:Class<?>

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:Class<?>[]

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.

Returns:MethodExpression

The parsed expression

Annotations
@Override
createValueExpressionback to summary
public ValueExpression createValueExpression(ELContext context, String expression, Class<?> expectedType)

Implements abstract javax.el.ExpressionFactory.createValueExpression.

Doc from javax.el.ExpressionFactory.createValueExpression.

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:ELContext

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:String

The expression to parse

expectedType:Class<?>

The type the result of the expression will be coerced to after evaluation.

Returns:ValueExpression

The parsed expression

Annotations
@Override
createValueExpressionback to summary
public ValueExpression createValueExpression(Object instance, Class<?> expectedType)

Implements abstract javax.el.ExpressionFactory.createValueExpression.

Doc from javax.el.ExpressionFactory.createValueExpression.

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.

Parameters
instance:Object

The object instance to be wrapped.

expectedType:Class<?>

The type the result of the expression will be coerced to after evaluation. There will be no coercion if it is Object.class,

Annotations
@Override
getInitFunctionMapback to summary
public Map<String, Method> getInitFunctionMap()

Overrides javax.el.ExpressionFactory.getInitFunctionMap.

Doc from javax.el.ExpressionFactory.getInitFunctionMap.

Retrieve a function map containing a pre-configured function mapping. It must include the following functions.

  • linq:range
  • linq:repeat
  • linq:_empty
Returns:Map<String, Method>

A initial map for functions, null if there is none.

Annotations
@Override
getPropertyback to summary
public String getProperty(String key)
getStreamELResolverback to summary
public ELResolver getStreamELResolver()

Overrides javax.el.ExpressionFactory.getStreamELResolver.

Doc from javax.el.ExpressionFactory.getStreamELResolver.

Retrieves an ELResolver that implements the operations in collections.

This ELResolver resolves the method invocation on the pair (base, property) when base is a Collection or a Map, and property is the name of the operation.

See EL.2 for detailed descriptions of these operators, their arguments, and return values.

Returns:ELResolver

The ELResolver that implements the Query Operators.

Annotations
@Override