| 83 | } |
| 84 | |
| 85 | @Override |
| 86 | public void setValue(ELContext context, Object base, Object property, Object value) { |
| 87 | Objects.requireNonNull(context); |
| 88 | |
| 89 | if (base instanceof Map<?,?>) { |
| 90 | context.setPropertyResolved(base, property); |
| 91 | |
| 92 | if (this.readOnly) { |
| 93 | throw new PropertyNotWritableException( |
| 94 | Util.message(context, "resolverNotWritable", base.getClass().getName())); |
| 95 | } |
| 96 | |
| 97 | try { |
| 98 | @SuppressWarnings("unchecked") // Must be OK |
| 99 | Map<Object,Object> map = ((Map<Object,Object>) base); |
| 100 | map.put(property, value); |
| 101 | } catch (UnsupportedOperationException e) { |
| 102 | throw new PropertyNotWritableException(e); |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | @Override |
| 108 | public boolean isReadOnly(ELContext context, Object base, Object property) { |