Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
7f86cd1d
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7f86cd1d
编写于
9月 01, 2008
作者:
M
malenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
5026703: RFE: DOC: Are PropertyChangeSupport & VetoableChangeSupport Thread-Safe? --Docs Should Say
Reviewed-by: peterz, rupashka
上级
8345e072
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
78 addition
and
4 deletion
+78
-4
src/share/classes/java/beans/PropertyChangeSupport.java
src/share/classes/java/beans/PropertyChangeSupport.java
+39
-2
src/share/classes/java/beans/VetoableChangeSupport.java
src/share/classes/java/beans/VetoableChangeSupport.java
+39
-2
未找到文件。
src/share/classes/java/beans/PropertyChangeSupport.java
浏览文件 @
7f86cd1d
...
...
@@ -34,12 +34,49 @@ import java.util.Map.Entry;
/**
* This is a utility class that can be used by beans that support bound
* properties. You can use an instance of this class as a member field
* of your bean and delegate various work to it.
* properties. It manages a list of listeners and dispatches
* {@link PropertyChangeEvent}s to them. You can use an instance of this class
* as a member field of your bean and delegate these types of work to it.
* The {@link PropertyChangeListener} can be registered for all properties
* or for a property specified by name.
* <p>
* Here is an example of {@code PropertyChangeSupport} usage that follows
* the rules and recommendations laid out in the JavaBeans™ specification:
* <pre>
* public class MyBean {
* private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
*
* public void addPropertyChangeListener(PropertyChangeListener listener) {
* this.pcs.addPropertyChangeListener(listener);
* }
*
* public void removePropertyChangeListener(PropertyChangeListener listener) {
* this.pcs.removePropertyChangeListener(listener);
* }
*
* private String value;
*
* public String getValue() {
* return this.value;
* }
*
* public void setValue(String newValue) {
* String oldValue = this.value;
* this.value = newValue;
* this.pcs.firePropertyChange("value", oldValue, newValue);
* }
*
* [...]
* }
* </pre>
* <p>
* A {@code PropertyChangeSupport} instance is thread-safe.
* <p>
* This class is serializable. When it is serialized it will save
* (and restore) any listeners that are themselves serializable. Any
* non-serializable listeners will be skipped during serialization.
*
* @see VetoableChangeSupport
*/
public
class
PropertyChangeSupport
implements
Serializable
{
private
PropertyChangeListenerMap
map
=
new
PropertyChangeListenerMap
();
...
...
src/share/classes/java/beans/VetoableChangeSupport.java
浏览文件 @
7f86cd1d
...
...
@@ -34,12 +34,49 @@ import java.util.Map.Entry;
/**
* This is a utility class that can be used by beans that support constrained
* properties. You can use an instance of this class as a member field
* of your bean and delegate various work to it.
* properties. It manages a list of listeners and dispatches
* {@link PropertyChangeEvent}s to them. You can use an instance of this class
* as a member field of your bean and delegate these types of work to it.
* The {@link VetoableChangeListener} can be registered for all properties
* or for a property specified by name.
* <p>
* Here is an example of {@code VetoableChangeSupport} usage that follows
* the rules and recommendations laid out in the JavaBeans™ specification:
* <pre>
* public class MyBean {
* private final VetoableChangeSupport vcs = new VetoableChangeSupport(this);
*
* public void addVetoableChangeListener(VetoableChangeListener listener) {
* this.vcs.addVetoableChangeListener(listener);
* }
*
* public void removeVetoableChangeListener(VetoableChangeListener listener) {
* this.vcs.removeVetoableChangeListener(listener);
* }
*
* private String value;
*
* public String getValue() {
* return this.value;
* }
*
* public void setValue(String newValue) throws PropertyVetoException {
* String oldValue = this.value;
* this.vcs.fireVetoableChange("value", oldValue, newValue);
* this.value = newValue;
* }
*
* [...]
* }
* </pre>
* <p>
* A {@code VetoableChangeSupport} instance is thread-safe.
* <p>
* This class is serializable. When it is serialized it will save
* (and restore) any listeners that are themselves serializable. Any
* non-serializable listeners will be skipped during serialization.
*
* @see PropertyChangeSupport
*/
public
class
VetoableChangeSupport
implements
Serializable
{
private
VetoableChangeListenerMap
map
=
new
VetoableChangeListenerMap
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录