模块 java.desktop

类 BeanContextChildSupport

java.lang.Object
java.beans.beancontext.BeanContextChildSupport
所有已实现的接口:
BeanContextChild , BeanContextServiceRevokedListener , BeanContextServicesListener , Serializable , EventListener
已知子类:
BeanContextSupport

public class BeanContextChildSupport extends Object implements BeanContextChild , BeanContextServicesListener , Serializable

这是一个通用支持类,为实现 BeanContextChild 协议提供支持。此类可以直接子类化,也可以封装和委托给给定组件实现此接口。

自从:
1.2
参见:
  • 字段详细信息

    • beanContextChildPeer

      public BeanContextChild  beanContextChildPeer
      这个 BeanContextChild 嵌套在其中的 BeanContext
    • pcSupport

      protected PropertyChangeSupport  pcSupport
      与此 BeanContextChildSupport 关联的 PropertyChangeSupport
    • vcSupport

      protected VetoableChangeSupport  vcSupport
      与此 BeanContextChildSupport 关联的 VetoableChangeSupport
    • beanContext

      protected transient BeanContext  beanContext
      bean 上下文。
    • rejectedSetBCOnce

      protected transient boolean rejectedSetBCOnce
      一个标志,指示至少有一个 PropertyChangeVetoException 已为尝试的 setBeanContext 操作抛出。
  • 构造方法详细信息

    • BeanContextChildSupport

      public BeanContextChildSupport()
      构造一个 BeanContextChildSupport,其中此类已被子类化以实现 JavaBean 组件本身。
    • BeanContextChildSupport

      public BeanContextChildSupport(BeanContextChild  bcc)
      构造一个 BeanContextChildSupport,其中 JavaBean 组件本身实现了 BeanContextChild,并将其封装,将该接口委托给该实现
      参数:
      bcc - 底层 bean 上下文子项
  • 方法详情

    • setBeanContext

      public void setBeanContext(BeanContext  bc) throws PropertyVetoException
      为此 BeanContextChildSupport 设置 BeanContext
      指定者:
      setBeanContext 在接口 BeanContextChild
      参数:
      bc - 分配给 BeanContext 属性的新值
      抛出:
      PropertyVetoException - 如果更改被拒绝
    • getBeanContext

      public BeanContext  getBeanContext()
      获取此 BeanContextChildSupport 的嵌套 BeanContext
      指定者:
      getBeanContext 在接口 BeanContextChild
      返回:
      这个 BeanContextChildSupport 的嵌套 BeanContext
    • addPropertyChangeListener

      public void addPropertyChangeListener(String  name, PropertyChangeListener  pcl)
      为特定属性添加 PropertyChangeListener。可以多次添加相同的监听器对象。对于每个属性,将调用监听器为该属性添加的次数。如果 namepcl 为 null,则不会抛出异常且不会采取任何操作。
      指定者:
      addPropertyChangeListener 在接口 BeanContextChild
      参数:
      name - 要监听的属性的名称
      pcl - 要添加的 PropertyChangeListener
    • removePropertyChangeListener

      public void removePropertyChangeListener(String  name, PropertyChangeListener  pcl)
      删除特定属性的 PropertyChangeListener。如果 pcl 被多次添加到指定属性的同一事件源,则在删除后通知它的时间会减少一次。如果 name 为 null,则不会抛出异常且不会采取任何操作。如果 pcl 为 null,或者从未为指定的属性添加过,则不会抛出任何异常,也不会采取任何操作。
      指定者:
      removePropertyChangeListener 在接口 BeanContextChild
      参数:
      name - 监听的属性名称
      pcl - 要删除的 PropertyChangeListener
    • addVetoableChangeListener

      public void addVetoableChangeListener(String  name, VetoableChangeListener  vcl)
      为特定属性添加 VetoableChangeListener。可以多次添加相同的监听器对象。对于每个属性,将调用监听器为该属性添加的次数。如果 namevcl 为 null,则不会抛出异常且不会采取任何操作。
      指定者:
      addVetoableChangeListener 在接口 BeanContextChild
      参数:
      name - 要监听的属性的名称
      vcl - 要添加的 VetoableChangeListener
    • removeVetoableChangeListener

      public void removeVetoableChangeListener(String  name, VetoableChangeListener  vcl)
      删除 VetoableChangeListener 。如果 pcl 被多次添加到指定属性的同一事件源,则在删除后通知它的时间会减少一次。如果 name 为 null,则不会抛出异常且不会采取任何操作。如果 vcl 为 null,或者从未为指定的属性添加,则不会抛出异常并且不会采取任何操作。
      指定者:
      removeVetoableChangeListener 在接口 BeanContextChild
      参数:
      name - 监听的属性名称
      vcl - 要移除的 VetoableChangeListener
    • serviceRevoked

      public void serviceRevoked(BeanContextServiceRevokedEvent  bcsre)
      嵌套 BeanContext 提供的服务已被撤销。子类可以重写此方法以实现自己的行为。
      指定者:
      serviceRevoked 在接口 BeanContextServiceRevokedListener
      参数:
      bcsre - BeanContextServiceRevokedEvent 由于服务被撤销而被解雇
    • serviceAvailable

      public void serviceAvailable(BeanContextServiceAvailableEvent  bcsae)
      嵌套的 BeanContext 提供了一项新服务。子类可以重写此方法以实现自己的行为
      指定者:
      serviceAvailable 在接口 BeanContextServicesListener
      参数:
      bcsae - BeanContextServiceAvailableEvent 因服务可用而触发
    • getBeanContextChildPeer

      public BeanContextChild  getBeanContextChildPeer()
      获取与此 BeanContextChildSupport 关联的 BeanContextChild
      返回:
      这个类的 BeanContextChild 对等项
    • isDelegated

      public boolean isDelegated()
      报告此类是否是另一个类的委托。
      返回:
      如果此类是另一个类的委托,则为真
    • 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 中获取。