| 76 | } |
| 77 | |
| 78 | @Override |
| 79 | public Object getValue(ELContext context, Object base, Object property) { |
| 80 | Objects.requireNonNull(context); |
| 81 | |
| 82 | if (base != null && base.getClass().isArray()) { |
| 83 | context.setPropertyResolved(base, property); |
| 84 | if (LENGTH_PROPERTY_NAME.equals(property)) { |
| 85 | return Integer.valueOf(Array.getLength(base)); |
| 86 | } |
| 87 | int idx = coerce(property); |
| 88 | if (idx < 0 || idx >= Array.getLength(base)) { |
| 89 | return null; |
| 90 | } |
| 91 | return Array.get(base, idx); |
| 92 | } |
| 93 | |
| 94 | return null; |
| 95 | } |
| 96 | |
| 97 | @Override |
| 98 | public void setValue(ELContext context, Object base, Object property, Object value) { |