public interface BeanContextChild
BeanContextサブインタフェースに定義されているように、入れ子になって実行環境(コンテキスト)の参照を取得することが必要なJavaBeansには、このインタフェースを実装する必要があります。
仕様に準拠して実装されたBeanContextは、BeanContextChildオブジェクト追加の副作用として、このインタフェースのsetBeanContext()メソッドを使って自身への参照を渡します。
BeanContextChildは、応答としてPropertyVetoedExceptionをスローすることによって、状態の変更を拒否することもあります。
持続性メカニズムが多種多様な状況にわたってBeanContextChildのインスタンスで正しく機能するために、このインタフェースを実装するクラスは、入れ子になっているBeanContextインスタンスへの参照、または指定されていない任意のメカニズムを介してBeanContextから取得されたほかのリソースを格納または表現する一部またはすべてのフィールドやインスタンス変数を、一時的なものとして定義する必要があります。
BeanContext, PropertyChangeEvent, PropertyChangeListener, PropertyVetoException, VetoableChangeListener| 修飾子と型 | メソッド | 説明 |
|---|---|---|
void |
addPropertyChangeListener(String name, PropertyChangeListener pcl) |
指定されたプロパティが変更になるたびに
PropertyChangeEventを受け取るために、PropertyChangeListenerをこのBeanContextChildに追加します。 |
void |
addVetoableChangeListener(String name, VetoableChangeListener vcl) |
指定されたプロパティが変更になるたびにイベントを受け取るために、
VetoableChangeListenerをこのBeanContextChildに追加します。 |
BeanContext |
getBeanContext() |
この
BeanContextChildに関連付けられているBeanContextを取得します。 |
void |
removePropertyChangeListener(String name, PropertyChangeListener pcl) |
PropertyChangeListenerをこのBeanContextChildから削除して、指定されたプロパティが変更になったときにPropertyChangeEventsを受け取らないようにします。 |
void |
removeVetoableChangeListener(String name, VetoableChangeListener vcl) |
VetoableChangeListenerをこのBeanContextChildから削除して、指定されたプロパティが変更になったときにイベントを受け取らないようにします。 |
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の追加を拒否された場合。BeanContext getBeanContext()
BeanContextChildに関連付けられているBeanContextを取得します。BeanContextChildに関連付けられているBeanContext。void addPropertyChangeListener(String name, PropertyChangeListener pcl)
PropertyChangeEventを受け取るために、PropertyChangeListenerをこのBeanContextChildに追加します。name - 待機しているプロパティの名前pcl - 追加するPropertyChangeListenervoid removePropertyChangeListener(String name, PropertyChangeListener pcl)
PropertyChangeListenerをこのBeanContextChildから削除して、指定されたプロパティが変更になったときにPropertyChangeEventsを受け取らないようにします。name - 待機していたプロパティの名前pcl - 削除するPropertyChangeListenervoid addVetoableChangeListener(String name, VetoableChangeListener vcl)
VetoableChangeListenerをこのBeanContextChildに追加します。name - 待機しているプロパティの名前vcl - 追加するVetoableChangeListenervoid removeVetoableChangeListener(String name, VetoableChangeListener vcl)
VetoableChangeListenerをこのBeanContextChildから削除して、指定されたプロパティが変更になったときにイベントを受け取らないようにします。name - 待機していたプロパティの名前。vcl - 削除するVetoableChangeListener。 バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。