(EvaluationContext ctx)
| 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 { |
nothing calls this directly
no test coverage detected