MCPcopy Create free account
hub / github.com/apache/tomcat / setValue

Method setValue

java/jakarta/el/BeanELResolver.java:97–122  ·  view source on GitHub ↗
(ELContext context, Object base, Object property, Object value)

Source from the content-addressed store, hash-verified

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) {

Callers 7

testSetValue01Method · 0.95
testSetValue03Method · 0.95
testSetValue04Method · 0.95
testSetValue05Method · 0.95
testSetValue06Method · 0.95
testSetValue07Method · 0.95
doNegativeTestMethod · 0.95

Calls 9

messageMethod · 0.95
propertyMethod · 0.95
handleThrowableMethod · 0.95
getNameMethod · 0.65
writeMethod · 0.65
invokeMethod · 0.65
toStringMethod · 0.65
setPropertyResolvedMethod · 0.45
getCauseMethod · 0.45

Tested by 7

testSetValue01Method · 0.76
testSetValue03Method · 0.76
testSetValue04Method · 0.76
testSetValue05Method · 0.76
testSetValue06Method · 0.76
testSetValue07Method · 0.76
doNegativeTestMethod · 0.76