|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
public interface BeanContextChild
正如 BeanContext 子接口所定义的,希望在其中进行嵌套并获得对其执行环境(或文本)的引用的 JavaBeans 应该实现此接口。
作为添加 BeanContextChild 对象的副作用,遵守此接口的 BeanContext 应该通过接口的 setBeanContext() 方法将一个引用传递给自身。
注意,BeanContextChild 可能通过在响应时抛出 PropertyVetoedException 来对拒绝状态的更改。
为了使持久性机制在各种情况下都能在 BeanContextChild 实例上正确地发挥作用,此接口的实现类需要所有或全部的字段(或实例变量)定义为 transient,这些字段可能包含(或表示)对嵌套 BeanContext 实例或通过任何未指定的机制从 BeanContext 中获得的其他资源的引用。
BeanContext,
PropertyChangeEvent,
PropertyChangeListener,
java.beans.PropertyVetoEvent,
java.beans.PropertyVetoListener,
PropertyVetoException| 方法摘要 | |
|---|---|
void |
addPropertyChangeListener(String name,
PropertyChangeListener pcl)
将一个 PropertyChangeListener 添加到此 BeanContextChild 中,以便无论指定属性何时发生更改都可以接收一个 PropertyChangeEvent。 |
void |
addVetoableChangeListener(String name,
VetoableChangeListener vcl)
将一个 VetoableChangeListener 添加到此 BeanContextChild,以便无论指定属性何时发生更改都可以接收事件。 |
BeanContext |
getBeanContext()
获得与此 BeanContextChild 相关联的 BeanContext。 |
void |
removePropertyChangeListener(String name,
PropertyChangeListener pcl)
从此 BeanContextChild 中移除一个 PropertyChangeListener,以便指定属性发生更改时不再接收 PropertyChangeEvent。 |
void |
removeVetoableChangeListener(String name,
VetoableChangeListener vcl)
从此 BeanContextChild 中移除一个 VetoableChangeListener,以便指定属性发生更改时不再接收事件。 |
void |
setBeanContext(BeanContext bc)
实现此接口的对象应使用以下参数激活一个 java.beans.PropertyChangeEvent:propertyName "beanContext"、oldValue(以前的嵌套 BeanContext 实例,或 null)、newValue(当前的嵌套 BeanContext 实例,或 null)。 |
| 方法详细信息 |
|---|
void setBeanContext(BeanContext bc)
throws PropertyVetoException
实现此接口的对象应使用以下参数激活一个 java.beans.PropertyChangeEvent:propertyName "beanContext"、oldValue(以前的嵌套 BeanContext 实例,或 null)、newValue(当前的嵌套 BeanContext 实例,或 null)。
可以通过抛出适当异常来禁止对此 BeanContextChild 的嵌套 BeanContext 属性值进行更改。
bc - 与此 BeanContextChild 相关联的 BeanContext。
PropertyVetoException - 如果拒绝添加指定的 BeanContext。
PropertyVetoExceptionBeanContext getBeanContext()
BeanContextChild 相关联的 BeanContext。
BeanContextChild 相关联的 BeanContext。
void addPropertyChangeListener(String name,
PropertyChangeListener pcl)
PropertyChangeListener 添加到此 BeanContextChild 中,以便无论指定属性何时发生更改都可以接收一个 PropertyChangeEvent。
name - 要侦听的属性的名称pcl - 要添加的 PropertyChangeListener
void removePropertyChangeListener(String name,
PropertyChangeListener pcl)
BeanContextChild 中移除一个 PropertyChangeListener,以便指定属性发生更改时不再接收 PropertyChangeEvent。
name - 已被侦听的属性的名称pcl - 要移除的 PropertyChangeListener
void addVetoableChangeListener(String name,
VetoableChangeListener vcl)
VetoableChangeListener 添加到此 BeanContextChild,以便无论指定属性何时发生更改都可以接收事件。
name - 要侦听的属性的名称vcl - 要添加的 VetoableChangeListener
void removeVetoableChangeListener(String name,
VetoableChangeListener vcl)
BeanContextChild 中移除一个 VetoableChangeListener,以便指定属性发生更改时不再接收事件。
name - 已被侦听的属性的名称。vcl - 要移除的 VetoableChangeListener。
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。