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

Method getValue

java/org/apache/el/parser/AstValue.java:123–159  ·  view source on GitHub ↗
(EvaluationContext ctx)

Source from the content-addressed store, hash-verified

121 }
122
123 @Override
124 public Object getValue(EvaluationContext ctx) throws ELException {
125 Object base = this.children[0].getValue(ctx);
126 int propCount = this.jjtGetNumChildren();
127 int i = 1;
128 Object suffix = null;
129 ELResolver resolver = ctx.getELResolver();
130 while (base != null && i < propCount) {
131 suffix = this.children[i].getValue(ctx);
132 if (i + 1 < propCount && (this.children[i + 1] instanceof AstMethodParameters mps)) {
133 if (base instanceof Optional && "orElseGet".equals(suffix) && mps.jjtGetNumChildren() == 1) {
134 Node paramFoOptional = mps.jjtGetChild(0);
135 if (!(paramFoOptional instanceof AstLambdaExpression ||
136 paramFoOptional instanceof LambdaExpression)) {
137 throw new ELException(MessageFactory.get("stream.optional.paramNotLambda", suffix));
138 }
139 }
140 // This is a method
141 Object[] paramValues = mps.getParameters(ctx);
142 base = resolver.invoke(ctx, base, suffix, getTypesFromValues(paramValues), paramValues);
143 i += 2;
144 } else {
145 // This is a property
146 if (suffix == null) {
147 return null;
148 }
149
150 ctx.setPropertyResolved(false);
151 base = resolver.getValue(ctx, base, suffix);
152 i++;
153 }
154 }
155 if (!ctx.isPropertyResolved()) {
156 throw new PropertyNotFoundException(MessageFactory.get("error.resolver.unhandled", base, suffix));
157 }
158 return base;
159 }
160
161 @Override
162 public boolean isReadOnly(EvaluationContext ctx) throws ELException {

Callers

nothing calls this directly

Calls 12

getMethod · 0.95
invokeMethod · 0.95
getTypesFromValuesMethod · 0.95
getValueMethod · 0.95
getValueMethod · 0.65
jjtGetNumChildrenMethod · 0.65
equalsMethod · 0.65
jjtGetChildMethod · 0.65
getParametersMethod · 0.65
getELResolverMethod · 0.45
setPropertyResolvedMethod · 0.45
isPropertyResolvedMethod · 0.45

Tested by

no test coverage detected