JavaTM 2 Platform
Standard Ed. 6

java.beans.beancontext
接口 BeanContextProxy


public interface BeanContextProxy

此接口由并不直接拥有(通过实现该接口或一个子接口拥有)与之关联的 BeanContext(Child),但是拥有它代理的一个公共 BeanContext(Child) 的 JavaBean 实现。例如,java.awt.Container 的子类可以有一个与之关联的 BeanContext,它将包含该 Container 的所有子 Component。

一个对象不能同时实现此接口和 BeanContextChild 接口(或者所有子接口),它们互不相容。

为了获得 BeanContextChild 的特定子接口,此接口的调用者应检查返回类型,如下所示: BeanContextChild bcc = o.getBeanContextProxy(); if (bcc instanceof BeanContext) { // ... } or 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, BeanContextChildSupport

方法摘要
 BeanContextChild getBeanContextProxy()
          获得与此对象相关联的 BeanContextChild(或子接口)。
 

方法详细信息

getBeanContextProxy

BeanContextChild getBeanContextProxy()
获得与此对象相关联的 BeanContextChild(或子接口)。

返回:
与此对象相关联的 BeanContextChild(或子接口)

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only