Package jakarta.el
Class ELManager
- java.lang.Object
- 
- jakarta.el.ELManager
 
- 
 public class ELManager extends Object Manages Jakarta Expression Language parsing and evaluation environment. The ELManager maintains an instance of ExpressionFactory and StandardELContext, for parsing and evaluating Jakarta Expression Language expressions.- Since:
- Jakarta Expression Language 3.0
 
- 
- 
Constructor SummaryConstructors Constructor Description ELManager()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBeanNameResolver(BeanNameResolver beanNameResolver)Register a BeanNameResolver.voidaddELResolver(ELResolver elResolver)Add an user defined ELResolver to the list of ELResolvers.voidaddEvaluationListener(EvaluationListener listener)Register an evaluation listener.ObjectdefineBean(String name, Object bean)Define a bean in the local bean repositoryStandardELContextgetELContext()Return the ELContext used for parsing and evaluating Jakarta Expression Language expressions.static ExpressionFactorygetExpressionFactory()Return the ExpressionFactory instance used for Jakarta Expression Language evaluations.voidimportClass(String className)Import a class.voidimportPackage(String packageName)Import a package.voidimportStatic(String staticMemberName)Import a static field or method.voidmapFunction(String prefix, String function, Method method)Maps a static method to Jakarta Expression Language function.ELContextsetELContext(ELContext context)Set the ELContext used for parsing and evaluating Jakarta Expression Language expressions.voidsetVariable(String variable, ValueExpression expression)Assign a ValueExpression to a Jakarta Expression Language variable, replacing any previous assignment to the same variable.
 
- 
- 
- 
Method Detail- 
getExpressionFactorypublic static ExpressionFactory getExpressionFactory() Return the ExpressionFactory instance used for Jakarta Expression Language evaluations.- Returns:
- The ExpressionFactory
 
 - 
getELContextpublic StandardELContext getELContext() Return the ELContext used for parsing and evaluating Jakarta Expression Language expressions. If there is currently no ELContext, a default instance of StandardELContext is returned.- Returns:
- The ELContext used for parsing and evaluating Jakarta Expression Language expressions..
 
 - 
setELContextpublic ELContext setELContext(ELContext context) Set the ELContext used for parsing and evaluating Jakarta Expression Language expressions. The supplied ELContext will not be modified, except for the context object map.- Parameters:
- context- The new ELContext.
- Returns:
- The previous ELContext, null if none.
 
 - 
addBeanNameResolverpublic void addBeanNameResolver(BeanNameResolver beanNameResolver) 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:
- beanNameResolver- The BeanNameResolver to be registered.
 
 - 
addELResolverpublic void addELResolver(ELResolver elResolver) 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:
- elResolver- The ELResolver to be added to the list of ELResolvers in ELContext.
- See Also:
- StandardELContext.addELResolver(jakarta.el.ELResolver)
 
 - 
mapFunctionpublic void mapFunction(String prefix, String function, Method method) Maps a static method to Jakarta Expression Language function.- Parameters:
- prefix- The namespace of the functions, can be "".
- function- The name of the function.
- method- The static method to be invoked when the function is used.
 
 - 
setVariablepublic void setVariable(String variable, ValueExpression expression) Assign a ValueExpression to a Jakarta Expression Language variable, replacing any previous assignment to the same variable. The assignment for the variable is removed if the expression isnull.- Parameters:
- variable- The variable name
- expression- The ValueExpression to be assigned to the variable.
 
 - 
importStaticpublic 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- The full class name of the class to be imported
- Throws:
- ELException- if the name is not a full class name.
 
 - 
importClasspublic 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- The full class name of the class to be imported
- Throws:
- ELException- if the name is not a full class name.
 
 - 
importPackagepublic 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- The package name to be imported
 
 - 
defineBeanpublic Object defineBean(String name, Object bean) Define a bean in the local bean repository- Parameters:
- name- The name of the bean
- bean- The bean instance to be defined. If null, the definition of the bean is removed.
- Returns:
- the previous bean (if any) mapped to name
 
 - 
addEvaluationListenerpublic void addEvaluationListener(EvaluationListener listener) Register an evaluation listener.- Parameters:
- listener- The evaluation listener to be added.
 
 
- 
 
-