java.applet

java.awt

java.awt.color

java.awt.datatransfer

java.awt.dnd

java.awt.event

java.awt.font

java.awt.geom

java.awt.im

java.awt.im.spi

java.awt.image

java.awt.image.renderable

java.awt.print

java.beans

java.beans.beancontext

java.io

java.lang

java.lang.annotation

java.lang.instrument

java.lang.management

java.lang.ref

java.lang.reflect

java.math

java.net

java.nio

java.nio.channels

java.nio.channels.spi

java.nio.charset

java.nio.charset.spi

java.rmi

java.rmi.activation

java.rmi.dgc

java.rmi.registry

java.rmi.server

java.security

java.security.acl

java.security.cert

java.security.interfaces

java.security.spec

java.sql

java.text

java.util

java.util.concurrent

java.util.concurrent.atomic

java.util.concurrent.locks

java.util.jar

java.util.logging

java.util.prefs

java.util.regex

java.util.zip

javax.accessibility

javax.activity

javax.crypto

javax.crypto.interfaces

javax.crypto.spec

javax.imageio

javax.imageio.event

javax.imageio.metadata

javax.imageio.plugins.bmp

javax.imageio.plugins.jpeg

javax.imageio.spi

javax.imageio.stream

javax.management

javax.management.loading

javax.management.modelmbean

javax.management.monitor

javax.management.openmbean

javax.management.relation

javax.management.remote

javax.management.remote.rmi

javax.management.timer

javax.naming

javax.naming.directory

javax.naming.event

javax.naming.ldap

javax.naming.spi

javax.net

javax.net.ssl

javax.print

javax.print.attribute

javax.print.attribute.standard

javax.print.event

javax.rmi

javax.rmi.CORBA

javax.rmi.ssl

javax.security.auth

javax.security.auth.callback

javax.security.auth.kerberos

javax.security.auth.login

javax.security.auth.spi

javax.security.auth.x500

javax.security.cert

javax.security.sasl

javax.sound.midi

javax.sound.midi.spi

javax.sound.sampled

javax.sound.sampled.spi

javax.sql

javax.sql.rowset

javax.sql.rowset.serial

javax.sql.rowset.spi

javax.swing

javax.swing.border

javax.swing.colorchooser

javax.swing.event

javax.swing.filechooser

javax.swing.plaf

javax.swing.plaf.basic

javax.swing.plaf.metal

javax.swing.plaf.multi

javax.swing.plaf.synth

javax.swing.table

javax.swing.text

javax.swing.text

javax.swing.text.parser

javax.swing.text.rtf

javax.swing.tree

javax.swing.undo

javax.transaction

javax.transaction.xa

javax.xml

javax.xml.datatype

javax.xml.namespace

javax.xml.parsers

javax.xml.transform

javax.xml.transform.dom

javax.xml.transform.sax

javax.xml.transform.stream

javax.xml.validation

javax.xml.xpath

org.ietf.jgss

org.omg.CORBA

org.omg.CORBA_2_3

org.omg.CORBA_2_3.portable

org.omg.CORBA.DynAnyPackage

org.omg.CORBA.ORBPackage

org.omg.CORBA.portable

org.omg.CORBA.TypeCodePackage

org.omg.CosNaming

org.omg.CosNaming.NamingContextExtPackage

org.omg.CosNaming.NamingContextPackage

org.omg.Dynamic

org.omg.DynamicAny

org.omg.DynamicAny.DynAnyFactoryPackage

org.omg.DynamicAny.DynAnyPackage

org.omg.IOP

org.omg.IOP.CodecFactoryPackage

org.omg.IOP.CodecPackage

org.omg.Messaging

org.omg.PortableInterceptor

org.omg.PortableInterceptor.ORBInitInfoPackage

org.omg.PortableServer

org.omg.PortableServer.CurrentPackage

org.omg.PortableServer.POAManagerPackage

org.omg.PortableServer.POAPackage

org.omg.PortableServer.portable

org.omg.PortableServer.ServantLocatorPackage

org.omg.SendingContext

org.omg.stub.java.rmi

org.w3c.dom

org.w3c.dom.bootstrap

org.w3c.dom.events

org.w3c.dom.ls

org.xml.sax

org.xml.sax.ext

org.xml.sax.helpers

allclasses-frame

allclasses-noframe

constant-values

deprecated-list

help-doc

JavaTM 2 Platform
Standard Ed. 5.0

java.beans
类 EventSetDescriptor

java.lang.Object
  继承者 java.beans.FeatureDescriptor
      继承者 java.beans.EventSetDescriptor

public class EventSetDescriptor
extends FeatureDescriptor

描述给定 Java bean 激发的一组事件的 EventSetDescriptor。

给定的事件组都是作为方法调用在单个事件侦听器接口上传递的,事件侦听器对象可以通过调用事件源提供的注册方法进行注册。


构造方法摘要
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, Method[] listenerMethods, Method addListenerMethod, Method removeListenerMethod)
          使用 java.lang.reflect.Methodjava.lang.Class 对象从头开始创建 EventSetDescriptor
