@@ -58,49 +58,51 @@ public interface IndexAccessor extends TargetedAccessor {
58
58
Class <?>[] getSpecificTargetClasses ();
59
59
60
60
/**
61
- * Called to determine if this index accessor is able to read a specified
62
- * index on a specified target object.
61
+ * Determine if this index accessor is able to read a specified index on a
62
+ * specified target object.
63
63
* @param context the evaluation context in which the access is being attempted
64
64
* @param target the target object upon which the index is being accessed
65
65
* @param index the index being accessed
66
- * @return true if this index accessor is able to read the index
66
+ * @return {@code true} if this index accessor is able to read the index
67
67
* @throws AccessException if there is any problem determining whether the
68
68
* index can be read
69
69
*/
70
70
boolean canRead (EvaluationContext context , Object target , Object index ) throws AccessException ;
71
71
72
72
/**
73
- * Called to read an index from a specified target object.
74
- * <p>Should only succeed if {@link #canRead} also returns {@code true}.
73
+ * Read an index from a specified target object.
74
+ * <p>Should only be invoked if {@link #canRead} returns {@code true} for the
75
+ * same arguments.
75
76
* @param context the evaluation context in which the access is being attempted
76
77
* @param target the target object upon which the index is being accessed
77
78
* @param index the index being accessed
78
79
* @return a TypedValue object wrapping the index value read and a type
79
- * descriptor for it
80
- * @throws AccessException if there is any problem reading the index value
80
+ * descriptor for the value
81
+ * @throws AccessException if there is any problem reading the index
81
82
*/
82
83
TypedValue read (EvaluationContext context , Object target , Object index ) throws AccessException ;
83
84
84
85
/**
85
- * Called to determine if this index accessor is able to write to a specified
86
- * index on a specified target object.
86
+ * Determine if this index accessor is able to write to a specified index on
87
+ * a specified target object.
87
88
* @param context the evaluation context in which the access is being attempted
88
89
* @param target the target object upon which the index is being accessed
89
90
* @param index the index being accessed
90
- * @return true if this index accessor is able to write to the index
91
+ * @return {@code true} if this index accessor is able to write to the index
91
92
* @throws AccessException if there is any problem determining whether the
92
93
* index can be written to
93
94
*/
94
95
boolean canWrite (EvaluationContext context , Object target , Object index ) throws AccessException ;
95
96
96
97
/**
97
- * Called to write to an index on a specified target object.
98
- * <p>Should only succeed if {@link #canWrite} also returns {@code true}.
98
+ * Write to an index on a specified target object.
99
+ * <p>Should only be invoked if {@link #canWrite} returns {@code true} for the
100
+ * same arguments.
99
101
* @param context the evaluation context in which the access is being attempted
100
102
* @param target the target object upon which the index is being accessed
101
103
* @param index the index being accessed
102
104
* @param newValue the new value for the index
103
- * @throws AccessException if there is any problem writing to the index value
105
+ * @throws AccessException if there is any problem writing to the index
104
106
*/
105
107
void write (EvaluationContext context , Object target , Object index , @ Nullable Object newValue )
106
108
throws AccessException ;
0 commit comments