public class BeanContextMembershipEvent extends BeanContextEvent
BeanContextMembershipEvent
封装了添加到BeanContextMembershipEvent
BeanContext的BeanContextMembershipEvent
身份或从其删除的子组BeanContext
。
在给定的BeanContext
实例上调用成功的add(),remove(),retainAll(),removeAll()或clear()时,此事件的实例将被触发。
有兴趣接收此类事件的对象必须实现BeanContextMembershipListener
接口,并且必须通过BeanContext
的addBeanContextMembershipListener(BeanContextMembershipListener bcml)
方法注册其意图。
BeanContext
, BeanContextEvent
, BeanContextMembershipListener
, Serialized Form
Modifier and Type | Field and Description |
---|---|
protected Collection |
children
受此事件通知影响的小孩列表。
|
propagatedFrom
source
Constructor and Description |
---|
BeanContextMembershipEvent(BeanContext bc, Collection changes)
引发BeanContextMembershipEvent
|
BeanContextMembershipEvent(BeanContext bc, Object[] changes)
引发BeanContextMembershipEvent
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Object child)
孩子指定是否受到事件的影响?
|
Iterator |
iterator()
获取受此事件影响的子项数组。
|
int |
size()
获取受通知影响的小孩数量。
|
Object[] |
toArray()
获取受此事件影响的子项数组。
|
getBeanContext, getPropagatedFrom, isPropagated, setPropagatedFrom
getSource, toString
protected Collection children
public BeanContextMembershipEvent(BeanContext bc, Collection changes)
bc
- BeanContext源码
changes
- 受影响的儿童
NullPointerException
- 如果
changes
是
null
public BeanContextMembershipEvent(BeanContext bc, Object[] changes)
bc
- BeanContext源码
changes
- 儿童受影响
NullPointerException
- 如果与此事件相关联的更改为空。