public interface BeanContextChild
希望嵌套在JavaBeans中,并且获得对它们的执行环境的引用,或者由BeanContext子接口定义的上下文将实现该接口。
一致BeanContexts应作为添加BeanContextChild对象的副作用,通过此接口的setBeanContext()方法传递对自身的引用。
请注意,BeanContextChild可能会通过抛出PropertyVetoedException作为响应来拒绝状态更改。
为了使持久性机制能够在各种场景下的BeanContextChild实例上正常运行,实现此接口的类需要定义为可能包含或表示引用嵌套的瞬时,任何或所有字段或实例变量BeanContext实例或从BeanContext通过任何未指定的机制获取的其他资源。
BeanContext , PropertyChangeEvent , PropertyChangeListener , PropertyVetoException , VetoableChangeListener
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(String name, PropertyChangeListener pcl)
将
PropertyChangeListener添加到此
BeanContextChild中,以便在指定的属性更改时接收
PropertyChangeEvent 。
|
void |
addVetoableChangeListener(String name, VetoableChangeListener vcl)
添加一个
VetoableChangeListener到这个
BeanContextChild每当指定的属性更改时接收事件。
|
BeanContext |
getBeanContext()
获取
BeanContext与此相关
BeanContextChild 。
|
void |
removePropertyChangeListener(String name, PropertyChangeListener pcl)
删除一个
PropertyChangeListener从这个
BeanContextChild ,使其不再接收
PropertyChangeEvents当指定的属性更改。
|
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
实现此接口的对象将使用参数:propertyName“beanContext”,oldValue(以前的嵌套BeanContext实例或null ),newValue(当前嵌套BeanContext实例或null ) null 。
BeanContextChild嵌套BeanContext属性值的更改可能会被抛出相应的异常而被否决。
bc -
BeanContext与此相关
BeanContextChild 。
PropertyVetoException - 如果添加指定的
BeanContext被拒绝。
BeanContext getBeanContext()
BeanContext与此相关
BeanContextChild 。
BeanContext与此
BeanContextChild 。
void addPropertyChangeListener(String name, PropertyChangeListener pcl)
PropertyChangeListener添加到此
BeanContextChild中,以便在指定的属性更改时接收
PropertyChangeEvent 。
name - 要监听的属性的名称
pcl - 要添加的
PropertyChangeListener
void removePropertyChangeListener(String name, PropertyChangeListener pcl)
PropertyChangeListener从这个
BeanContextChild ,使其不再接收
PropertyChangeEvents当指定的属性更改。
name - 收听的财产的名称
pcl - 要删除的
PropertyChangeListener
void addVetoableChangeListener(String name, VetoableChangeListener vcl)
VetoableChangeListener这个
BeanContextChild接收事件时指定属性的变化。
name - 要收听的财产的名称
vcl - 要添加的
VetoableChangeListener
void removeVetoableChangeListener(String name, VetoableChangeListener vcl)
VetoableChangeListener从这个
BeanContextChild ,使其不再接收事件指定的属性发生变化时。
name - 收听的财产的名称。
vcl - 要删除的
VetoableChangeListener 。
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.