Top Description Fields Constructors Methods
javax.el

public Class ELManager

extends Object
Class Inheritance
Imports
java.lang.reflect.Method

Manages EL parsing and evaluation environment. The ELManager maintains an instance of ExpressionFactory and StandardELContext, for parsing and evaluating EL expressions.

Since
EL 3.0

Field Summary

Modifier and TypeField and Description
private StandardELContext

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addBeanNameResolver(BeanNameResolver
The BeanNameResolver to be registered.
bnr
)

Register a BeanNameResolver.

public void
addELResolver(ELResolver
The ELResolver to be added to the list of ELResolvers in ELContext.
elr
)

Add an user defined ELResolver to the list of ELResolvers.

public void
addEvaluationListener(EvaluationListener
The evaluation listener to be added.
listener
)

Register an evaluation listener.

public Object
defineBean(String
The name of the bean
name
,
Object
The bean instance to be defined. If null, the definition of the bean is removed.
bean
)

Define a bean in the local bean repository

public StandardELContext

Returns:

The ELContext used for parsing and evaluating EL expressions..
getELContext
()

Return the ELContext used for parsing and evaluating EL expressions.

public static ExpressionFactory

Returns:

The ExpressionFactory
getExpressionFactory
()

Return the ExpressionFactory instance used for EL evaluations.

public void
importClass(String
The full class name of the class to be imported
className
)

Import a class.

public void
importPackage(String
The package name to be imported
packageName
)

Import a package.

public void
importStatic(String
The full class name of the class to be imported
staticMemberName
)

Import a static field or method.

public void
mapFunction(String
The namespace of the functions, can be "".
prefix
,
String
The name of the function.
function
,
Method
The static method to be invoked when the function is used.
meth
)

Maps a static method to an EL function.

public ELContext

Returns:

The previous ELContext, null if none.
setELContext
(ELContext
The new ELContext.
context
)

Set the ELContext used for parsing and evaluating EL expressions.

public void
setVariable(String
The variable name
variable
,
ValueExpression
The ValueExpression to be assigned to the variable.
expression
)

Assign a ValueExpression to an EL variable, replacing any previous assignment to the same variable.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

elContextback to summary
private StandardELContext elContext

Constructor Detail

ELManagerback to summary
public ELManager()

Method Detail

addBeanNameResolverback to summary
public void addBeanNameResolver(BeanNameResolver bnr)

Register a BeanNameResolver. Construct a BeanNameELResolver with the BeanNameResolver and add it to the list of ELResolvers. Once registered, the BeanNameResolver cannot be removed.

Parameters
bnr:BeanNameResolver

The BeanNameResolver to be registered.

addELResolverback to summary
public void addELResolver(ELResolver elr)

Add an user defined ELResolver to the list of ELResolvers. Can be called multiple times. The new ELResolver is placed ahead of the default ELResolvers. The list of the ELResolvers added this way are ordered chronologically.

Parameters
elr:ELResolver

The ELResolver to be added to the list of ELResolvers in ELContext.

See Also
StandardELContext#addELResolver
addEvaluationListenerback to summary
public void addEvaluationListener(EvaluationListener listener)

Register an evaluation listener.

Parameters
listener:EvaluationListener

The evaluation listener to be added.

defineBeanback to summary
public Object defineBean(String name, Object bean)

Define a bean in the local bean repository

Parameters
name:String

The name of the bean

bean:Object

The bean instance to be defined. If null, the definition of the bean is removed.

getELContextback to summary
public StandardELContext getELContext()

Return the ELContext used for parsing and evaluating EL expressions. If there is currently no ELContext, a default instance of StandardELContext is returned.

Returns:StandardELContext

The ELContext used for parsing and evaluating EL expressions..

getExpressionFactoryback to summary
public static ExpressionFactory getExpressionFactory()

Return the ExpressionFactory instance used for EL evaluations.

Returns:ExpressionFactory

The ExpressionFactory

importClassback to summary
public void importClass(String className) throws ELException

Import a class. The imported class must be loadable from the classloader at the expression evaluation time.

Parameters
className:String

The full class name of the class to be imported

Exceptions
ELException:
if the name is not a full class name.
importPackageback to summary
public void importPackage(String packageName)

Import a package. At the expression evaluation time, the imported package name will be used to construct the full class name, which will then be used to load the class. Inherently, this is less efficient than importing a class.

Parameters
packageName:String

The package name to be imported

importStaticback to summary
public void importStatic(String staticMemberName) throws ELException

Import a static field or method. The class of the static member must be loadable from the classloader, at class resolution time.

Parameters
staticMemberName:String

The full class name of the class to be imported

Exceptions
ELException:
if the name is not a full class name.
mapFunctionback to summary
public void mapFunction(String prefix, String function, Method meth)

Maps a static method to an EL function.

Parameters
prefix:String

The namespace of the functions, can be "".

function:String

The name of the function.

meth:Method

The static method to be invoked when the function is used.

setELContextback to summary
public ELContext setELContext(ELContext context)

Set the ELContext used for parsing and evaluating EL expressions. The supplied ELContext will not be modified, except for the context object map.

Parameters
context:ELContext

The new ELContext.

Returns:ELContext

The previous ELContext, null if none.

setVariableback to summary
public void setVariable(String variable, ValueExpression expression)

Assign a ValueExpression to an EL variable, replacing any previous assignment to the same variable. The assignment for the variable is removed if the expression is null.

Parameters
variable:String

The variable name

expression:ValueExpression

The ValueExpression to be assigned to the variable.