| 95 | } |
| 96 | |
| 97 | @Override |
| 98 | public void setValue(ELContext context, Object base, Object property, Object value) { |
| 99 | Objects.requireNonNull(context); |
| 100 | if (base == null || property == null) { |
| 101 | return; |
| 102 | } |
| 103 | |
| 104 | context.setPropertyResolved(base, property); |
| 105 | |
| 106 | if (this.readOnly) { |
| 107 | throw new PropertyNotWritableException( |
| 108 | Util.message(context, "resolverNotWritable", base.getClass().getName())); |
| 109 | } |
| 110 | |
| 111 | Method m = this.property(context, base, property).write(context, base); |
| 112 | try { |
| 113 | m.invoke(base, value); |
| 114 | } catch (InvocationTargetException e) { |
| 115 | Throwable cause = e.getCause(); |
| 116 | Util.handleThrowable(cause); |
| 117 | throw new ELException( |
| 118 | Util.message(context, "propertyWriteError", base.getClass().getName(), property.toString()), cause); |
| 119 | } catch (Exception e) { |
| 120 | throw new ELException(e); |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | @Override |
| 125 | public Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) { |