- java.lang.Object
-
- java.util.EventObject
-
- java.beans.beancontext.BeanContextEvent
-
- java.beans.beancontext.BeanContextMembershipEvent
-
- All Implemented Interfaces:
-
Serializable
public class BeanContextMembershipEvent extends BeanContextEvent
ABeanContextMembershipEvent
封装了添加到特定BeanContext
的成员资格或从其中删除的子项列表。 在给定的BeanContext
实例上调用成功的add(),remove(),retainAll(),removeAll()或clear()时,此事件的实例将被触发。 有兴趣接收此类事件的对象必须实现BeanContextMembershipListener
接口,并且必须通过BeanContext
的addBeanContextMembershipListener(BeanContextMembershipListener bcml)
方法注册其意图。- 从以下版本开始:
- 1.2
- 另请参见:
-
BeanContext
,BeanContextEvent
,BeanContextMembershipListener
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field 描述 protected Collection
children
受此事件通知影响的小孩列表。-
Fields inherited from class java.beans.beancontext.BeanContextEvent
propagatedFrom
-
Fields inherited from class java.util.EventObject
source
-
-
构造方法摘要
构造方法 Constructor 描述 BeanContextMembershipEvent(BeanContext bc, Object[] changes)
引发BeanContextMembershipEventBeanContextMembershipEvent(BeanContext bc, Collection changes)
引发BeanContextMembershipEvent
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 boolean
contains(Object child)
孩子指定是否受到事件的影响?Iterator
iterator()
获取受此事件影响的子项数组。int
size()
获取受通知影响的孩子数量。Object[]
toArray()
获取受此事件影响的子项数组。-
Methods inherited from class java.beans.beancontext.BeanContextEvent
getBeanContext, getPropagatedFrom, isPropagated, setPropagatedFrom
-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
字段详细信息
-
children
protected Collection children
受此事件通知影响的小孩列表。
-
-
构造方法详细信息
-
BeanContextMembershipEvent
public BeanContextMembershipEvent(BeanContext bc, Collection changes)
引发BeanContextMembershipEvent- 参数
-
bc
- BeanContext源码 -
changes
- 受影响的儿童 - 异常
-
NullPointerException
- 如果changes
是null
-
BeanContextMembershipEvent
public BeanContextMembershipEvent(BeanContext bc, Object[] changes)
引发BeanContextMembershipEvent- 参数
-
bc
- BeanContext源码 -
changes
- 儿童受影响 - 异常
-
NullPointerException
- 如果与此事件相关联的更改为空。
-
-