java.lang.Object
java.beans.FeatureDescriptor
java.beans.EventSetDescriptor
EventSetDescriptor 描述给定 Java bean 触发的一组事件。
给定的事件组都作为单个事件监听接口上的方法调用传递,并且可以通过调用事件源提供的注册方法来注册事件监听对象。
- 自从:
- 1.1
-
构造方法总结
构造方法构造方法描述EventSetDescriptor(Class<?> sourceClass, String eventSetName, Class<?> listenerType, String listenerMethodName) 创建一个EventSetDescriptor假设您遵循最简单的标准设计模式,其中命名事件“fred”是 (1) 作为对接口 FredListener 的单个方法的调用传递的,(2) 具有 FredEvent 类型的单个参数,并且 ( 3) 其中 FredListener 可以通过对源组件的 addFredListener 方法的调用进行注册,并通过对 removeFredListener 方法的调用进行删除。EventSetDescriptor(Class<?> sourceClass, String eventSetName, Class<?> listenerType, String[] listenerMethodNames, String addListenerMethodName, String removeListenerMethodName) 使用字符串名称从头开始创建EventSetDescriptor。EventSetDescriptor(Class<?> sourceClass, String eventSetName, Class<?> listenerType, String[] listenerMethodNames, String addListenerMethodName, String removeListenerMethodName, String getListenerMethodName) 此构造方法使用字符串名称从头开始创建一个 EventSetDescriptor。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。 -
方法总结
修饰符和类型方法描述获取用于添加事件监听的方法。获取用于访问已注册事件监听的方法。获取目标监听器接口的MethodDescriptors。Method[]获取目标监听接口的方法。Class<?>获取目标接口的Class对象。获取用于删除事件监听的方法。boolean报告事件集是否在“默认”集中。boolean通常事件源是多播的。voidsetInDefaultEventSet(boolean inDefaultEventSet) 将事件集标记为在“默认”集中(或不在)。voidsetUnicast(boolean unicast) 将事件集标记为单播(或非单播)。在类 java.beans.FeatureDescriptor 中声明的方法
attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue, toString
-
构造方法详细信息
-
EventSetDescriptor
public EventSetDescriptor(Class <?> sourceClass, String eventSetName, Class <?> listenerType, String listenerMethodName) throws IntrospectionException 创建一个EventSetDescriptor假设您遵循最简单的标准设计模式,其中命名事件“fred”是 (1) 作为对接口 FredListener 的单个方法的调用传递的,(2) 具有 FredEvent 类型的单个参数,并且 ( 3) 其中 FredListener 可以通过对源组件的 addFredListener 方法的调用进行注册,并通过对 removeFredListener 方法的调用进行删除。- 参数:
sourceClass- 触发事件的类。eventSetName- 事件的编程名称。例如“弗雷德”。请注意,这通常应以小写字符开头。listenerType- 事件将传递到的目标接口。listenerMethodName- 当事件传递到其目标监听器接口时将调用的方法。- 抛出:
IntrospectionException- 如果在内省期间发生异常。
-
EventSetDescriptor
public EventSetDescriptor(Class <?> sourceClass, String eventSetName, Class <?> listenerType, String [] listenerMethodNames, String addListenerMethodName, String removeListenerMethodName) throws IntrospectionException 使用字符串名称从头开始创建EventSetDescriptor。- 参数:
sourceClass- 触发事件的类。eventSetName- 事件集的编程名称。请注意,这通常应以小写字符开头。listenerType- 事件将传递到的目标接口的类。listenerMethodNames- 事件传递到其目标监听器接口时将调用的方法的名称。addListenerMethodName- 事件源上可用于注册事件监听器对象的方法的名称。removeListenerMethodName- 事件源上可用于注销事件监听器对象的方法的名称。- 抛出:
IntrospectionException- 如果在内省期间发生异常。
-
EventSetDescriptor
public EventSetDescriptor(Class <?> sourceClass, String eventSetName, Class <?> listenerType, String [] listenerMethodNames, String addListenerMethodName, String removeListenerMethodName, String getListenerMethodName) throws IntrospectionException 此构造方法使用字符串名称从头开始创建一个 EventSetDescriptor。- 参数:
sourceClass- 触发事件的类。eventSetName- 事件集的编程名称。请注意,这通常应以小写字符开头。listenerType- 事件将传递到的目标接口的类。listenerMethodNames- 事件传递到其目标监听器接口时将调用的方法的名称。addListenerMethodName- 事件源上可用于注册事件监听器对象的方法的名称。removeListenerMethodName- 事件源上可用于注销事件监听器对象的方法的名称。getListenerMethodName- 事件源上的方法,可用于访问事件监听器对象数组。- 抛出:
IntrospectionException- 如果在内省期间发生异常。- 自从:
- 1.4
-
EventSetDescriptor
public EventSetDescriptor(String eventSetName, Class <?> listenerType, Method [] listenerMethods, Method addListenerMethod, Method removeListenerMethod) throws IntrospectionException 使用java.lang.reflect.Method和java.lang.Class对象从头开始创建EventSetDescriptor。- 参数:
eventSetName- 事件集的编程名称。listenerType- 监听器接口的类。listenerMethods- 描述目标监听器中每个事件处理方法的 Method 对象数组。addListenerMethod- 事件源上的方法,可用于注册事件监听器对象。removeListenerMethod- 事件源上的方法,可用于取消注册事件监听器对象。- 抛出:
IntrospectionException- 如果在内省期间发生异常。
-
EventSetDescriptor
public EventSetDescriptor(String eventSetName, Class <?> listenerType, Method [] listenerMethods, Method addListenerMethod, Method removeListenerMethod, Method getListenerMethod) throws IntrospectionException 此构造方法使用 java.lang.reflect.Method 和 java.lang.Class 对象从头开始创建 EventSetDescriptor。- 参数:
eventSetName- 事件集的编程名称。listenerType- 监听器接口的类。listenerMethods- 描述目标监听器中每个事件处理方法的 Method 对象数组。addListenerMethod- 事件源上的方法,可用于注册事件监听器对象。removeListenerMethod- 事件源上的方法,可用于取消注册事件监听器对象。getListenerMethod- 事件源上的方法,可用于访问事件监听器对象数组。- 抛出:
IntrospectionException- 如果在内省期间发生异常。- 自从:
- 1.4
-
EventSetDescriptor
public EventSetDescriptor(String eventSetName, Class <?> listenerType, MethodDescriptor [] listenerMethodDescriptors, Method addListenerMethod, Method removeListenerMethod) throws IntrospectionException 使用java.lang.reflect.MethodDescriptor和java.lang.Class对象从头开始创建EventSetDescriptor。- 参数:
eventSetName- 事件集的编程名称。listenerType- 监听器接口的类。listenerMethodDescriptors- MethodDescriptor 对象数组,描述目标监听器中的每个事件处理方法。addListenerMethod- 事件源上的方法,可用于注册事件监听器对象。removeListenerMethod- 事件源上的方法,可用于取消注册事件监听器对象。- 抛出:
IntrospectionException- 如果在内省期间发生异常。
-
-
方法详情
-
getListenerType
获取目标接口的Class对象。- 返回:
- 触发事件时将调用的目标接口的 Class 对象。
-
getListenerMethods
获取目标监听接口的方法。- 返回:
-
目标监听器接口中目标方法的
Method对象数组,将在触发事件时调用。
-
getListenerMethodDescriptors
获取目标监听器接口的MethodDescriptors。- 返回:
-
目标监听器接口中目标方法的
MethodDescriptor对象数组,将在触发事件时调用。
-
getAddListenerMethod
获取用于添加事件监听的方法。- 返回:
- 用于在事件源处注册监听的方法。
-
getRemoveListenerMethod
获取用于删除事件监听的方法。- 返回:
- 用于在事件源移除监听的方法。
-
getGetListenerMethod
获取用于访问已注册事件监听的方法。- 返回:
- 用于访问事件源中监听数组的方法,如果不存在则为 null。
- 自从:
- 1.4
-
setUnicast
public void setUnicast(boolean unicast) 将事件集标记为单播(或非单播)。- 参数:
unicast- 如果事件集是单播则为真。
-
isUnicast
public boolean isUnicast()通常事件源是多播的。然而,有一些异常是严格单播的。- 返回:
true如果事件集是单播的。默认为false。
-
setInDefaultEventSet
public void setInDefaultEventSet(boolean inDefaultEventSet) 将事件集标记为在“默认”集中(或不在)。默认情况下这是true。- 参数:
inDefaultEventSet-true如果事件集在“默认”集中,false如果不是
-
isInDefaultEventSet
public boolean isInDefaultEventSet()报告事件集是否在“默认”集中。- 返回:
true如果事件集在“默认”集中。默认为true。
-