模块 java.desktop

接口 BeanContextProxy


public interface BeanContextProxy

该接口由一个 JavaBean 实现,该 JavaBean 不直接关联 BeanContext(Child)(通过实现该接口或其子接口),但具有从其委托的公共 BeanContext(Child)。例如,java.awt.Container 的子类可能有一个与其关联的 BeanContext,该 Container 的所有 Component 子级都应包含在其中。

对象可能不实现此接口和 BeanContextChild 接口(或其任何子接口)它们是互斥的。

此接口的调用者应检查返回类型以获得 BeanContextChild 的特定子接口,如下所示:


 BeanContextChild bcc = o.getBeanContextProxy();

 if (bcc instanceof BeanContext) {
   // ...
 }
  

 BeanContextChild bcc = o.getBeanContextProxy();
 BeanContext   bc = null;

 try {
   bc = (BeanContext)bcc;
 } catch (ClassCastException cce) {
   // cast failed, bcc is not an instanceof BeanContext
 }
  

返回值在实现实例的生命周期内是一个常量

自从:
1.2
参见:
  • 方法总结

    修饰符和类型
    方法
    描述
    获取与此对象关联的 BeanContextChild(或子接口)。
  • 方法详情

    • getBeanContextProxy

      BeanContextChild  getBeanContextProxy()
      获取与此对象关联的 BeanContextChild(或子接口)。
      返回:
      与此对象关联的 BeanContextChild(或子接口)