public class ELManager extends Object
Manages EL parsing and evaluation environment. The ELManager maintains an instance of ExpressionFactory and StandardELContext, for parsing and evaluating EL expressions.
Constructor and Description |
---|
ELManager() |
Modifier and Type | Method and Description |
---|---|
void |
addBeanNameResolver(BeanNameResolver bnr)
Register a BeanNameResolver.
|
void |
addELResolver(ELResolver elr)
Add an user defined ELResolver to the list of ELResolvers.
|
void |
addEvaluationListener(EvaluationListener listener)
Register an evaluation listener.
|
Object |
defineBean(String name,
Object bean)
Define a bean in the local bean repository
|
StandardELContext |
getELContext()
Return the ELContext used for parsing and evaluating EL expressions.
|
static ExpressionFactory |
getExpressionFactory()
Return the ExpressionFactory instance used for EL evaluations.
|
void |
importClass(String className)
Import a class.
|
void |
importPackage(String packageName)
Import a package.
|
void |
importStatic(String staticMemberName)
Import a static field or method.
|
void |
mapFunction(String prefix,
String function,
Method meth)
Maps a static method to an EL function.
|
ELContext |
setELContext(ELContext context)
Set the ELContext used for parsing and evaluating EL expressions.
|
void |
setVariable(String variable,
ValueExpression expression)
Assign a ValueExpression to an EL variable, replacing
any previous assignment to the same variable.
|
public static ExpressionFactory getExpressionFactory()
public StandardELContext getELContext()
public ELContext setELContext(ELContext context)
context
- The new ELContext.public void addBeanNameResolver(BeanNameResolver bnr)
bnr
- The BeanNameResolver to be registered.public void addELResolver(ELResolver elr)
elr
- The ELResolver to be added to the list of ELResolvers in
ELContext.StandardELContext.addELResolver(javax.el.ELResolver)
public void mapFunction(String prefix, String function, Method meth)
prefix
- The namespace of the functions, can be "".function
- The name of the function.meth
- The static method to be invoked when the function is used.public void setVariable(String variable, ValueExpression expression)
null
.variable
- The variable nameexpression
- The ValueExpression to be assigned
to the variable.public void importStatic(String staticMemberName) throws ELException
staticMemberName
- The full class name of the class to be importedELException
- if the name is not a full class name.public void importClass(String className) throws ELException
className
- The full class name of the class to be importedELException
- if the name is not a full class name.public void importPackage(String packageName)
packageName
- The package name to be importedpublic Object defineBean(String name, Object bean)
name
- The name of the beanbean
- The bean instance to be defined. If null, the definition
of the bean is removed.public void addEvaluationListener(EvaluationListener listener)
listener
- The evaluation listener to be added.Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.