Defines or removes a bean accessible by name in EL expressions. When a non-null bean is provided, it is stored under the given name. When null is provided, the bean with the given name is removed. @param name the bean name @param bean the bean object to define, or null to remove t
(String name, Object bean)
| 165 | * @return the previous bean associated with the name, or {@code null} if there was none |
| 166 | */ |
| 167 | public Object defineBean(String name, Object bean) { |
| 168 | Map<String,Object> localBeans = getELContext().getLocalBeans(); |
| 169 | |
| 170 | if (bean == null) { |
| 171 | return localBeans.remove(name); |
| 172 | } else { |
| 173 | return localBeans.put(name, bean); |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Registers an {@link EvaluationListener} with the managed EL context. The listener |
nothing calls this directly
no test coverage detected