@@ -122,34 +122,72 @@ public StandardEvaluationContext(@Nullable Object rootObject) {
122
122
}
123
123
124
124
125
+ /**
126
+ * Specify the default root context object (including a type descriptor)
127
+ * against which unqualified properties, methods, etc. should be resolved.
128
+ * @param rootObject the root object to use
129
+ * @param typeDescriptor a corresponding type descriptor
130
+ */
125
131
public void setRootObject (@ Nullable Object rootObject , TypeDescriptor typeDescriptor ) {
126
132
this .rootObject = new TypedValue (rootObject , typeDescriptor );
127
133
}
128
134
135
+ /**
136
+ * Specify the default root context object against which unqualified
137
+ * properties, methods, etc. should be resolved.
138
+ * @param rootObject the root object to use
139
+ */
129
140
public void setRootObject (@ Nullable Object rootObject ) {
130
141
this .rootObject = (rootObject != null ? new TypedValue (rootObject ) : TypedValue .NULL );
131
142
}
132
143
144
+ /**
145
+ * Return the configured default root context object against which unqualified
146
+ * properties, methods, etc. should be resolved (can be {@link TypedValue#NULL}).
147
+ */
133
148
@ Override
134
149
public TypedValue getRootObject () {
135
150
return this .rootObject ;
136
151
}
137
152
153
+ /**
154
+ * Set the list of property accessors to use in this evaluation context.
155
+ * <p>Replaces any previously configured property accessors.
156
+ */
138
157
public void setPropertyAccessors (List <PropertyAccessor > propertyAccessors ) {
139
158
this .propertyAccessors = propertyAccessors ;
140
159
}
141
160
161
+ /**
162
+ * Get the list of property accessors configured in this evaluation context.
163
+ */
142
164
@ Override
143
165
public List <PropertyAccessor > getPropertyAccessors () {
144
166
return initPropertyAccessors ();
145
167
}
146
168
147
- public void addPropertyAccessor (PropertyAccessor accessor ) {
148
- addBeforeDefault (initPropertyAccessors (), accessor );
169
+ /**
170
+ * Add the supplied property accessor to this evaluation context.
171
+ * @param propertyAccessor the property accessor to add
172
+ * @see #getPropertyAccessors()
173
+ * @see #setPropertyAccessors(List)
174
+ * @see #removePropertyAccessor(PropertyAccessor)
175
+ */
176
+ public void addPropertyAccessor (PropertyAccessor propertyAccessor ) {
177
+ addBeforeDefault (initPropertyAccessors (), propertyAccessor );
149
178
}
150
179
151
- public boolean removePropertyAccessor (PropertyAccessor accessor ) {
152
- return initPropertyAccessors ().remove (accessor );
180
+ /**
181
+ * Remove the supplied property accessor from this evaluation context.
182
+ * @param propertyAccessor the property accessor to remove
183
+ * @return {@code true} if the property accessor was removed, {@code false}
184
+ * if the property accessor was not configured in this evaluation context
185
+ * @see #getPropertyAccessors()
186
+ * @see #setPropertyAccessors(List)
187
+ * @see #addPropertyAccessor(PropertyAccessor)
188
+ */
189
+ public boolean removePropertyAccessor (PropertyAccessor propertyAccessor ) {
190
+ return initPropertyAccessors ().remove (propertyAccessor );
153
191
}
154
192
155
193
/**
@@ -191,8 +229,8 @@ public void addIndexAccessor(IndexAccessor indexAccessor) {
191
229
/**
192
230
* Remove the supplied index accessor from this evaluation context.
193
231
* @param indexAccessor the index accessor to remove
194
- * @return {@code true} if the index accessor was removed, {@code false} if
195
- * the index accessor was not configured in this evaluation context
232
+ * @return {@code true} if the index accessor was removed, {@code false}
233
+ * if the index accessor was not configured in this evaluation context
196
234
* @since 6.2
197
235
* @see #getIndexAccessors()
198
236
* @see #setIndexAccessors(List)
@@ -202,44 +240,96 @@ public boolean removeIndexAccessor(IndexAccessor indexAccessor) {
202
240
return initIndexAccessors ().remove (indexAccessor );
203
241
}
204
242
243
+ /**
244
+ * Set the list of constructor resolvers to use in this evaluation context.
245
+ * <p>Replaces any previously configured constructor resolvers.
246
+ */
205
247
public void setConstructorResolvers (List <ConstructorResolver > constructorResolvers ) {
206
248
this .constructorResolvers = constructorResolvers ;
207
249
}
208
250
251
+ /**
252
+ * Get the list of constructor resolvers to use in this evaluation context.
253
+ */
209
254
@ Override
210
255
public List <ConstructorResolver > getConstructorResolvers () {
211
256
return initConstructorResolvers ();
212
257
}
213
258
214
- public void addConstructorResolver (ConstructorResolver resolver ) {
215
- addBeforeDefault (initConstructorResolvers (), resolver );
259
+ /**
260
+ * Add the supplied constructor resolver to this evaluation context.
261
+ * @param constructorResolver the constructor resolver to add
262
+ * @see #getConstructorResolvers()
263
+ * @see #setConstructorResolvers(List)
264
+ * @see #removeConstructorResolver(ConstructorResolver)
265
+ */
266
+ public void addConstructorResolver (ConstructorResolver constructorResolver ) {
267
+ addBeforeDefault (initConstructorResolvers (), constructorResolver );
216
268
}
217
269
218
- public boolean removeConstructorResolver (ConstructorResolver resolver ) {
219
- return initConstructorResolvers ().remove (resolver );
270
+ /**
271
+ * Remove the supplied constructor resolver from this evaluation context.
272
+ * @param constructorResolver the constructor resolver to remove
273
+ * @return {@code true} if the constructor resolver was removed, {@code false}
274
+ * if the constructor resolver was not configured in this evaluation context
275
+ < * @see #getConstructorResolvers()
276
+ * @see #setConstructorResolvers(List)
277
+ * @see #addConstructorResolver(ConstructorResolver)
278
+ */
279
+ public boolean removeConstructorResolver (ConstructorResolver constructorResolver ) {
280
+ return initConstructorResolvers ().remove (constructorResolver );
220
281
}
221
282
283
+ /**
284
+ * Set the list of method resolvers to use in this evaluation context.
285
+ * <p>Replaces any previously configured method resolvers.
286
+ */
222
287
public void setMethodResolvers (List <MethodResolver > methodResolvers ) {
223
288
this .methodResolvers = methodResolvers ;
224
289
}
225
290
291
+ /**
292
+ * Get the list of method resolvers to use in this evaluation context.
293
+ */
226
294
@ Override
227
295
public List <MethodResolver > getMethodResolvers () {
228
296
return initMethodResolvers ();
229
297
}
230
298
231
- public void addMethodResolver (MethodResolver resolver ) {
232
- addBeforeDefault (initMethodResolvers (), resolver );
299
+ /**
300
+ * Add the supplied method resolver to this evaluation context.
301
+ * @param methodResolver the method resolver to add
302
+ * @see #getMethodResolvers()
303
+ * @see #setMethodResolvers(List)
304
+ * @see #removeMethodResolver(MethodResolver)
305
+ */
306
+ public void addMethodResolver (MethodResolver methodResolver ) {
307
+ addBeforeDefault (initMethodResolvers (), methodResolver );
233
308
}
234
309
310
+ /**
311
+ * Remove the supplied method resolver from this evaluation context.
312
+ * @param methodResolver the method resolver to remove
313
+ * @return {@code true} if the method resolver was removed, {@code false}
314
+ * if the method resolver was not configured in this evaluation context
315
+ * @see #getMethodResolvers()
316
+ * @see #setMethodResolvers(List)
317
+ * @see #addMethodResolver(MethodResolver)
318
+ */
235
319
public boolean removeMethodResolver (MethodResolver methodResolver ) {
236
320
return initMethodResolvers ().remove (methodResolver );
237
321
}
238
322
239
- public void setBeanResolver (BeanResolver beanResolver ) {
323
+ /**
324
+ * Set the {@link BeanResolver} to use for looking up beans, if any.
325
+ */
326
+ public void setBeanResolver (@ Nullable BeanResolver beanResolver ) {
240
327
this .beanResolver = beanResolver ;
241
328
}
242
329
330
+ /**
331
+ * Get the configured {@link BeanResolver} for looking up beans, if any.
332
+ */
243
333
@ Override
244
334
public @ Nullable BeanResolver getBeanResolver () {
245
335
return this .beanResolver ;
@@ -276,11 +366,17 @@ public TypeLocator getTypeLocator() {
276
366
return this .typeLocator ;
277
367
}
278
368
369
+ /**
370
+ * Set the {@link TypeConverter} for value conversion.
371
+ */
279
372
public void setTypeConverter (TypeConverter typeConverter ) {
280
373
Assert .notNull (typeConverter , "TypeConverter must not be null" );
281
374
this .typeConverter = typeConverter ;
282
375
}
283
376
377
+ /**
378
+ * Get the configured {@link TypeConverter} for value conversion.
379
+ */
284
380
@ Override
285
381
public TypeConverter getTypeConverter () {
286
382
if (this .typeConverter == null ) {
@@ -289,21 +385,33 @@ public TypeConverter getTypeConverter() {
289
385
return this .typeConverter ;
290
386
}
291
387
388
+ /**
389
+ * Set the {@link TypeComparator} for comparing pairs of objects.
390
+ */
292
391
public void setTypeComparator (TypeComparator typeComparator ) {
293
392
Assert .notNull (typeComparator , "TypeComparator must not be null" );
294
393
this .typeComparator = typeComparator ;
295
394
}
296
395
396
+ /**
397
+ * Get the configured {@link TypeComparator} for comparing pairs of objects.
398
+ */
297
399
@ Override
298
400
public TypeComparator getTypeComparator () {
299
401
return this .typeComparator ;
300
402
}
301
403
404
+ /**
405
+ * Set the {@link OperatorOverloader} for mathematical operations.
406
+ */
302
407
public void setOperatorOverloader (OperatorOverloader operatorOverloader ) {
303
408
Assert .notNull (operatorOverloader , "OperatorOverloader must not be null" );
304
409
this .operatorOverloader = operatorOverloader ;
305
410
}
306
411
412
+ /**
413
+ * Get the configured {@link OperatorOverloader} for mathematical operations.
414
+ */
307
415
@ Override
308
416
public OperatorOverloader getOperatorOverloader () {
309
417
return this .operatorOverloader ;
0 commit comments