Method in a non-public class, even if the Method is public and if there is a
public ancestor class or interface that declares it. We need to use the Method from the
public ancestor.
Because looking for these methods is relatively expensive, an instance of this class will keep a cache of methods it previously discovered.
| Modifier and Type | Field and Description |
|---|---|
| private static final Method | |
| private final Table | methodCache
For a given class and name, returns all public methods of that name in the class, as previously
determined by |
| private static final Method | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | |
| private static boolean | |
| pack-priv synchronized ImmutableSet | publicMethodsWithName(Class<?> startClass, String name)
Returns the set of public methods with the given name in the given class. |
| private ImmutableSet | |
| pack-priv static Method | Returns: a public method in a public class or interface, or null if none was found.Returns a Method with the same name and parameter types as the given one, but that is in a public class or interface. |
| CLASS_GET_MODULE_METHOD | back to summary |
|---|---|
| private static final Method CLASS_GET_MODULE_METHOD | |
| methodCache | back to summary |
|---|---|
| private final Table<Class<?>, String, ImmutableSet<Method>> methodCache For a given class and name, returns all public methods of that name in the class, as previously
determined by Currently we add the entry for any given (class, name) pair on demand. An alternative would
be to add all the methods for a given class at once. With the current scheme, we may end up
calling | |
| MODULE_IS_EXPORTED_METHOD | back to summary |
|---|---|
| private static final Method MODULE_IS_EXPORTED_METHOD | |
| THIS_PACKAGE | back to summary |
|---|---|
| private static final String THIS_PACKAGE | |
| MethodFinder | back to summary |
|---|---|
| pack-priv MethodFinder() | |
| classIsExported | back to summary |
|---|---|
| private static boolean classIsExported(Class<?> c) | |
| classIsPublic | back to summary |
|---|---|
| private static boolean classIsPublic(Class<?> c) Returns whether the given class is public as seen from this class. Prior to Java 9, a class was
either public or not public. But with the introduction of modules in Java 9, a class can be
marked public and yet not be visible, if it is not exported from the module it appears in. So,
on Java 9, we perform an additional check on class | |
| publicMethodsWithName | back to summary |
|---|---|
| pack-priv synchronized ImmutableSet Returns the set of public methods with the given name in the given class. Here, "public
methods" means public methods in public classes or interfaces. If | |
| uncachedPublicMethodsWithName | back to summary |
|---|---|
| private ImmutableSet | |
| visibleMethod | back to summary |
|---|---|
| pack-priv static Method visibleMethod(Method method, Class<?> in) Returns a Method with the same name and parameter types as the given one, but that is in a public class or interface. This might be the given method, or it might be a method in a superclass or superinterface.
| |