bridge Methods to the
Method being bridged.
Given a synthetic bridge Method returns the
Method being bridged. A bridge method may be created by the compiler
when extending a parameterized type whose methods have parameterized
arguments. During runtime invocation the bridge Method may be invoked
and/or used via reflection. When attempting to locate annotations on
Methods, it is wise to check for bridge Methods
as appropriate and find the bridged Method.
See The Java Language Specification for more details on the use of bridge methods.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static Map | createTypeVariableMap(Class<?> cls)
Build a mapping of |
| private static Class | extractClassForTypeVariable(TypeVariable<?> typeVariable)
Extracts the bound ' |
| private static void | extractTypeVariablesFromGenericInterfaces(Type[] genericInterfaces, Map<TypeVariable<?>, Type> typeVariableMap)
|
| public static Method | Returns: the original method for the bridgethe bridge method bridgeMethod)Find the original method for the supplied |
| private static Method | findGenericDeclaration(Method bridgeMethod)
Search for the generic |
| private static Method | Returns: the Method object, ornull if none foundthe class to introspect clazz, String the name of the method name, Class<?>[] the parameter types of the method paramTypes)Attempt to find a |
| private static Method[] | getAllDeclaredMethods(Class<?> leafClass)
Get all declared methods on the leaf class and all superclasses. |
| private static Class | Returns: all interfaces that the given object implements as arraythe class to analyse for interfaces clazz)Return all interfaces that the given class implements as array, including ones implemented by superclasses. |
| private static Type | getRawType(Type genericType, Map<TypeVariable<?>, Type> typeVariableMap)
Determine the raw type for the given generic parameter type. |
| private static boolean | isBridgedCandidateFor(Method candidateMethod, Method bridgeMethod)
Return |
| private static boolean | isBridgeMethodFor(Method bridgeMethod, Method candidateMethod, Map<TypeVariable<?>, Type> typeVariableMap)
Determine whether or not the bridge |
| private static boolean | isResolvedTypeMatch(Method genericMethod, Method candidateMethod, Map<TypeVariable<?>, Type> typeVariableMap)
Return |
| private static void | populateTypeMapFromParameterizedType(ParameterizedType type, Map<TypeVariable<?>, Type> typeVariableMap)
Read the |
| private static Method | Returns: the bridged method, ornull if none foundthe List of candidate Methods candidateMethods, Method the bridge method bridgeMethod)Search for the bridged method in the given candidates. |
| private static Method |
| BridgeMethodResolver | back to summary |
|---|---|
| private BridgeMethodResolver() | |
| createTypeVariableMap | back to summary |
|---|---|
| private static Map Build a mapping of | |
| extractClassForTypeVariable | back to summary |
|---|---|
| private static Class Extracts the bound ' | |
| extractTypeVariablesFromGenericInterfaces | back to summary |
|---|---|
| private static void extractTypeVariablesFromGenericInterfaces(Type[] genericInterfaces, Map<TypeVariable<?>, Type> typeVariableMap) | |
| findBridgedMethod | back to summary |
|---|---|
| public static Method findBridgedMethod(Method bridgeMethod) Find the original method for the supplied
It is safe to call this method passing in a non-bridge
| |
| findGenericDeclaration | back to summary |
|---|---|
| private static Method findGenericDeclaration(Method bridgeMethod) Search for the generic
| |
| findMethod | back to summary |
|---|---|
| private static Method findMethod(Class<?> clazz, String name, Class<?>[] paramTypes) Attempt to find a
Returns | |
| getAllDeclaredMethods | back to summary |
|---|---|
| private static Method[] getAllDeclaredMethods(Class<?> leafClass) Get all declared methods on the leaf class and all superclasses. Leaf class methods are included first. | |
| getAllInterfacesForClass | back to summary |
|---|---|
| private static Class Return all interfaces that the given class implements as array, including ones implemented by superclasses. If the class itself is an interface, it gets returned as sole interface. | |
| getRawType | back to summary |
|---|---|
| private static Type getRawType(Type genericType, Map<TypeVariable<?>, Type> typeVariableMap) Determine the raw type for the given generic parameter type. | |
| isBridgedCandidateFor | back to summary |
|---|---|
| private static boolean isBridgedCandidateFor(Method candidateMethod, Method bridgeMethod) Return | |
| isBridgeMethodFor | back to summary |
|---|---|
| private static boolean isBridgeMethodFor(Method bridgeMethod, Method candidateMethod, Map<TypeVariable<?>, Type> typeVariableMap) Determine whether or not the bridge | |
| isResolvedTypeMatch | back to summary |
|---|---|
| private static boolean isResolvedTypeMatch(Method genericMethod, Method candidateMethod, Map<TypeVariable<?>, Type> typeVariableMap) Return | |
| populateTypeMapFromParameterizedType | back to summary |
|---|---|
| private static void populateTypeMapFromParameterizedType(ParameterizedType type, Map<TypeVariable<?>, Type> typeVariableMap) Read the Consider this case: | |
| searchCandidates | back to summary |
|---|---|
| private static Method searchCandidates(List<Method> candidateMethods, Method bridgeMethod) Search for the bridged method in the given candidates. | |
| searchForMatch | back to summary |
|---|---|
| private static Method searchForMatch(Class<?> type, Method bridgeMethod) If the supplied | |