MCPcopy Index your code
hub / github.com/apache/tomcat / getValue

Method getValue

java/jakarta/el/OptionalELResolver.java:61–78  ·  view source on GitHub ↗

{@inheritDoc} @return If the base object is an Optional and Optional#isEmpty() returns true then the resulting value is null. If the base object is an Optional, Optional#isPresent() returns true and the

(ELContext context, Object base, Object property)

Source from the content-addressed store, hash-verified

59 * If the base object is not an {@link Optional} then the return value is undefined.
60 */
61 @Override
62 public Object getValue(ELContext context, Object base, Object property) {
63 Objects.requireNonNull(context);
64
65 if (base instanceof Optional) {
66 context.setPropertyResolved(base, property);
67 if (((Optional<?>) base).isPresent()) {
68 if (property == null) {
69 return ((Optional<?>) base).get();
70 } else {
71 Object resolvedBase = ((Optional<?>) base).get();
72 return context.getELResolver().getValue(context, resolvedBase, property);
73 }
74 }
75 }
76
77 return null;
78 }
79
80
81 /**

Callers

nothing calls this directly

Calls 4

getMethod · 0.65
getValueMethod · 0.65
setPropertyResolvedMethod · 0.45
getELResolverMethod · 0.45

Tested by

no test coverage detected