类的用途
java.lang.reflect.Method
使用 Method 的包
包
描述
包含与开发 beans 相关的类——基于 JavaBeans 体系结构的组件。
提供对 Java 编程语言的设计至关重要的类。
为 Java 编程语言注解工具提供库支持。
java.lang.invoke 包提供用于与 Java 虚拟机交互的低级原语。
提供用于获取有关类和对象的反射信息的类和接口。
提供用于支持 RMI 服务端的类和接口。
为 Java 管理扩展提供核心类。
提供 ModelMBean 类的定义。
提供开放数据类型和 Open MBean 描述符类。
包含的类通过提供某些类的基本实现以及各种实用程序,使语言运行时更方便地实现自己的特定于语言的对象模型和类型转换。
为构建 JShell 执行引擎提供实现支持。
-
Method 在 java.beans 中的用法
java.beans 中返回 Method 的方法修饰符和类型方法描述EventSetDescriptor.getAddListenerMethod()获取用于添加事件监听的方法。EventSetDescriptor.getGetListenerMethod()获取用于访问已注册事件监听的方法。IndexedPropertyDescriptor.getIndexedReadMethod()获取应该用于读取索引属性值的方法。IndexedPropertyDescriptor.getIndexedWriteMethod()获取应用于写入索引属性值的方法。Method[]EventSetDescriptor.getListenerMethods()获取目标监听接口的方法。MethodDescriptor.getMethod()获取此 MethodDescriptor 封装的方法。PropertyDescriptor.getReadMethod()获取应该用于读取属性值的方法。EventSetDescriptor.getRemoveListenerMethod()获取用于删除事件监听的方法。PropertyDescriptor.getWriteMethod()获取应该用于写入属性值的方法。java.beans 中的方法,参数类型为 Method修饰符和类型方法描述从事件中提取适当的属性值并将其传递给与此EventHandler关联的操作。voidIndexedPropertyDescriptor.setIndexedReadMethod(Method readMethod) 设置应该用于读取索引属性值的方法。voidIndexedPropertyDescriptor.setIndexedWriteMethod(Method writeMethod) 设置应该用于写入索引属性值的方法。voidPropertyDescriptor.setReadMethod(Method readMethod) 设置应该用于读取属性值的方法。voidPropertyDescriptor.setWriteMethod(Method writeMethod) 设置应该用于写入属性值的方法。java.beans 中的构造函数,参数类型为 Method修饰符构造方法描述EventSetDescriptor(String eventSetName, Class<?> listenerType, MethodDescriptor[] listenerMethodDescriptors, Method addListenerMethod, Method removeListenerMethod) 使用java.lang.reflect.MethodDescriptor和java.lang.Class对象从头开始创建EventSetDescriptor。EventSetDescriptor(String eventSetName, Class<?> listenerType, Method[] listenerMethods, Method addListenerMethod, Method removeListenerMethod) 使用java.lang.reflect.Method和java.lang.Class对象从头开始创建EventSetDescriptor。EventSetDescriptor(String eventSetName, Class<?> listenerType, Method[] listenerMethods, Method addListenerMethod, Method removeListenerMethod, Method getListenerMethod) 此构造方法使用 java.lang.reflect.Method 和 java.lang.Class 对象从头开始创建 EventSetDescriptor。IndexedPropertyDescriptor(String propertyName, Method readMethod, Method writeMethod, Method indexedReadMethod, Method indexedWriteMethod) 此构造方法采用简单属性的名称和用于读取和写入属性的方法对象。MethodDescriptor(Method method) 从Method构造一个MethodDescriptor。MethodDescriptor(Method method, ParameterDescriptor[] parameterDescriptors) 从Method构造一个MethodDescriptor,为每个方法的参数提供描述性信息。PropertyDescriptor(String propertyName, Method readMethod, Method writeMethod) 此构造方法采用简单属性的名称和用于读取和写入属性的方法对象。 -
Method 在 java.lang 中的用法
修饰符和类型方法描述Class.getDeclaredMethod(String name, Class<?>... parameterTypes) 返回一个Method对象,该对象反映了此Class对象表示的类或接口的指定声明方法。Method[]Class.getDeclaredMethods()返回包含Method个对象的数组,这些对象反映了此Class对象表示的类或接口的所有已声明方法,包括公共、受保护、默认(包)访问和私有方法,但不包括继承方法。Class.getEnclosingMethod()如果此Class对象表示方法中的本地或匿名类,则返回一个Method对象表示基础类的直接封闭方法。返回一个Method对象,该对象反映此Class对象表示的类或接口的指定公共成员方法。Method[]Class.getMethods()返回一个包含Method个对象的数组,这些对象反映了这个Class对象所表示的类或接口的所有公共方法,包括类或接口声明的方法以及从超类和超接口继承的方法。 -
Method 在 java.lang.annotation 中的用法
java.lang.annotation 中返回 Method 的方法java.lang.annotation 中的构造函数,参数类型为 Method修饰符构造方法描述AnnotationTypeMismatchException(Method element, String foundType) 为指定的注解类型元素和找到的数据类型构造一个 AnnotationTypeMismatchException。 -
Method 在 java.lang.invoke 中的用法
java.lang.invoke 中的方法,参数类型为 Method修饰符和类型方法描述制作一个 直接方法句柄 到m,如果查找类具有权限。MethodHandles.Lookup.unreflectSpecial(Method m, Class<?> specialCaller) 为反射方法生成方法句柄。 -
Method 在 java.lang.reflect 中的用法
java.lang.reflect 中返回 Method 的方法返回类型中包含 Method 类型参数的 java.lang.reflect 中的方法修饰符和类型方法描述Method.getTypeParameters()返回一个TypeVariable对象数组,这些对象表示由此GenericDeclaration对象表示的泛型声明所声明的类型变量,按声明顺序排列。java.lang.reflect 中的方法,参数类型为 Method -
Method 在 java.rmi.server 中的用法
java.rmi.server 中的方法,参数类型为 Method -
Method 在 javax.management 中的用法
javax.management 中的方法,参数类型为 Methodjavax.management 中的构造函数,参数类型为 Method修饰符构造方法描述MBeanAttributeInfo(String name, String description, Method getter, Method setter) 此构造方法采用简单属性的名称和用于读取和写入属性的方法对象。MBeanOperationInfo(String description, Method method) 构造一个MBeanOperationInfo对象. -
Method 在 javax.management.modelmbean 中的用法
javax.management.modelmbean 中的构造函数,参数类型为 Method修饰符构造方法描述ModelMBeanAttributeInfo(String name, String description, Method getter, Method setter) 使用默认描述符构造一个 ModelMBeanAttributeInfo 对象。ModelMBeanAttributeInfo(String name, String description, Method getter, Method setter, Descriptor descriptor) 构造一个 ModelMBeanAttributeInfo 对象。ModelMBeanOperationInfo(String description, Method operationMethod) 使用默认描述符构造一个 ModelMBeanOperationInfo 对象。ModelMBeanOperationInfo(String description, Method operationMethod, Descriptor descriptor) 构造一个 ModelMBeanOperationInfo 对象。 -
Method 在 javax.management.openmbean 中的用法
javax.management.openmbean 中的方法,参数类型为 Method -
Method 在 jdk.dynalink.linker.support 中的用法
jdk.dynalink.linker.support 中的方法,参数类型为 Method -
Method 在 jdk.jshell.execution 中的用法
jdk.jshell.execution 中的方法,参数类型为 Method