@@ -504,15 +504,16 @@ protected Field findField(String name, Class<?> clazz, boolean mustBeStatic) {
504
504
}
505
505
506
506
/**
507
- * Attempt to create an optimized property accessor tailored for a property of a
508
- * particular name on a particular class. The general ReflectivePropertyAccessor
509
- * will always work but is not optimal due to the need to lookup which reflective
510
- * member (method/field) to use each time read() is called. This method will just
511
- * return the ReflectivePropertyAccessor instance if it is unable to build a more
512
- * optimal accessor.
513
- * <p>Note: An optimal accessor is currently only usable for read attempts.
507
+ * Attempt to create an optimized property accessor tailored for a property
508
+ * of a particular name on a particular class.
509
+ * <p>The general {@link ReflectivePropertyAccessor} will always work but is
510
+ * not optimal due to the need to look up which reflective member (method or
511
+ * field) to use each time {@link #read(EvaluationContext, Object, String)}
512
+ * is called.
513
+ * <p>This method will return this {@code ReflectivePropertyAccessor} instance
514
+ * if it is unable to build a optimized accessor.
515
+ * <p>Note: An optimized accessor is currently only usable for read attempts.
514
516
* Do not call this method if you need a read-write accessor.
515
- * @see OptimalPropertyAccessor
516
517
*/
517
518
public PropertyAccessor createOptimalAccessor (EvaluationContext context , @ Nullable Object target , String name ) {
518
519
// Don't be clever for arrays or a null target...
@@ -597,19 +598,20 @@ public int compareTo(PropertyCacheKey other) {
597
598
598
599
599
600
/**
600
- * An optimized form of a PropertyAccessor that will use reflection but only knows
601
- * how to access a particular property on a particular class. This is unlike the
602
- * general ReflectivePropertyResolver which manages a cache of methods/fields that
603
- * may be invoked to access different properties on different classes. This optimal
604
- * accessor exists because looking up the appropriate reflective object by class/name
605
- * on each read is not cheap.
601
+ * An optimized {@link CompilablePropertyAccessor} that will use reflection
602
+ * but only knows how to access a particular property on a particular class.
603
+ * <p>This is unlike the general {@link ReflectivePropertyAccessor} which
604
+ * manages a cache of methods and fields that may be invoked to access
605
+ * different properties on different classes.
606
+ * <p>This optimized accessor exists because looking up the appropriate
607
+ * reflective method or field on each read is not cheap.
606
608
*/
607
- public static class OptimalPropertyAccessor implements CompilablePropertyAccessor {
609
+ private static class OptimalPropertyAccessor implements CompilablePropertyAccessor {
608
610
609
611
/**
610
612
* The member being accessed.
611
613
*/
612
- public final Member member ;
614
+ private final Member member ;
613
615
614
616
private final TypeDescriptor typeDescriptor ;
615
617
0 commit comments