|
40 | 40 |
|
41 | 41 | /**
|
42 | 42 | * A powerful and highly configurable {@link EvaluationContext} implementation.
|
43 |
| - * This context uses standard implementations of all applicable strategies, |
44 |
| - * based on reflection to resolve properties, methods and fields. |
45 | 43 | *
|
46 |
| - * <p>For a simpler builder-style context variant for data-binding purposes, |
| 44 | + * <p>This context uses standard implementations of all applicable strategies, |
| 45 | + * based on reflection to resolve properties, methods, and fields. Note, however, |
| 46 | + * that you may need to manually configure a {@code StandardTypeLocator} with a |
| 47 | + * specific {@link ClassLoader} to ensure that the SpEL expression parser is able |
| 48 | + * to reliably locate user types. See {@link #setTypeLocator(TypeLocator)} for |
| 49 | + * details. |
| 50 | + * |
| 51 | + * <p>For a simpler, builder-style context variant for data-binding purposes, |
47 | 52 | * consider using {@link SimpleEvaluationContext} instead which allows for
|
48 |
| - * opting into several SpEL features as needed by specific evaluation cases. |
| 53 | + * opting into several SpEL features as needed by specific use cases. |
49 | 54 | *
|
50 | 55 | * @author Andy Clement
|
51 | 56 | * @author Juergen Hoeller
|
@@ -183,11 +188,29 @@ public BeanResolver getBeanResolver() {
|
183 | 188 | return this.beanResolver;
|
184 | 189 | }
|
185 | 190 |
|
| 191 | + /** |
| 192 | + * Set the {@link TypeLocator} to use to find types, either by short or |
| 193 | + * fully-qualified name. |
| 194 | + * <p>By default, a {@link StandardTypeLocator} will be used. |
| 195 | + * <p><strong>NOTE</strong>: Even if a {@code StandardTypeLocator} is |
| 196 | + * sufficient, you may need to manually configure a {@code StandardTypeLocator} |
| 197 | + * with a specific {@link ClassLoader} to ensure that the SpEL expression |
| 198 | + * parser is able to reliably locate user types. |
| 199 | + * @param typeLocator the {@code TypeLocator} to use |
| 200 | + * @see StandardTypeLocator#StandardTypeLocator(ClassLoader) |
| 201 | + * @see #getTypeLocator() |
| 202 | + */ |
186 | 203 | public void setTypeLocator(TypeLocator typeLocator) {
|
187 | 204 | Assert.notNull(typeLocator, "TypeLocator must not be null");
|
188 | 205 | this.typeLocator = typeLocator;
|
189 | 206 | }
|
190 | 207 |
|
| 208 | + /** |
| 209 | + * Get the configured {@link TypeLocator} that will be used to find types, |
| 210 | + * either by short or fully-qualified name. |
| 211 | + * <p>See {@link #setTypeLocator(TypeLocator)} for further details. |
| 212 | + * @see #setTypeLocator(TypeLocator) |
| 213 | + */ |
191 | 214 | @Override
|
192 | 215 | public TypeLocator getTypeLocator() {
|
193 | 216 | if (this.typeLocator == null) {
|
|
0 commit comments