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