@@ -65,9 +65,9 @@ private static final class MethodDescriptor {
65
65
/**
66
66
* The sole constructor.
67
67
*
68
- * @param cls the class to reflect, must not be null
69
- * @param methodName the method name to obtain
70
- * @param paramTypes the array of classes representing the parameter types
68
+ * @param cls the class to reflect, must not be null.
69
+ * @param methodName the method name to obtain.
70
+ * @param paramTypes the array of classes representing the parameter types.
71
71
* @param exact whether the match has to be exact.
72
72
*/
73
73
public MethodDescriptor (final Class <?> cls , final String methodName , final Class <?>[] paramTypes , final boolean exact ) {
@@ -81,7 +81,7 @@ public MethodDescriptor(final Class<?> cls, final String methodName, final Class
81
81
/**
82
82
* Checks for equality.
83
83
*
84
- * @param obj object to be tested for equality
84
+ * @param obj object to be tested for equality.
85
85
* @return true, if the object describes the same Method.
86
86
*/
87
87
@ Override
@@ -136,8 +136,8 @@ public int hashCode() {
136
136
/**
137
137
* Add a method to the cache.
138
138
*
139
- * @param md The method descriptor
140
- * @param method The method to cache
139
+ * @param md The method descriptor.
140
+ * @param method The method to cache.
141
141
*/
142
142
private static void cacheMethod (final MethodDescriptor md , final Method method ) {
143
143
if (CACHE_METHODS && method != null ) {
@@ -148,7 +148,7 @@ private static void cacheMethod(final MethodDescriptor md, final Method method)
148
148
/**
149
149
* Clear the method cache.
150
150
*
151
- * @return the number of cached methods cleared
151
+ * @return the number of cached methods cleared.
152
152
* @since 1.8.0
153
153
*/
154
154
public static synchronized int clearCache () {
@@ -161,9 +161,9 @@ public static synchronized int clearCache() {
161
161
* Return an accessible method (that is, one that can be invoked via reflection) that implements the specified Method. If no such method can be found,
162
162
* return {@code null}.
163
163
*
164
- * @param clazz The class of the object
165
- * @param method The method that we wish to call
166
- * @return The accessible method
164
+ * @param clazz The class of the object.
165
+ * @param method The method that we wish to call.
166
+ * @return The accessible method.
167
167
* @since 1.8.0
168
168
*/
169
169
public static Method getAccessibleMethod (Class <?> clazz , Method method ) {
@@ -213,10 +213,10 @@ public static Method getAccessibleMethod(Class<?> clazz, Method method) {
213
213
* Return an accessible method (that is, one that can be invoked via reflection) with given name and parameters. If no such method can be found, return
214
214
* {@code null}. This is just a convenient wrapper for {@link #getAccessibleMethod(Method method)}.
215
215
*
216
- * @param clazz get method from this class
217
- * @param methodName get method with this name
218
- * @param parameterTypes with these parameters types
219
- * @return The accessible method
216
+ * @param clazz get method from this class.
217
+ * @param methodName get method with this name.
218
+ * @param parameterTypes with these parameters types.
219
+ * @return The accessible method.
220
220
*/
221
221
public static Method getAccessibleMethod (final Class <?> clazz , final String methodName , final Class <?>... parameterTypes ) {
222
222
try {
@@ -239,8 +239,8 @@ public static Method getAccessibleMethod(final Class<?> clazz, final String meth
239
239
* Return an accessible method (that is, one that can be invoked via reflection) that implements the specified Method. If no such method can be found,
240
240
* return {@code null}.
241
241
*
242
- * @param method The method that we wish to call
243
- * @return The accessible method
242
+ * @param method The method that we wish to call.
243
+ * @return The accessible method.
244
244
*/
245
245
public static Method getAccessibleMethod (final Method method ) {
246
246
// Make sure we have a method to check
@@ -260,9 +260,9 @@ public static Method getAccessibleMethod(final Method method) {
260
260
* the higher level methods.
261
261
* </p>
262
262
*
263
- * @param clazz Parent class for the interfaces to be checked
264
- * @param methodName Method name of the method we wish to call
265
- * @param parameterTypes The parameter type signatures
263
+ * @param clazz Parent class for the interfaces to be checked.
264
+ * @param methodName Method name of the method we wish to call.
265
+ * @param parameterTypes The parameter type signatures.
266
266
*/
267
267
private static Method getAccessibleMethodFromInterfaceNest (Class <?> clazz , final String methodName , final Class <?>[] parameterTypes ) {
268
268
Method method = null ;
@@ -309,9 +309,9 @@ private static Method getAccessibleMethodFromInterfaceNest(Class<?> clazz, final
309
309
* Return an accessible method (that is, one that can be invoked via reflection) by scanning through the superclasses. If no such method can be found,
310
310
* return {@code null}.
311
311
*
312
- * @param clazz Class to be checked
313
- * @param methodName Method name of the method we wish to call
314
- * @param parameterTypes The parameter type signatures
312
+ * @param clazz Class to be checked.
313
+ * @param methodName Method name of the method we wish to call.
314
+ * @param parameterTypes The parameter type signatures.
315
315
*/
316
316
private static Method getAccessibleMethodFromSuperclass (final Class <?> clazz , final String methodName , final Class <?>[] parameterTypes ) {
317
317
Class <?> parentClazz = clazz .getSuperclass ();
@@ -331,8 +331,8 @@ private static Method getAccessibleMethodFromSuperclass(final Class<?> clazz, fi
331
331
/**
332
332
* Gets the method from the cache, if present.
333
333
*
334
- * @param md The method descriptor
335
- * @return The cached method
334
+ * @param md The method descriptor.
335
+ * @return The cached method.
336
336
*/
337
337
private static Method getCachedMethod (final MethodDescriptor md ) {
338
338
if (CACHE_METHODS ) {
@@ -359,10 +359,10 @@ private static Method getCachedMethod(final MethodDescriptor md) {
359
359
* This method can match primitive parameter by passing in wrapper classes. For example, a {@code Boolean</code> will match a primitive <code>boolean}
360
360
* parameter.
361
361
*
362
- * @param clazz find method in this class
363
- * @param methodName find method with this name
364
- * @param parameterTypes find method with compatible parameters
365
- * @return The accessible method
362
+ * @param clazz find method in this class.
363
+ * @param methodName find method with this name.
364
+ * @param parameterTypes find method with compatible parameters.
365
+ * @return The accessible method.
366
366
*/
367
367
public static Method getMatchingAccessibleMethod (final Class <?> clazz , final String methodName , final Class <?>[] parameterTypes ) {
368
368
// trace logging
@@ -461,9 +461,9 @@ public static Method getMatchingAccessibleMethod(final Class<?> clazz, final Str
461
461
* Gets the number of steps required needed to turn the source class into the destination class. This represents the number of steps in the object hierarchy
462
462
* graph.
463
463
*
464
- * @param srcClass The source class
465
- * @param destClass The destination class
466
- * @return The cost of transforming an object
464
+ * @param srcClass The source class.
465
+ * @param destClass The destination class.
466
+ * @return The cost of transforming an object.
467
467
*/
468
468
private static float getObjectTransformationCost (Class <?> srcClass , final Class <?> destClass ) {
469
469
float cost = 0.0f ;
@@ -501,9 +501,9 @@ private static float getObjectTransformationCost(Class<?> srcClass, final Class<
501
501
/**
502
502
* Returns the sum of the object transformation cost for each class in the source argument list.
503
503
*
504
- * @param srcArgs The source arguments
505
- * @param destArgs The destination arguments
506
- * @return The total transformation cost
504
+ * @param srcArgs The source arguments.
505
+ * @param destArgs The destination arguments.
506
+ * @return The total transformation cost.
507
507
*/
508
508
private static float getTotalTransformationCost (final Class <?>[] srcArgs , final Class <?>[] destArgs ) {
509
509
float totalCost = 0.0f ;
@@ -524,14 +524,14 @@ private static float getTotalTransformationCost(final Class<?>[] srcArgs, final
524
524
* This uses reflection to invoke the method obtained from a call to {@code getAccessibleMethod()}.
525
525
* </p>
526
526
*
527
- * @param object invoke method on this object
528
- * @param methodName get method with this name
527
+ * @param object invoke method on this object.
528
+ * @param methodName get method with this name.
529
529
* @param args use these arguments - treat null as empty array (passing null will result in calling the parameterless method with name
530
530
* {@code methodName}).
531
- * @return The value returned by the invoked method
532
- * @throws NoSuchMethodException if there is no such accessible method
533
- * @throws InvocationTargetException wraps an exception thrown by the method invoked
534
- * @throws IllegalAccessException if the requested method is not accessible via reflection
531
+ * @return The value returned by the invoked method.
532
+ * @throws NoSuchMethodException if there is no such accessible method.
533
+ * @throws InvocationTargetException wraps an exception thrown by the method invoked.
534
+ * @throws IllegalAccessException if the requested method is not accessible via reflection.
535
535
*/
536
536
public static Object invokeExactMethod (final Object object , final String methodName , Object ... args )
537
537
throws NoSuchMethodException , IllegalAccessException , InvocationTargetException {
@@ -553,15 +553,15 @@ public static Object invokeExactMethod(final Object object, final String methodN
553
553
* This uses reflection to invoke the method obtained from a call to {@code getAccessibleMethod()}.
554
554
* </p>
555
555
*
556
- * @param object invoke method on this object
557
- * @param methodName get method with this name
556
+ * @param object invoke method on this object.
557
+ * @param methodName get method with this name.
558
558
* @param args use these arguments - treat null as empty array (passing null will result in calling the parameterless method with name
559
559
* {@code methodName}).
560
- * @param parameterTypes match these parameters - treat null as empty array
561
- * @return The value returned by the invoked method
562
- * @throws NoSuchMethodException if there is no such accessible method
563
- * @throws InvocationTargetException wraps an exception thrown by the method invoked
564
- * @throws IllegalAccessException if the requested method is not accessible via reflection
560
+ * @param parameterTypes match these parameters - treat null as empty array.
561
+ * @return The value returned by the invoked method.
562
+ * @throws NoSuchMethodException if there is no such accessible method.
563
+ * @throws InvocationTargetException wraps an exception thrown by the method invoked.
564
+ * @throws IllegalAccessException if the requested method is not accessible via reflection.
565
565
*/
566
566
public static Object invokeExactMethod (final Object object , final String methodName , Object [] args , Class <?>[] parameterTypes )
567
567
throws NoSuchMethodException , IllegalAccessException , InvocationTargetException {
@@ -587,15 +587,15 @@ public static Object invokeExactMethod(final Object object, final String methodN
587
587
* This uses reflection to invoke the method obtained from a call to {@link #getAccessibleMethod(Class, String, Class[])}.
588
588
* </p>
589
589
*
590
- * @param objectClass invoke static method on this class
591
- * @param methodName get method with this name
590
+ * @param objectClass invoke static method on this class.
591
+ * @param methodName get method with this name.
592
592
* @param args use these arguments - treat null as empty array (passing null will result in calling the parameterless method with name
593
593
* {@code methodName}).
594
- * @param parameterTypes match these parameters - treat null as empty array
595
- * @return The value returned by the invoked method
596
- * @throws NoSuchMethodException if there is no such accessible method
597
- * @throws InvocationTargetException wraps an exception thrown by the method invoked
598
- * @throws IllegalAccessException if the requested method is not accessible via reflection
594
+ * @param parameterTypes match these parameters - treat null as empty array.
595
+ * @return The value returned by the invoked method.
596
+ * @throws NoSuchMethodException if there is no such accessible method.
597
+ * @throws InvocationTargetException wraps an exception thrown by the method invoked.
598
+ * @throws IllegalAccessException if the requested method is not accessible via reflection.
599
599
* @since 1.8.0
600
600
*/
601
601
public static Object invokeExactStaticMethod (final Class <?> objectClass , final String methodName , Object [] args , Class <?>[] parameterTypes )
@@ -630,15 +630,15 @@ public static Object invokeExactStaticMethod(final Class<?> objectClass, final S
630
630
* </p>
631
631
*
632
632
*
633
- * @param object invoke method on this object
634
- * @param methodName get method with this name
633
+ * @param object invoke method on this object.
634
+ * @param methodName get method with this name.
635
635
* @param args use these arguments - treat null as empty array (passing null will result in calling the parameterless method with name
636
636
* {@code methodName}).
637
- * @param parameterTypes match these parameters - treat null as empty array
638
- * @return The value returned by the invoked method
639
- * @throws NoSuchMethodException if there is no such accessible method
640
- * @throws InvocationTargetException wraps an exception thrown by the method invoked
641
- * @throws IllegalAccessException if the requested method is not accessible via reflection
637
+ * @param parameterTypes match these parameters - treat null as empty array.
638
+ * @return The value returned by the invoked method.
639
+ * @throws NoSuchMethodException if there is no such accessible method.
640
+ * @throws InvocationTargetException wraps an exception thrown by the method invoked.
641
+ * @throws IllegalAccessException if the requested method is not accessible via reflection.
642
642
*/
643
643
public static Object invokeMethod (final Object object , final String methodName , Object [] args , Class <?>[] parameterTypes )
644
644
throws NoSuchMethodException , IllegalAccessException , InvocationTargetException {
0 commit comments