MCPcopy Create free account
hub / github.com/apache/tomcat / defineBean

Method defineBean

java/jakarta/el/ELManager.java:167–175  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

getELContextMethod · 0.95
getLocalBeansMethod · 0.80
removeMethod · 0.65
putMethod · 0.65

Tested by

no test coverage detected