所有类


java.beans.beancontext
类 BeanContextSupport

java.lang.Object
  继承者 java.beans.beancontext.BeanContextChildSupport
      继承者 java.beans.beancontext.BeanContextSupport
所有已实现的接口:
BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, DesignMode, PropertyChangeListener, VetoableChangeListener, Visibility, Serializable, Iterable, Collection, EventListener
直接已知子类:
BeanContextServicesSupport

public class BeanContextSupport
   
   
   
   
   
extends BeanContextChildSupport
implements BeanContext, Serializable, PropertyChangeListener, VetoableChangeListener

此帮助器类提供 java.beans.beancontext.BeanContext 接口的实用工具实现。

因为此类直接实现 BeanContext 接口,所以可以通过创建此实现的子类来使用该类,或者由另一个实例对此类实例的特别委托来使用该类。

从以下版本开始:
1.2
另请参见:
序列化表格

嵌套类摘要
protected  classBeanContextSupport.BCSChild
           
protected static classBeanContextSupport.BCSIterator
          受保护的最终子类,它封装一个迭代器但实现无操作 (noop) remove() 方法。
 
字段摘要
protected  ArrayListbcmListeners
          对 protected ArrayList bcmListeners 字段的所有访问在该对象上都将是同步的。
protected  HashMapchildren
          对 protected HashMap children 字段的所有访问在该对象上都将是同步的 (synchronized)。
protected  booleandesignTime
          指示此对象目前是否处于设计时间模式下的 boolean 值。
protected  Localelocale
          此 BeanContext 的当前语言环境。
protected  booleanokToUseGui
          指示此实例现在能否呈现 GUI 的 boolean 值。
 
从类 java.beans.beancontext.BeanContextChildSupport 继承的字段
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport
 
从接口 java.beans.beancontext.BeanContext 继承的字段
globalHierarchyLock
 
从接口 java.beans.DesignMode 继承的字段
PROPERTYNAME
 
构造方法摘要
BeanContextSupport()
          创建不是另一个对象的代理的实例。
BeanContextSupport(BeanContext peer)
          使用默认语言环境创建一个实例
BeanContextSupport(BeanContext peer, Locale lcle)
          使用指定语言环境创建一个实例。
BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime)
          使用指定 Locale 和设计模式创建一个实例。
BeanContextSupport(BeanContext peer, Locale lcle, boolean dTime, boolean visible)
          构造一个 BeanContextSupport 实例。
 
方法摘要
 booleanadd(Object targetChild)
          在此 BeanContext 中添加/嵌套一个子级。
 booleanaddAll(Collection c)
          将 Collection 添加到 Children(不受支持的)实现的集合,这些实现在层次结构锁定和 "children" 受保护字段上必须是同步的
 voidaddBeanContextMembershipListener(BeanContextMembershipListener bcml)
          添加一个 BeanContextMembershipListener。
 booleanavoidingGui()
          用于确定 BeanContext 子级是否避免使用其 GUI。
protected  IteratorbcsChildren()
          返回此 BeanContext 的所有子级的迭代器。
protected  voidbcsPreDeserializationHook(ObjectInputStream ois)
          在调用 defaultReadObject() 之后,但在反序列化任意子级之前,由 readObject 调用。
protected  voidbcsPreSerializationHook(ObjectOutputStream oos)
          在调用 defaultWriteObject() 之后,但在序列化当前可序列化子级之前,由 writeObject 调用。
protected  voidchildDeserializedHook(Object child, BeanContextSupport.BCSChild bcsc)
          由 readObject 利用新近反序列化的子级和 BCSChild 调用。
protected  voidchildJustAddedHook(Object child, BeanContextSupport.BCSChild bcsc)
          子类可以重写此方法,以便在已经添加子对象之后,且在发生事件通知之前,只扩展 add() 语义。
protected  voidchildJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)
          子类可以重写此方法,以便在已经移除子对象之后,且在发生事件通知之前,只扩展 remove() 语义。
protected static booleanclassEquals(Class first, Class second)
          测试以查看两个类对象或其名称是否相等。
 voidclear()
          清除子对象(不受支持的)实现,这些实现在分层结构锁定和 "children" 受保护字段上必须是同步的
 booleancontains(Object o)
          确定指定对象当前是否是此 BeanContext 的子级。
 booleancontainsAll(Collection c)
          测试以查看指定 Collection 中的所有对象是否是此 BeanContext 的子对象。
 booleancontainsKey(Object o)
          确定指定对象当前是否是此 BeanContext 的子级。
