- java.lang.Object
-
- java.beans.beancontext.BeanContextChildSupport
-
- All Implemented Interfaces:
-
BeanContextChild,BeanContextServiceRevokedListener,BeanContextServicesListener,Serializable,EventListener
- 已知直接子类:
-
BeanContextSupport
public class BeanContextChildSupport extends Object implements BeanContextChild, BeanContextServicesListener, Serializable
这是一个通用支持类,用于为实现BeanContextChild协议提供支持。 该类可以被直接子类化,或被封装和委派以便为给定的组件实现该接口。
- 从以下版本开始:
- 1.2
- 另请参见:
-
BeanContext,BeanContextServices,BeanContextChild, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field 描述 protected BeanContextbeanContextbean上下文。BeanContextChildbeanContextChildPeer该BeanContext在此BeanContextChild是嵌套。protected PropertyChangeSupportpcSupport该PropertyChangeSupport与此BeanContextChildSupport相关联。protected booleanrejectedSetBCOnce指示为尝试的setBeanContext操作抛出至少一个PropertyChangeVetoException的标志。protected VetoableChangeSupportvcSupport该VetoableChangeSupport与此BeanContextChildSupport相关联。
-
构造方法摘要
构造方法 Constructor 描述 BeanContextChildSupport()构造一个BeanContextChildSupport,此类已经被子类化,以便实现JavaBean组件本身。BeanContextChildSupport(BeanContextChild bcc)构造一个BeanContextChildSupport,其中JavaBean组件自身实现BeanContextChild,并封装了这个,将该接口委派给此实现
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 voidaddPropertyChangeListener(String name, PropertyChangeListener pcl)为特定属性添加PropertyChangeListener。voidaddVetoableChangeListener(String name, VetoableChangeListener vcl)为特定属性添加VetoableChangeListener。voidfirePropertyChange(String name, Object oldValue, Object newValue)向任何已注册的监听器报告绑定属性更新。voidfireVetoableChange(String name, Object oldValue, Object newValue)向任何已注册的听众报告否决权属性更新。BeanContextgetBeanContext()获取嵌套BeanContext这个BeanContextChildSupport。BeanContextChildgetBeanContextChildPeer()获取BeanContextChild与此BeanContextChildSupport相关联。protected voidinitializeBeanContextResources()该方法可能被子类覆盖,以提供自己的初始化行为。booleanisDelegated()报告这个班级是否是另一个班级的代表。protected voidreleaseBeanContextResources()这个方法可能被子类覆盖,以提供自己的释放行为。voidremovePropertyChangeListener(String name, PropertyChangeListener pcl)删除特定属性的PropertyChangeListener。voidremoveVetoableChangeListener(String name, VetoableChangeListener vcl)删除一个VetoableChangeListener。voidserviceAvailable(BeanContextServiceAvailableEvent bcsae)嵌套BeanContext提供了新的服务。voidserviceRevoked(BeanContextServiceRevokedEvent bcsre)嵌套BeanContext提供的服务已被撤销。voidsetBeanContext(BeanContext bc)设置BeanContext为这BeanContextChildSupport。booleanvalidatePendingSetBeanContext(BeanContext newValue)从setBeanContext调用以验证(或以其他方式)嵌套BeanContext属性值中的挂起更改。
-
-
-
字段详细信息
-
beanContextChildPeer
public BeanContextChild beanContextChildPeer
其中BeanContext其中BeanContextChild是嵌套的。
-
pcSupport
protected PropertyChangeSupport pcSupport
该PropertyChangeSupport与此BeanContextChildSupport相关联。
-
vcSupport
protected VetoableChangeSupport vcSupport
该VetoableChangeSupport与此BeanContextChildSupport相关联。
-
beanContext
protected transient BeanContext beanContext
bean上下文。
-
rejectedSetBCOnce
protected transient boolean rejectedSetBCOnce
指示为尝试的setBeanContext操作抛出至少一个PropertyChangeVetoException的标志。
-
-
构造方法详细信息
-
BeanContextChildSupport
public BeanContextChildSupport()
构造一个BeanContextChildSupport,此类已经被子类化,以便实现JavaBean组件本身。
-
BeanContextChildSupport
public BeanContextChildSupport(BeanContextChild bcc)
构造一个BeanContextChildSupport,其中JavaBean组件自身实现BeanContextChild,并封装了这个,将该接口委派给此实现- 参数
-
bcc- 底层bean上下文子
-
-
方法详细信息
-
setBeanContext
public void setBeanContext(BeanContext bc) throws PropertyVetoException
设置BeanContext为这BeanContextChildSupport。- Specified by:
-
setBeanContext在接口BeanContextChild - 参数
-
bc- 要分配给BeanContext属性的新值 - 异常
-
PropertyVetoException- 如果更改被拒绝
-
getBeanContext
public BeanContext getBeanContext()
获取嵌套BeanContext这个BeanContextChildSupport。- Specified by:
-
getBeanContext在接口BeanContextChild - 结果
-
嵌套
BeanContext为这BeanContextChildSupport。
-
addPropertyChangeListener
public void addPropertyChangeListener(String name, PropertyChangeListener pcl)
为特定属性添加PropertyChangeListener。 可以多次添加相同的侦听器对象。 对于每个属性,侦听器将被调用为该属性添加的次数。 如果name或pcl为null,则不会抛出任何异常并且不采取任何操作。- Specified by:
-
addPropertyChangeListener在接口BeanContextChild - 参数
-
name- 要收听的属性的名称 -
pcl- 要添加的PropertyChangeListener
-
removePropertyChangeListener
public void removePropertyChangeListener(String name, PropertyChangeListener pcl)
删除特定属性的PropertyChangeListener。 如果pcl添加到指定属性的同一事件源,则在被删除之后会被通知一次。 如果name为空,则不会抛出任何异常并且不采取任何操作。 如果pcl为空,或者从未为指定的属性添加,则不会抛出任何异常,也不会执行任何操作。- Specified by:
-
removePropertyChangeListener在接口BeanContextChild - 参数
-
name- 收听的财产的名称 -
pcl- 要删除的PropertyChangeListener
-
addVetoableChangeListener
public void addVetoableChangeListener(String name, VetoableChangeListener vcl)
为特定属性添加VetoableChangeListener。 可以多次添加相同的侦听器对象。 对于每个属性,侦听器将被调用为该属性添加的次数。 如果name或vcl为空,则不会抛出任何异常并且不采取任何操作。- Specified by:
-
addVetoableChangeListener在接口BeanContextChild - 参数
-
name- 要收听的财产的名称 -
vcl- 要添加的VetoableChangeListener
-
removeVetoableChangeListener
public void removeVetoableChangeListener(String name, VetoableChangeListener vcl)
删除一个VetoableChangeListener。 如果pcl添加到指定属性的同一事件源,则会在被删除之后被通知一次。 如果name为null,则不会抛出异常并且不采取任何操作。 如果vcl为空,或者从未为指定的属性添加,则不会抛出异常,也不会执行任何操作。- Specified by:
-
removeVetoableChangeListener在接口BeanContextChild - 参数
-
name- 收听的财产的名称 -
vcl- 要删除的VetoableChangeListener
-
serviceRevoked
public void serviceRevoked(BeanContextServiceRevokedEvent bcsre)
嵌套BeanContext提供的服务已被撤销。 子类可以覆盖此方法以实现自己的行为。- Specified by:
-
serviceRevoked在接口BeanContextServiceRevokedListener - 参数
-
bcsre- 由于服务被撤销,BeanContextServiceRevokedEvent被触发
-
serviceAvailable
public void serviceAvailable(BeanContextServiceAvailableEvent bcsae)
嵌套BeanContext提供了新的服务。 200的X- 200 X-- Specified by:
-
serviceAvailable在接口BeanContextServicesListener - 参数
-
bcsae- 由于服务变得可用,BeanContextServiceAvailableEvent被触发
-
getBeanContextChildPeer
public BeanContextChild getBeanContextChildPeer()
获取BeanContextChild与此BeanContextChildSupport相关联。- 结果
-
新新
BeanContextChild
-
isDelegated
public boolean isDelegated()
报告这个班级是否是另一个班级的代表。- 结果
- 如果这个类是另一个的委托,则为true
-
firePropertyChange
public void firePropertyChange(String name, Object oldValue, Object newValue)
向任何已注册的监听器报告绑定属性更新。 如果旧的和新的相等且非空,则不会触发任何事件。- 参数
-
name- 已更改的属性的编程名称 -
oldValue- 该物业的旧值 -
newValue- 物业的新价值
-
fireVetoableChange
public void fireVetoableChange(String name, Object oldValue, Object newValue) throws PropertyVetoException
向任何已注册的听众报告否决权属性更新。 如果有人对此进行了修改,然后点击一个新的事件,将每个人都恢复到旧值,然后重新抛出PropertyVetoException。如果旧的和新的相等且非空,则不会触发任何事件。
- 参数
-
name- 即将更改的属性的编程名称 -
oldValue- 该物业的旧值 -
newValue- - 该属性的新值 - 异常
-
PropertyVetoException- 如果收件人希望回滚属性更改。
-
validatePendingSetBeanContext
public boolean validatePendingSetBeanContext(BeanContext newValue)
从setBeanContext调用以验证(或以其他方式)嵌套BeanContext属性值中的挂起更改。 返回false将导致setBeanContext抛出PropertyVetoException。- 参数
-
newValue- 为BeanContext属性请求的新值 - 结果
-
true如果变更操作被否决
-
releaseBeanContextResources
protected void releaseBeanContextResources()
这个方法可能被子类覆盖,以提供自己的释放行为。 当调用此实例从其当前BeanContext属性获取的任何资源应该被释放,因为该对象不再嵌套在该BeanContext中。
-
initializeBeanContextResources
protected void initializeBeanContextResources()
该方法可能被子类覆盖,以提供自己的初始化行为。 当调用BeanContextChild所需的任何资源时,应该从当前的BeanContext获取。
-
-