public class BeanContextSupport extends BeanContextChildSupport implements BeanContext, Serializable, PropertyChangeListener, VetoableChangeListener
このクラスは、BeanContext インタフェースを直接実装するため、この実装をサブクラス化することによって、あるいはほかのインスタンスからこのクラスのインスタンスの特別な委譲を介すことによって使用されることを目的としています。
修飾子と型 | クラスと説明 |
---|---|
protected class |
BeanContextSupport.BCSChild |
protected static class |
BeanContextSupport.BCSIterator
protected final サブクラス。イテレータをカプセル化しますが、何も行わない remove() メソッドを実装します。
|
修飾子と型 | フィールドと説明 |
---|---|
protected ArrayList |
bcmListeners
protected ArrayList bcmListeners フィールドへのすべてのアクセスはそのオブジェクトに同期されます。 |
protected HashMap |
children
protected HashMap children フィールドへのすべてのアクセスはそのオブジェクトに同期されます。 |
protected boolean |
designTime
このオブジェクトが現在、設計時モードであるかどうかを示す boolean。
|
protected Locale |
locale
BeanContext の現在のロケールです。
|
protected boolean |
okToUseGui
このインスタンスが GUI を描画できるかどうかを示す boolean。
|
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport
globalHierarchyLock
PROPERTYNAME
コンストラクタと説明 |
---|
BeanContextSupport()
ほかのオブジェクトの委譲でないインスタンスを生成します。
|
BeanContextSupport(BeanContext peer)
デフォルトのロケールを使ってインスタンスを生成します。
|
BeanContextSupport(BeanContext peer, Locale lcle)
指定されたロケールを使ってインスタンスを生成します。
|
BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime)
指定されたロケールを使って設計モードでインスタンスを生成します。
|
BeanContextSupport(BeanContext peer, Locale lcle, boolean dTime, boolean visible)
BeanContextSupport のインスタンスを生成します。
|
修飾子と型 | メソッドと説明 |
---|---|
boolean |
add(Object targetChild)
この BeanContext 内に子を追加、すなわち入れ子にします。
|
boolean |
addAll(Collection c)
Children のセットに Collection を追加します (サポートされていない)。実装では、階層のロックおよび「子」の protected フィールドについて同期をとる必要があります。
|
void |
addBeanContextMembershipListener(BeanContextMembershipListener bcml)
BeanContextMembershipListener を追加します。
|
boolean |
avoidingGui()
BeanContext の子が GUI の使用を避けているかどうかを判断するために使われます。
|
protected Iterator |
bcsChildren()
この BeanContext のすべての子のイテレータを返します。
|
protected void |
bcsPreDeserializationHook(ObjectInputStream ois)
defaultReadObject() のあと、子を直列化する前の readObject によって呼び出されます。
|
protected void |
bcsPreSerializationHook(ObjectOutputStream oos)
defaultWriteObject() のあと、子を直列化する前の writeObject によって呼び出されます。
|
protected void |
childDeserializedHook(Object child, BeanContextSupport.BCSChild bcsc)
新しく直列化復元された子および BCSChild を使って readObject によって呼び出されます。
|
protected void |
childJustAddedHook(Object child, BeanContextSupport.BCSChild bcsc)
サブクラスはこのメソッドをオーバーライドして、子が追加されて、イベント通知が発生する前に、簡単に add() セマンティクスを拡張できます。
|
protected void |
childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)
サブクラスはこのメソッドをオーバーライドして、子が削除されて、イベント通知が発生する前に、簡単に remove() セマンティクスを拡張できます。
|
protected static boolean |
classEquals(Class first, Class second)
2 つのクラスオブジェクトまたはそれらの名前が同じかどうかを判定します。
|
void |
clear()
子をクリアーします (サポートされていない)。実装では、階層のロックおよび「子」の protected フィールドについて同期をとる必要があります。
|
boolean |
contains(Object o)
指定されたオブジェクトが現在この BeanContext の子であるかどうかを判定します。
|
boolean |
containsAll(Collection c)
指定された Collection 内のすべての子がこの BeanContext の子であるかどうかを調べます。
|
boolean |
containsKey(Object o)
指定されたオブジェクトが現在この BeanContext の子であるかどうかを判定します。
|
protected Object[] |
copyChildren()
この BeanContext の子のコピーを取得します。
|
protected BeanContextSupport.BCSChild |
createBCSChild(Object targetChild, Object peer)
サブクラスはこのメソッドをオーバーライドすることにより、セットに子を追加する add() メソッドやほかの Collection メソッドをオーバーライドすることなく、Child の独自のサブクラスを挿入することができます。
|
protected void |
deserialize(ObjectInputStream ois, Collection coll)
コレクションを直列化復元するために readObject によって使用されます。
|
void |
dontUseGui()
このインスタンスに GUI を描画できないことを通知します。
|
protected void |
fireChildrenAdded(BeanContextMembershipEvent bcme)
BeanContextMembershipListener インタフェースの BeanContextshipEvent をトリガーします。
|
protected void |
fireChildrenRemoved(BeanContextMembershipEvent bcme)
BeanContextMembershipListener インタフェースの BeanContextshipEvent をトリガーします。
|
BeanContext |
getBeanContextPeer()
このオブジェクトが実装を提供している BeanContext のインスタンスを取得します。
|
protected static BeanContextChild |
getChildBeanContextChild(Object child)
指定された子の BeanContextChild (存在する場合) を取得します。
|
protected static BeanContextMembershipListener |
getChildBeanContextMembershipListener(Object child)
指定された子の BeanContextMembershipListener (存在する場合) を取得します。
|
protected static PropertyChangeListener |
getChildPropertyChangeListener(Object child)
指定された子の PropertyChangeListener (存在する場合) を取得します。
|
protected static Serializable |
getChildSerializable(Object child)
指定された Child に関連した Serializable (存在する場合) を取得します。
|
protected static VetoableChangeListener |
getChildVetoableChangeListener(Object child)
指定された子の VetoableChangeListener (存在する場合) を取得します。
|
protected static Visibility |
getChildVisibility(Object child)
指定された子に関連した Component (存在する場合) を取得します。
|
Locale |
getLocale()
この BeanContext のロケールを取得します。
|
URL |
getResource(String name, BeanContextChild bcc)
java.lang.ClassLoader.getResource() と同じように、このメソッドによって BeanContext 実装で子の Component とベースとなる ClassLoader の間に動作を挿入できます。 |
InputStream |
getResourceAsStream(String name, BeanContextChild bcc)
java.lang.ClassLoader.getResourceAsStream() と同じように、このメソッドによって BeanContext 実装で子の Component とベースとなる ClassLoader の間に動作を挿入できます。 |
protected void |
initialize()
BeanContextSupport インスタンスの過渡状態を初期化するために、コンストラクタおよび readObject から呼び出される protected メソッドです。
|
Object |
instantiateChild(String beanName)
instantiateChild メソッドは、Bean を入れ子にして BeanContext にインスタンスを生成するタスクを単純化する BeanContext の簡易フックです。
|
boolean |
isDesignTime()
このオブジェクトが現在、設計時モードかどうかを報告します。
|
boolean |
isEmpty()
この BeanContext が空かどうかを報告します。
|
boolean |
isSerializing()
この BeanContext は直列化の処理中ですか。
|
Iterator |
iterator()
この BeanContext 内で現在入れ子になっている JavaBean または BeanContext のインスタンスをすべて取得します。
|
boolean |
needsGui()
通常、このメソッドは実装側が GUI を必要としているかどうかを判断するために、環境から呼び出されます。
|
void |
okToUseGui()
このインスタンスに GUI を描画できることを通知します。
|
void |
propertyChange(PropertyChangeEvent pce)
サブクラスは、子のプロパティーの変更を監視するために包括することがあります。
|
void |
readChildren(ObjectInputStream ois)
このクラスのインスタンスが BeanContext プロトコル (およびそのサブプロトコル) の実装の委譲として使用されるときには、直列化復元の際に「鶏が先か卵が先か」の問題が起こります。
|
boolean |
remove(Object targetChild)
この BeanContext から子を削除します。
|
protected boolean |
remove(Object targetChild, boolean callChildSetBC)
予期しない setBeanContext あるいは remove() 呼び出しで削除が行われる場合に使用される内部削除。
|
boolean |
removeAll(Collection c)
指定されたすべての子を削除します (サポートされていない)。実装では、階層のロックおよび「子」の protected フィールドについて同期をとる必要があります。
|
void |
removeBeanContextMembershipListener(BeanContextMembershipListener bcml)
BeanContextMembershipListener を削除します。
|
boolean |
retainAll(Collection c)
指定された子だけを保持します (サポートされていない)。実装では、階層のロックおよび「子」の protected フィールドについて同期をとる必要があります。
|
protected void |
serialize(ObjectOutputStream oos, Collection coll)
コレクションを直列化するために writeObject によって使用されます。
|
void |
setDesignTime(boolean dTime)
この BeanContext 用に新しい設計時値を設定します。
|
void |
setLocale(Locale newLocale)
この BeanContext のロケールを設定します。
|
int |
size()
この BeanContext で入れ子になった現在の子の個数を取得します。
|
Object[] |
toArray()
この BeanContext 内で現在入れ子になっている JavaBean または BeanContext のインスタンスをすべて取得します。
|
Object[] |
toArray(Object[] arry)
arry に含まれる型と一致する、この BeanContext のすべての子を含む配列を取得します。
|
protected boolean |
validatePendingAdd(Object targetChild)
このクラスのサブクラスはこのメソッドをオーバーライドまたは包括して、BeanContext に追加される直前に、BeanContext が子オブジェクトを調べるための検証動作を追加できます。
|
protected boolean |
validatePendingRemove(Object targetChild)
このクラスのサブクラスはこのメソッドをオーバーライドまたは包括して、BeanContext から削除される直前に、BeanContext が子オブジェクトを調べるための検証動作を追加できます。
|
void |
vetoableChange(PropertyChangeEvent pce)
サブクラスは、子の拒否プロパティーの変更を監視するために包括することがあります。
|
void |
writeChildren(ObjectOutputStream oos)
この BeanContext のすべての子を直列化するために使用されます。
|
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, initializeBeanContextResources, isDelegated, releaseBeanContextResources, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, validatePendingSetBeanContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext
equals, hashCode
protected transient HashMap children
protected HashMap children
フィールドへのすべてのアクセスはそのオブジェクトに同期されます。protected transient ArrayList bcmListeners
protected ArrayList bcmListeners
フィールドへのすべてのアクセスはそのオブジェクトに同期されます。protected Locale locale
protected boolean okToUseGui
protected boolean designTime
public BeanContextSupport(BeanContext peer, Locale lcle, boolean dTime, boolean visible)
peer
- 実装の提供先となるピア BeanContext、このオブジェクトが自身のピアである場合は nulllcle
- この BeanContext の現在のロケール。lcle が null の場合は、デフォルトのロケールが BeanContext インスタンスに割り当てられます。dTime
- 初期状態、設計モードの場合は true、実行時の場合は false。visible
- 初期状態での可視性。Locale.getDefault()
, Locale.setDefault(java.util.Locale)
public BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime)
peer
- 実装の提供先となるピア BeanContext、このオブジェクトが自身のピアである場合は nulllcle
- この BeanContext の現在のロケール。lcle が null の場合は、デフォルトのロケールが BeanContext インスタンスに割り当てられます。dtime
- 初期状態、設計モードの場合は true、実行時の場合は false。Locale.getDefault()
, Locale.setDefault(java.util.Locale)
public BeanContextSupport(BeanContext peer, Locale lcle)
peer
- 実装を提供しているピア BeanContext。このオブジェクトがそれ自身のピアである場合は nulllcle
- この BeanContext の現在のロケール。lcle が null の場合は、デフォルトのロケールが BeanContext インスタンスに割り当てられます。Locale.getDefault()
, Locale.setDefault(java.util.Locale)
public BeanContextSupport(BeanContext peer)
peer
- 実装の提供先となるピア BeanContext、このオブジェクトが自身のピアである場合は nullpublic BeanContextSupport()
public BeanContext getBeanContextPeer()
public Object instantiateChild(String beanName) throws IOException, ClassNotFoundException
instantiateChild メソッドは、Bean を入れ子にして BeanContext にインスタンスを生成するタスクを単純化する BeanContext の簡易フックです。
beanName パラメータのセマンティクスは、java.beans.Beans.instantate によって定義されます。
instantiateChild
、インタフェース: BeanContext
beanName
- この BeanContext 内でインスタンスを生成する Bean の名前IOException
- Bean の 直列化復元中に入出力エラーが発生した場合ClassNotFoundException
- beanName パラメータによって識別されたクラスが見つからない場合public int size()
size
、インタフェース: Collection
public boolean isEmpty()
isEmpty
、インタフェース: Collection
public boolean contains(Object o)
contains
、インタフェース: Collection
o
- 該当するオブジェクトpublic boolean containsKey(Object o)
o
- 該当するオブジェクトpublic Iterator iterator()
iterator
、インタフェース: Iterable
iterator
、インタフェース: Collection
public Object[] toArray()
toArray
、インタフェース: Collection
public Object[] toArray(Object[] arry)
toArray
、インタフェース: Collection
arry
- 対象となるオブジェクト型の配列。protected BeanContextSupport.BCSChild createBCSChild(Object targetChild, Object peer)
サブクラスはこのメソッドをオーバーライドすることにより、セットに子を追加する add() メソッドやほかの Collection メソッドをオーバーライドすることなく、Child の独自のサブクラスを挿入することができます。
targetChild
- 代わりに Child を作成する子peer
- targetChild およびピアが BeanContextProxy の実装によって関連付けられている場合はそのピアpublic boolean add(Object targetChild)
java.beans.Beans.instantiate() の副作用として呼び出されます。子オブジェクトを追加する処理が正当でない場合、このメソッドは IllegalStateException をスローします。
add
、インタフェース: Collection
targetChild
- この BeanContext 内で入れ子になる子オブジェクトvalidatePendingAdd(java.lang.Object)
public boolean remove(Object targetChild)
remove
、インタフェース: Collection
targetChild
- 削除される子オブジェクトvalidatePendingRemove(java.lang.Object)
protected boolean remove(Object targetChild, boolean callChildSetBC)
targetChild
- 削除される JavaBean、BeanContext、または ObjectcallChildSetBC
- 子がこの BeanContext の入れ子でなくなったことを通知するべきであると示すために使用される。public boolean containsAll(Collection c)
containsAll
、インタフェース: Collection
c
- 指定されている CollectionCollection.contains(Object)
public boolean addAll(Collection c)
addAll
、インタフェース: Collection
c
- このコレクションに追加される要素を含むコレクションUnsupportedOperationException
Collection.add(Object)
public boolean removeAll(Collection c)
removeAll
、インタフェース: Collection
c
- このコレクションから削除される要素を含むコレクションUnsupportedOperationException
Collection.remove(Object)
, Collection.contains(Object)
public boolean retainAll(Collection c)
retainAll
、インタフェース: Collection
c
- このコレクションで保持される要素を含むコレクションUnsupportedOperationException
Collection.remove(Object)
, Collection.contains(Object)
public void clear()
clear
、インタフェース: Collection
UnsupportedOperationException
public void addBeanContextMembershipListener(BeanContextMembershipListener bcml)
addBeanContextMembershipListener
、インタフェース: BeanContext
bcml
- 追加される BeanContextMembershipListenerNullPointerException
public void removeBeanContextMembershipListener(BeanContextMembershipListener bcml)
removeBeanContextMembershipListener
、インタフェース: BeanContext
bcml
- 削除する BeanContextMembershipListenerNullPointerException
public InputStream getResourceAsStream(String name, BeanContextChild bcc)
BeanContext
java.lang.ClassLoader.getResourceAsStream()
と同じように、このメソッドによって BeanContext
実装で子の Component
とベースとなる ClassLoader
の間に動作を挿入できます。getResourceAsStream
、インタフェース: BeanContext
name
- リクエストされたリソースの名前。bcc
- リクエストを行う子オブジェクト。NullPointerException
public URL getResource(String name, BeanContextChild bcc)
BeanContext
java.lang.ClassLoader.getResource()
と同じように、このメソッドによって BeanContext
実装で子の Component
とベースとなる ClassLoader
の間に動作を挿入できます。getResource
、インタフェース: BeanContext
name
- リクエストされたリソースの名前。bcc
- リクエストを行う子オブジェクト。public void setDesignTime(boolean dTime)
setDesignTime
、インタフェース: DesignMode
dTime
- 新規 designTime 値BeanContext
, BeanContextMembershipListener
, PropertyChangeEvent
public boolean isDesignTime()
isDesignTime
、インタフェース: DesignMode
public void setLocale(Locale newLocale) throws PropertyVetoException
newLocale
- 新規ロケール。newLocale が null
の場合、このメソッド呼び出しに効果はない。PropertyVetoException
- 新規ロケールが拒否された場合public Locale getLocale()
public boolean needsGui()
通常、このメソッドは実装側が GUI を必要としているかどうかを判断するために、環境から呼び出されます。
ここで使われているアルゴリズムは BeanContextPeer と、現在の子が自身を Containers、Components のどちらかを判断するのをテストします。Visibility を実装している場合は、needsGui() == true を返します。
needsGui
、インタフェース: Visibility
public void dontUseGui()
dontUseGui
、インタフェース: Visibility
public void okToUseGui()
okToUseGui
、インタフェース: Visibility
public boolean avoidingGui()
avoidingGui
、インタフェース: Visibility
Visibility
public boolean isSerializing()
protected Iterator bcsChildren()
protected void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException
IOException
protected void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException
protected void childDeserializedHook(Object child, BeanContextSupport.BCSChild bcsc)
child
- 新たに直列化復元された子bcsc
- 新たに直列化復元された BCSChildprotected final void serialize(ObjectOutputStream oos, Collection coll) throws IOException
oos
- 直列化中に使用する ObjectOutputStreamcoll
- 直列化する CollectionIOException
- 直列化に失敗した場合protected final void deserialize(ObjectInputStream ois, Collection coll) throws IOException, ClassNotFoundException
ois
- 使用する ObjectInputStreamcoll
- コレクションIOException
ClassNotFoundException
public final void writeChildren(ObjectOutputStream oos) throws IOException
oos
- 直列化中に使用する ObjectOutputStreamIOException
- 直列化に失敗した場合public final void readChildren(ObjectInputStream ois) throws IOException, ClassNotFoundException
public void vetoableChange(PropertyChangeEvent pce) throws PropertyVetoException
vetoableChange
、インタフェース: VetoableChangeListener
pce
- イベントソースと変更されたプロパティーを記述した PropertyChangeEvent
オブジェクト。PropertyVetoException
- 受け取り側がプロパティー変更をロールバックすることを望んでいる場合。public void propertyChange(PropertyChangeEvent pce)
propertyChange
、インタフェース: PropertyChangeListener
pce
- イベントソースと変更されたプロパティーを記述した PropertyChangeEvent オブジェクト。protected boolean validatePendingAdd(Object targetChild)
このクラスのサブクラスはこのメソッドをオーバーライドまたは包括して、BeanContext に追加される直前に、BeanContext が子オブジェクトを調べるための検証動作を追加できます。
protected boolean validatePendingRemove(Object targetChild)
このクラスのサブクラスはこのメソッドをオーバーライドまたは包括して、BeanContext から削除される直前に、BeanContext が子オブジェクトを調べるための検証動作を追加できます。
protected void childJustAddedHook(Object child, BeanContextSupport.BCSChild bcsc)
protected void childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)
protected static final Visibility getChildVisibility(Object child)
child
- 指定された子protected static final Serializable getChildSerializable(Object child)
child
- 指定された子protected static final PropertyChangeListener getChildPropertyChangeListener(Object child)
child
- 指定された子protected static final VetoableChangeListener getChildVetoableChangeListener(Object child)
child
- 指定された子protected static final BeanContextMembershipListener getChildBeanContextMembershipListener(Object child)
child
- 指定された子protected static final BeanContextChild getChildBeanContextChild(Object child)
child
- 指定された子IllegalArgumentException
- 子が BeanContextChild および BeanContextProxy の両方を実装している場合protected final void fireChildrenAdded(BeanContextMembershipEvent bcme)
protected final void fireChildrenRemoved(BeanContextMembershipEvent bcme)
protected void initialize()
protected final Object[] copyChildren()
バグまたは機能を送信
詳細な API リファレンスおよび開発者ドキュメントについては、Java SE のドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.