public interface BeanContextProxy
该接口由不直接具有与之关联的BeanContext(Child)的JavaBean实现(通过实现该接口或其子接口),但具有从其委托的公共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 }
返回值是实现实例的生存期的常数
BeanContextChild
, BeanContextChildSupport
Modifier and Type | Method and Description |
---|---|
BeanContextChild |
getBeanContextProxy()
获取与此对象关联的
BeanContextChild (或子接口)。
|
BeanContextChild getBeanContextProxy()
BeanContextChild
(或子接口)。
BeanContextChild
(或子接口)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.