protected  Object[]copyChildren()
          获得此 BeanContext 的子级的副本。
protected  BeanContextSupport.BCSChildcreateBCSChild(Object targetChild, Object peer)
           子类可以重写此方法来插入自己的 Child 的子类,而不必重写 add() 或其他将子级添加到集合中的 Collection 方法。
protected  voiddeserialize(ObjectInputStream ois, Collection coll)
          readObject 使用此方法来反序列化一个 collection。
 voiddontUseGui()
          通知此实例它可以不再呈现一个 GUI。
protected  voidfireChildrenAdded(BeanContextMembershipEvent bcme)
          在 BeanContextMembershipListener 接口上触发一个 BeanContextshipEvent。
protected  voidfireChildrenRemoved(BeanContextMembershipEvent bcme)
          在 BeanContextMembershipListener 接口上触发一个 BeanContextshipEvent。
 BeanContextgetBeanContextPeer()
          获得 BeanContext 的实例,此对象将为其提供实现。
protected static BeanContextChildgetChildBeanContextChild(Object child)
          与指定 Child 相关联的 BeanContextChild(如果有)。
protected static BeanContextMembershipListenergetChildBeanContextMembershipListener(Object child)
          与指定 Child 相关联的 BeanContextMembershipListener(如果有)。
protected static PropertyChangeListenergetChildPropertyChangeListener(Object child)
          与指定 Child 相关联的 PropertyChangeListener(如果有)
protected static SerializablegetChildSerializable(Object child)
          获得与指定 Child 相关联的 Serializable(如果有)
protected static VetoableChangeListenergetChildVetoableChangeListener(Object child)
          与指定 Child 相关联的 VetoableChangeListener(如果有)。
protected static VisibilitygetChildVisibility(Object child)
          获得与指定子级相关联的 Component(如果有)。
 LocalegetLocale()
          获得此 BeanContext 的语言环境。
 URLgetResource(String name, BeanContextChild bcc)
          与 java.lang.ClassLoader.getResource() 类似,此方法允许 BeanContext 实现协调子 Component 和基础 ClassLoader 之间的行为。
 InputStreamgetResourceAsStream(String name, BeanContextChild bcc)
          与 java.lang.ClassLoader.getResourceAsStream() 类似,此方法允许 BeanContext 实现协调子 Component 和基础 ClassLoader 之间的行为。
protected  voidinitialize()
          从构造方法和 readObject 调用的受保护方法,以初始化 BeanContextSupport 实例的瞬态。
 ObjectinstantiateChild(String beanName)
           instantiateChild 方法是 BeanContext 中用来简化将嵌套的 Bean 实例化 BeanContext 这项任务的便捷挂钩。
 booleanisDesignTime()
          报告此对象当前是否处于设计时间模式下。
 booleanisEmpty()
          报告此 BeanContext 是否为空。
 booleanisSerializing()
          此 BeanContext 正处于序列化过程中吗?
 Iteratoriterator()
          获得当前嵌套在此 BeanContext 中的所有 JavaBean 或 BeanContext 实例。
 booleanneedsGui()
           此方法通常从环境中调用,以便确定实现者是否“需要” GUI。
 voidokToUseGui()
          通知此实例它现在可以呈现一个 GUI。
 voidpropertyChange(PropertyChangeEvent pce)
          子类可以封装此方法来监视子类属性的更改。
 voidreadChildren(ObjectInputStream ois)
          在将此类的实例用作 BeanContext 协议(及其子协议)实现的代理时,在反序列化期间存在一个“先有鸡还是先有蛋”的问题。
 booleanremove(Object targetChild)
          从此 BeanContext 中移除一个子对象。
protected  booleanremove(Object targetChild, boolean callChildSetBC)
          当由意外的 setBeanContextremove() 调用导致移除时使用的内部移除方法。
 booleanremoveAll(Collection c)
          移除所有指定 Children(不受支持的)实现,这些实现在层次结构锁定和 "children" 受保护字段上必须是同步的
 voidremoveBeanContextMembershipListener(BeanContextMembershipListener bcml)
          移除一个 BeanContextMembershipListener。
 booleanretainAll(Collection c)
          仅保留指定子对象(不受支持的)实现,这些实现在层次结构锁定和 "children" 受保护字段上必须是同步的
