47
47
*/
48
48
public abstract class ReflectionUtils {
49
49
50
+ /**
51
+ * Pre-built MethodFilter that matches all non-bridge methods.
52
+ * @since 3.0
53
+ * @deprecated as of 5.0.11, in favor of a custom {@link MethodFilter}
54
+ */
55
+ @ Deprecated
56
+ public static final MethodFilter NON_BRIDGED_METHODS =
57
+ (method -> !method .isBridge ());
58
+
59
+ /**
60
+ * Pre-built MethodFilter that matches all non-bridge non-synthetic methods
61
+ * which are not declared on {@code java.lang.Object}.
62
+ * @since 3.0.5
63
+ */
64
+ public static final MethodFilter USER_DECLARED_METHODS =
65
+ (method -> (!method .isBridge () && !method .isSynthetic () && method .getDeclaringClass () != Object .class ));
66
+
67
+ /**
68
+ * Pre-built FieldFilter that matches all non-static, non-final fields.
69
+ */
70
+ public static final FieldFilter COPYABLE_FIELDS =
71
+ field -> !(Modifier .isStatic (field .getModifiers ()) || Modifier .isFinal (field .getModifiers ()));
72
+
73
+
50
74
/**
51
75
* Naming prefix for CGLIB-renamed methods.
52
76
* @see #isCglibRenamedMethod
@@ -236,7 +260,9 @@ public static Object invokeMethod(Method method, @Nullable Object target, @Nulla
236
260
* @return the invocation result, if any
237
261
* @throws SQLException the JDBC API SQLException to rethrow (if any)
238
262
* @see #invokeJdbcMethod(java.lang.reflect.Method, Object, Object[])
263
+ * @deprecated as of 5.0.11, in favor of custom SQLException handling
239
264
*/
265
+ @ Deprecated
240
266
@ Nullable
241
267
public static Object invokeJdbcMethod (Method method , @ Nullable Object target ) throws SQLException {
242
268
return invokeJdbcMethod (method , target , new Object [0 ]);
@@ -251,7 +277,9 @@ public static Object invokeJdbcMethod(Method method, @Nullable Object target) th
251
277
* @return the invocation result, if any
252
278
* @throws SQLException the JDBC API SQLException to rethrow (if any)
253
279
* @see #invokeMethod(java.lang.reflect.Method, Object, Object[])
280
+ * @deprecated as of 5.0.11, in favor of custom SQLException handling
254
281
*/
282
+ @ Deprecated
255
283
@ Nullable
256
284
public static Object invokeJdbcMethod (Method method , @ Nullable Object target , @ Nullable Object ... args )
257
285
throws SQLException {
@@ -511,8 +539,8 @@ public static <T> Constructor<T> accessibleConstructor(Class<T> clazz, Class<?>.
511
539
* on Java 8 based interfaces that the given class implements).
512
540
* @param clazz the class to introspect
513
541
* @param mc the callback to invoke for each method
514
- * @since 4.2
515
542
* @throws IllegalStateException if introspection fails
543
+ * @since 4.2
516
544
* @see #doWithMethods
517
545
*/
518
546
public static void doWithLocalMethods (Class <?> clazz , MethodCallback mc ) {
@@ -682,8 +710,8 @@ private static List<Method> findConcreteMethodsOnInterfaces(Class<?> clazz) {
682
710
* Invoke the given callback on all locally declared fields in the given class.
683
711
* @param clazz the target class to analyze
684
712
* @param fc the callback to invoke for each field
685
- * @since 4.2
686
713
* @throws IllegalStateException if introspection fails
714
+ * @since 4.2
687
715
* @see #doWithFields
688
716
*/
689
717
public static void doWithLocalFields (Class <?> clazz , FieldCallback fc ) {
@@ -846,26 +874,4 @@ public interface FieldFilter {
846
874
boolean matches (Field field );
847
875
}
848
876
849
-
850
- /**
851
- * Pre-built FieldFilter that matches all non-static, non-final fields.
852
- */
853
- public static final FieldFilter COPYABLE_FIELDS =
854
- field -> !(Modifier .isStatic (field .getModifiers ()) || Modifier .isFinal (field .getModifiers ()));
855
-
856
-
857
- /**
858
- * Pre-built MethodFilter that matches all non-bridge methods.
859
- */
860
- public static final MethodFilter NON_BRIDGED_METHODS =
861
- (method -> !method .isBridge ());
862
-
863
-
864
- /**
865
- * Pre-built MethodFilter that matches all non-bridge non-synthetic methods
866
- * which are not declared on {@code java.lang.Object}.
867
- */
868
- public static final MethodFilter USER_DECLARED_METHODS =
869
- (method -> (!method .isBridge () && !method .isSynthetic () && method .getDeclaringClass () != Object .class ));
870
-
871
877
}
0 commit comments