EventSetDescriptor(String eventSetName, Class<?> listenerType, Method[] listenerMethods, Method addListenerMethod, Method removeListenerMethod, Method getListenerMethod)
          此构造方法使用 java.lang.reflect.Method 和 java.lang.Class 对象从头开始创建 EventSetDescriptor。
EventSetDescriptor(String eventSetName, Class<?> listenerType, MethodDescriptor[] listenerMethodDescriptors, Method addListenerMethod, Method removeListenerMethod)
          使用 java.lang.reflect.MethodDescriptorjava.lang.Class 对象从头开始创建 EventSetDescriptor
 
方法摘要
 Method getAddListenerMethod()
          获得用来添加事件侦听器的方法。
 Method getGetListenerMethod()
          获得用来访问已注册事件侦听器的方法。
 MethodDescriptor[] getListenerMethodDescriptors()
          获得目标侦听器接口的 MethodDescriptor
 Method[] getListenerMethods()
          获得目标侦听器接口的方法。
 Class<?> getListenerType()
          获得目标接口的 Class 对象。
 Method getRemoveListenerMethod()
          获得用来移除事件侦听器的方法。
 boolean isInDefaultEventSet()
          报告事件集是否在“默认”集合中。
 boolean isUnicast()
          通常事件源是多播的。
 void setInDefaultEventSet(boolean inDefaultEventSet)
          将事件集标记为“默认”集合(或非默认集合)。
 void setUnicast(boolean unicast)
          将事件集标记为单播(或非单播)。
 
从类 java.beans.FeatureDescriptor 继承的方法
attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

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 - 事件的编程名称,例如 "fred"。注意,此参数通常应该以小写字母开头。
listenerType - 事件将被传递到的目标接口。
listenerMethodName - 事件传递到其目标侦听器接口时调用的方法。
抛出:
IntrospectionException - 如果在内省期间发生异常。

EventSetDescriptor

public EventSetDescriptor(Class<?> sourceClass,
                          String eventSetName,
                          Class<?> listenerType,
                          String[] listenerMethodNames,
                          String addListenerMethodName,
                          String removeListenerMethodName)
                   throws IntrospectionException
使用字符串名称从头开始创建 EventSetDescriptor

参数:
sourceClass - 激发事件的类。
eventSetName - 事件集的编程名称。注意,此参数通常应该以小写字母开头。
listenerType - 事件将被传递到的目标接口的 Class。
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 - 事件将被传递到的目标接口的 Class。
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.Methodjava.lang.Class 对象从头开始创建 EventSetDescriptor

参数:
eventSetName - 事件集的编程名称。
listenerType - 侦听器接口的 Class。
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 - 侦听器接口的 Class。
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.MethodDescriptorjava.lang.Class 对象从头开始创建 EventSetDescriptor

参数:
eventSetName - 事件集的编程名称。
listenerType - 侦听器接口的 Class。
listenerMethodDescriptors - 描述处理目标侦听器中方法的每个事件的 MethodDescriptor 对象数组。
addListenerMethod - 可用来注册事件侦听器对象的事件源上的方法。
removeListenerMethod - 可用来取消注册事件侦听器对象的事件源上的方法。
抛出:
IntrospectionException - 如果在内省期间发生异常。
方法详细信息

getListenerType

public Class<?> getListenerType()
获得目标接口的 Class 对象。

返回:
激发事件时将调用的目标接口的 Class 对象。

getListenerMethods

public Method[] getListenerMethods()
获得目标侦听器接口的方法。

返回:
激发事件时将调用的目标侦听器接口中目标方法的 Method 对象数组。

getListenerMethodDescriptors

public MethodDescriptor[] getListenerMethodDescriptors()
获得目标侦听器接口的 MethodDescriptor

返回:
激发事件时将调用的目标侦听器接口中目标方法的 MethodDescriptor 对象数组。

getAddListenerMethod

public Method getAddListenerMethod()
获得用来添加事件侦听器的方法。

返回:
用来在事件源注册侦听器的方法。

getRemoveListenerMethod

public Method getRemoveListenerMethod()
获得用来移除事件侦听器的方法。

返回:
用来在事件源移除侦听器的方法。

getGetListenerMethod

public Method getGetListenerMethod()
获得用来访问已注册事件侦听器的方法。

返回:
用来访问事件源处的侦听器数组的方法,如果不存在侦听器,则返回 null。
从以下版本开始:
1.4

setUnicast

public void setUnicast(boolean unicast)
将事件集标记为单播(或非单播)。

参数:
unicast - 如果事件集是单播的,则该参数为 true。

isUnicast

public boolean isUnicast()
通常事件源是多播的。不过也有是严格单播的一些例外。

返回:
如果事件集是单播的,则返回 true。默认值为 false

setInDefaultEventSet

public void setInDefaultEventSet(boolean inDefaultEventSet)
将事件集标记为“默认”集合(或非默认集合)。默认情况下,该值为 true

参数:
inDefaultEventSet - 如果事件集在“默认”集合中,则该参数为 true,否则为 false

isInDefaultEventSet

public boolean isInDefaultEventSet()
报告事件集是否在“默认”集合中。

返回:
如果事件集在“默认”集合中,则返回 true。默认值为 true

JavaTM 2 Platform
Standard Ed. 5.0

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java 2 SDK SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策