protected  voidserialize(ObjectOutputStream oos, Collection coll)
          writeObject 使用此方法来序列化一个 Collection。
 voidsetDesignTime(boolean dTime)
          为此 BeanContext 设置新的设计时间值。
 voidsetLocale(Locale newLocale)
          设置此 BeanContext 的语言环境。
 intsize()
          获得当前嵌套在此 BeanContext 中的子级数。
 Object[]toArray()
          获得当前嵌套在此 BeanContext 中的所有 JavaBean 或 BeanContext 实例。
 Object[]toArray(Object[] arry)
          获得包含与数组中所包含类型匹配的此 BeanContext 的所有子级的数组。
protected  booleanvalidatePendingAdd(Object targetChild)
           此类的子类可以重写或封装此方法,以便为 BeanContext 添加有效行为,从而能在将子对象添加到 BeanContext 之前立即检查它们。
protected  booleanvalidatePendingRemove(Object targetChild)
           此类的子类可以重写或封装此方法,以便为 BeanContext 添加有效行为,从而能在将子对象从 BeanContext 中移除之前立即检查它们。
 voidvetoableChange(PropertyChangeEvent pce)
          子类可以封装此方法来监视子类属性的更改。
 voidwriteChildren(ObjectOutputStream oos)
          用于序列化此 BeanContext 的所有子级。
 
从类 java.beans.beancontext.BeanContextChildSupport 继承的方法
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, initializeBeanContextResources, isDelegated, releaseBeanContextResources, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, validatePendingSetBeanContext
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
从接口 java.beans.beancontext.BeanContextChild 继承的方法
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext
 
从接口 java.util.Collection 继承的方法
equals, hashCode
 

字段详细信息

children

protected transient HashMap children
protected HashMap children 字段的所有访问在该对象上都将是同步的 (synchronized)。


bcmListeners

protected transient ArrayList bcmListeners
protected ArrayList bcmListeners 字段的所有访问在该对象上都将是同步的。


locale

protected Locale locale
此 BeanContext 的当前语言环境。


okToUseGui

protected boolean okToUseGui
指示此实例现在能否呈现 GUI 的 boolean 值。


designTime

protected boolean designTime
指示此对象目前是否处于设计时间模式下的 boolean 值。

构造方法详细信息

BeanContextSupport

public BeanContextSupport(BeanContext peer,
                          Locale lcle,
                          boolean dTime,
                          boolean visible)
构造一个 BeanContextSupport 实例。

参数:
peer - 将为其提供实现的同位体 BeanContext,如果此对象是它自己的同位体,则该参数为 null
lcle - 此 BeanContext 的当前 Locale。如果 lclenull,则默认语言环境被分配给 BeanContext 实例。
dTime - 初始状态,如果在设计模式下,则该参数为 true,如果在运行状态下,则该参数为 false
visible - 初始可见性。
另请参见:
Locale.getDefault(), Locale.setDefault(java.util.Locale)

BeanContextSupport

public BeanContextSupport(BeanContext peer,
                          Locale lcle,
                          boolean dtime)
使用指定 Locale 和设计模式创建一个实例。

参数:
peer - 将为其提供实现的同位体 BeanContext,如果此对象是它自己的同位体,则该参数为 null
lcle - 此 BeanContext 的当前 Locale。如果 lclenull,则默认语言环境被分配给 BeanContext 实例。
dtime - 初始状态,如果在设计模式下,则该参数为 true,如果在运行状态下,则该参数为 false
另请参见:
Locale.getDefault(), Locale.setDefault(java.util.Locale)

BeanContextSupport

public BeanContextSupport(BeanContext peer,
                          Locale lcle)
使用指定语言环境创建一个实例。

参数:
peer - 将为其提供实现的同位体 BeanContext,如果此对象是它自己的同位体,则该参数为 null
lcle - 此 BeanContext 的当前 Locale。如果 lclenull,则默认语言环境被分配给 BeanContext 实例。
另请参见:
Locale.getDefault(), Locale.setDefault(java.util.Locale)