- java.lang.Object
-
- java.beans.beancontext.BeanContextChildSupport
-
- java.beans.beancontext.BeanContextSupport
-
- All Implemented Interfaces:
-
BeanContext,BeanContextChild,BeanContextServiceRevokedListener,BeanContextServicesListener,DesignMode,PropertyChangeListener,VetoableChangeListener,Visibility,Serializable,Iterable<E>,Collection,EventListener
- 已知直接子类:
-
BeanContextServicesSupport
public class BeanContextSupport extends BeanContextChildSupport implements BeanContext, Serializable, PropertyChangeListener, VetoableChangeListener
这个帮助类提供java.beans.beancontext.BeanContext接口的实用程序实现。由于该类直接实现了BeanContext接口,所以该类可以通过将此实现进行子类化,也可以通过对另一个类的实例进行临时委派来使用。
- 从以下版本开始:
- 1.2
- 另请参见:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 描述 protected classBeanContextSupport.BCSChildprotected static classBeanContextSupport.BCSIterator受保护的final子类封装了一个迭代器,但实现了一个noop remove()方法。
-
Field Summary
Fields Modifier and Type Field 描述 protected ArrayList<BeanContextMembershipListener>bcmListeners对protected ArrayList bcmListeners字段的所有访问应在该对象上同步。protected HashMap<Object,BeanContextSupport.BCSChild>children对protected HashMap children字段的所有访问应在该对象上同步。protected booleandesignTimeAboolean指示该对象当前是否处于设计时间模式。protected Localelocale此BeanContext的当前区域设置。protected booleanokToUseGuiAboolean指示该实例现在是否可以呈现GUI。-
Fields inherited from interface java.beans.beancontext.BeanContext
globalHierarchyLock
-
Fields inherited from class java.beans.beancontext.BeanContextChildSupport
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport
-
Fields inherited from interface java.beans.DesignMode
PROPERTYNAME
-
-
构造方法摘要
构造方法 Constructor 描述 BeanContextSupport()创建一个不是另一个对象的委托的实例BeanContextSupport(BeanContext peer)新新200新200新新新新新旗新新200新新200新新200新新200新新200新新200新新200新新200新新新200新新200新新BeanContextSupport(BeanContext peer, Locale lcle)使用指定的区域设置创建一个实例BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime)使用指定的区域设置和设计模式创建一个实例。BeanContextSupport(BeanContext peer, Locale lcle, boolean dTime, boolean visible)200新新新新200新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗200新新旗新新200新
-
方法摘要
所有方法 静态方法 接口方法 具体的方法 Modifier and Type 方法 描述 booleanadd(Object targetChild)在这个BeanContext内添加/嵌套一个孩子。booleanaddAll(Collection c)将集合添加到子集(不支持)的集合实现必须在层次结构锁和“children”保护字段上同步voidaddBeanContextMembershipListener(BeanContextMembershipListener bcml)添加一个BeanContextMembershipListenerbooleanavoidingGui()用于确定BeanContext孩子是否避免使用其GUI。protected Iterator<BeanContextSupport.BCSChild>bcsChildren()返回此BeanContext的所有子项的迭代器。protected voidbcsPreDeserializationHook(ObjectInputStream ois)通过readObject在defaultReadObject()之后调用,但在任何孩子反序列化之前。protected voidbcsPreSerializationHook(ObjectOutputStream oos)在writeWriteObject()之后但在序列化当前可序列化的孩子之前调用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的子BeanContext。booleancontainsAll(Collection c)测试以查看指定的Collection中的所有对象是否为Collection的子BeanContext。booleancontainsKey(Object o)确定指定的对象当前是否为此BeanContext的子BeanContext。protected Object[]copyChildren()获取这个BeanContext的孩子的副本。protected BeanContextSupport.BCSChildcreateBCSChild(Object targetChild, Object peer)子类可以覆盖这个方法来插入他们自己的Child子类,而不必重写add()或者添加子集的其他Collection方法。protected voiddeserialize(ObjectInputStream ois, Collection coll)由readObject用于反序列化集合。voiddontUseGui()通知此实例可能不再呈现GUI。protected voidfireChildrenAdded(BeanContextMembershipEvent bcme)在BeanContextMembershipListener接口上激活BeanContextshipEventprotected voidfireChildrenRemoved(BeanContextMembershipEvent bcme)在BeanContextMembershipListener接口上激活BeanContextshipEventBeanContextgetBeanContextPeer()获取这个对象提供的实现的BeanContext的实例。protected static BeanContextChildgetChildBeanContextChild(Object child)获取指定子节点的BeanContextChild(如果有)protected static BeanContextMembershipListenergetChildBeanContextMembershipListener(Object child)获取指定子节点的BeanContextMembershipListener(如果有)protected static PropertyChangeListenergetChildPropertyChangeListener(Object child)获取指定子对象的PropertyChangeListener(如果有)protected static SerializablegetChildSerializable(Object child)获取与指定的Child相关联的Serializable(如果有)protected static VetoableChangeListenergetChildVetoableChangeListener(Object child)获取指定子节点的VetoableChangeListener(如果有)protected static VisibilitygetChildVisibility(Object child)获取与指定子项关联的组件(如果有)。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()protected方法从构造函数和readObject调用,初始化BeanContextSupport实例的暂态。ObjectinstantiateChild(String beanName)instantiateChild方法是BeanContext中的一个方便的钩子,用于简化将Bean实例化的任务嵌套到一个BeanContext。booleanisDesignTime()报告此对象是否在当前处于设计时模式。booleanisEmpty()报告此BeanContext是否为空。booleanisSerializing()这是BeanContext在串行化的过程吗?Iterator<Object>iterator()获取当前嵌套在此BeanContext中的所有JavaBean或BeanContext实例。booleanneedsGui()通常从环境中调用此方法,以确定实现者是否“需要”GUI。voidokToUseGui()通知此实例,它现在可以呈现GUIvoidpropertyChange(PropertyChangeEvent pce)子类可以包围以监视子属性更改。voidreadChildren(ObjectInputStream ois)当这个类的实例被用作实现BeanContext协议(及其子协议)的委托时,在反序列化期间存在一个'鸡和蛋'问题booleanremove(Object targetChild)从此BeanContext中删除一个小孩。protected booleanremove(Object targetChild, boolean callChildSetBC)内部删除使用时,由意外的setBeanContext或remove()引起的移除。booleanremoveAll(Collection c)删除所有指定的子(不支持)实现必须在层次结构锁和“children”保护字段上同步voidremoveBeanContextMembershipListener(BeanContextMembershipListener bcml)删除一个BeanContextMembershipListenerbooleanretainAll(Collection c)只保留指定的子级(不支持)实现必须在层次结构锁和“children”保护字段上同步protected voidserialize(ObjectOutputStream oos, Collection<?> coll)由writeObject用于序列化集合。voidsetDesignTime(boolean dTime)设置此BeanContext的新设计时间值。voidsetLocale(Locale newLocale)设置此BeanContext的区域设置。intsize()获取当前嵌套在此BeanContext中的子节点数。Object[]toArray()获取当前嵌套在此BeanContext中的所有JavaBean或BeanContext实例。Object[]toArray(Object[] arry)获取一个包含此BeanContext所有子项的BeanContext,与BeanContext中包含的类型相匹配。protected booleanvalidatePendingAdd(Object targetChild)此类的子类可以覆盖或包络此方法,以便为BeanContext添加验证行为,以便在添加到BeanContext之前立即检查子对象。protected booleanvalidatePendingRemove(Object targetChild)此类的子类可以覆盖或包络此方法,以便为BeanContext添加验证行为,以便在BeanContext从BeanContext中删除之前立即检查子对象。voidvetoableChange(PropertyChangeEvent pce)子类可以包围以监视否决权子变化。voidwriteChildren(ObjectOutputStream oos)用于序列化这个BeanContext所有孩子。-
Methods inherited from interface java.beans.beancontext.BeanContextChild
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext
-
Methods inherited from class java.beans.beancontext.BeanContextChildSupport
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, initializeBeanContextResources, isDelegated, releaseBeanContextResources, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, validatePendingSetBeanContext
-
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream
-
-
-
-
字段详细信息
-
children
protected transient HashMap<Object,BeanContextSupport.BCSChild> children
对protected HashMap children字段的所有访问应在该对象上同步。
-
bcmListeners
protected transient ArrayList<BeanContextMembershipListener> bcmListeners
对protected ArrayList bcmListeners字段的所有访问应在该对象上同步。
-
locale
protected Locale locale
此BeanContext的当前区域设置。
-
okToUseGui
protected boolean okToUseGui
Aboolean指示该实例现在是否可以呈现GUI。
-
designTime
protected boolean designTime
Aboolean指示该对象当前是否处于设计时间模式。
-
-
构造方法详细信息
-
BeanContextSupport
public BeanContextSupport(BeanContext peer, Locale lcle, boolean dTime, boolean visible)
200新新新新200新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗新新旗200新新旗新新200新- 参数
-
peer- 对等体BeanContext我们正在提供一个实现,或者null如果这个对象是它自己的对等 -
lcle- 此BeanContext的当前区域设置。 如果lcle为null,则将默认语言环境分配给BeanContext实例。 -
dTime- 初始状态,true如果在设计模式下,false如果运行时。 -
visible- 初始可见度。 - 另请参见:
-
Locale.getDefault(),Locale.setDefault(java.util.Locale)
-
BeanContextSupport
public BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime)
使用指定的区域设置和设计模式创建一个实例。- 参数
-
peer- 对等体BeanContext我们正在提供一个实现,如果这个对象是自己的对等体,null -
lcle- 此BeanContext的当前语言环境。 如果lcle为null,null将默认语言环境分配给BeanContext实例。 -
dtime- 初始状态,true如果在设计模式下,false如果运行时。 - 另请参见:
-
Locale.getDefault(),Locale.setDefault(java.util.Locale)
-
BeanContextSupport
public BeanContextSupport(BeanContext peer, Locale lcle)
使用指定的区域设置创建一个实例- 参数
-
peer- 对等BeanContext我们提供了一个实现,或者是null如果这个对象是它自己的对等 -
lcle- 此BeanContext的当前语言环境。 如果lcle为null,则将默认语言环境分配给BeanContext实例。 - 另请参见:
-
Locale.getDefault(),Locale.setDefault(java.util.Locale)
-
BeanContextSupport
public BeanContextSupport(BeanContext peer)
新新200新200新新新新新旗新新200新新200新新200新新200新新200新新200新新200新新200新新新200新新200新新- 参数
-
peer- 对等体BeanContext我们提供了一个实现,如果这个对象是它自己的对等点,或者是null
-
BeanContextSupport
public BeanContextSupport()
创建一个不是另一个对象的委托的实例
-
-
方法详细信息
-
getBeanContextPeer
public BeanContext getBeanContextPeer()
获取BeanContext的实例,该对象正在为其提供实现。- 结果
- BeanContext实例
-
instantiateChild
public Object instantiateChild(String beanName) throws IOException, ClassNotFoundException
instantiateChild方法是BeanContext中的一个方便的钩子,用于简化将Bean实例化的任务嵌套到一个
BeanContext。beanName参数的语义由java.beans.Beans.instantiate定义。
- Specified by:
-
instantiateChild在接口BeanContext - 参数
-
beanName- 要在此BeanContext中实例化的Bean的名称 - 结果
- 新的对象
- 异常
-
IOException- 当bean被反序列化时是否存在I / O错误 -
ClassNotFoundException- 如果没有找到由beanName参数标识的类
-
size
public int size()
获取当前嵌套在此BeanContext中的子节点数。- Specified by:
-
size在接口Collection - 结果
- 儿童人数
-
isEmpty
public boolean isEmpty()
报告此BeanContext是否为空。 如果一个BeanContext包含零个嵌套的子项,那么它被认为是空的。- Specified by:
-
isEmpty在接口Collection - 结果
- 如果没有孩子
-
contains
public boolean contains(Object o)
确定指定的对象当前是否为此BeanContext的子BeanContext。- Specified by:
-
contains在接口Collection - 参数
-
o- 有问题的对象 - 结果
- 如果这个对象是一个小孩
-
containsKey
public boolean containsKey(Object o)
确定指定对象当前是否为此BeanContext的子BeanContext。- 参数
-
o- 有问题的对象 - 结果
- 如果这个对象是一个小孩
-
iterator
public Iterator<Object> iterator()
获取当前嵌套在此BeanContext中的所有JavaBean或BeanContext实例。- Specified by:
-
iterator在接口Collection - Specified by:
-
iterator在接口Iterable<E> - 结果
-
一个
Iterator的嵌套的孩子
-
toArray
public Object[] toArray()
获取当前嵌套在此BeanContext中的所有JavaBean或BeanContext实例。- Specified by:
-
toArray在接口Collection - 结果
- 一个包含此集合中所有元素的数组
-
toArray
public Object[] toArray(Object[] arry)
获取一个包含此BeanContext所有子项的数组,该数组与BeanContext中包含的类型相匹配。- Specified by:
-
toArray在接口Collection - 参数
-
arry- 感兴趣的对象类型的数组。 - 结果
- 一群孩子
-
createBCSChild
protected BeanContextSupport.BCSChild createBCSChild(Object targetChild, Object peer)
子类可以覆盖这个方法来插入他们自己的Child子类,而不必重写add()或者添加子集的其他Collection方法。
- 参数
-
targetChild- 代表孩子创建的孩子 -
peer- 对等体如果tragetChild和对等体通过BeanContextProxy的实现相关联 - 结果
- 子类别的子类别,而不用覆盖收集方法
-
add
public boolean add(Object targetChild)
在这个BeanContext内添加/嵌套一个孩子。作为java.beans.Beans.instantiate()的副作用调用。 如果子对象无法添加,则此方法将抛出IllegalStateException异常。
- Specified by:
-
add在接口Collection - 参数
-
targetChild- 该对象嵌套在此BeanContext - 结果
- 如果孩子成功添加,则为true。
- 另请参见:
-
validatePendingAdd(java.lang.Object)
-
remove
public boolean remove(Object targetChild)
从此BeanContext中删除一个小孩。 如果子对象不用于添加,则此方法将抛出IllegalStateException。- Specified by:
-
remove在接口Collection - 参数
-
targetChild- 子对象要删除 - 结果
-
true如果元素被删除作为此调用的结果 - 另请参见:
-
validatePendingRemove(java.lang.Object)
-
remove
protected boolean remove(Object targetChild, boolean callChildSetBC)
内部删除使用时,由意外的setBeanContext或remove()调用造成的。- 参数
-
targetChild- 要删除的JavaBean,BeanContext或Object -
callChildSetBC- 用于表示应该通知孩子它不再嵌套在这个BeanContext。 - 结果
- 是否存在被删除之前
-
containsAll
public boolean containsAll(Collection c)
测试以查看指定的Collection中的所有对象是否为Collection的子BeanContext。- Specified by:
-
containsAll在接口Collection - 参数
-
c- 指定的Collection - 结果
-
true如果集合中的所有对象都是这个BeanContext子对象,如果没有,BeanContextfalse。 - 另请参见:
-
Collection.contains(Object)
-
addAll
public boolean addAll(Collection c)
将集合添加到子集(不支持)的集合实现必须在层次结构锁和“children”保护字段上同步- Specified by:
-
addAll在接口Collection - 参数
-
c- 包含要添加到此集合的元素的集合 - 结果
-
这个实现无条件地抛出
UnsupportedOperationException - 异常
-
UnsupportedOperationException- 无条件抛出此实现 - 另请参见:
-
Collection.add(Object)
-
removeAll
public boolean removeAll(Collection c)
删除所有指定的子(不支持)实现必须在层次结构锁和“children”保护字段上同步- Specified by:
-
removeAll在接口Collection - 参数
-
c- 包含要从此集合中删除的元素的集合 - 结果
-
这个实现无条件地抛出
UnsupportedOperationException - 异常
-
UnsupportedOperationException- 无条件抛出此实现 - 另请参见:
-
Collection.remove(Object),Collection.contains(Object)
-
retainAll
public boolean retainAll(Collection c)
只保留指定的子级(不支持)实现必须在层次结构锁和“children”保护字段上同步- Specified by:
-
retainAll在接口Collection - 参数
-
c- 包含要保留在此集合中的元素的集合 - 结果
-
这个实现无条件地抛出
UnsupportedOperationException - 异常
-
UnsupportedOperationException- 无条件抛出此实现 - 另请参见:
-
Collection.remove(Object),Collection.contains(Object)
-
clear
public void clear()
清除子层(不支持)实现必须在层次结构锁和“children”保护字段上同步- Specified by:
-
clear在接口Collection - 异常
-
UnsupportedOperationException- 无条件抛出此实现
-
addBeanContextMembershipListener
public void addBeanContextMembershipListener(BeanContextMembershipListener bcml)
添加一个BeanContextMembershipListener- Specified by:
-
addBeanContextMembershipListener在接口BeanContext - 参数
-
bcml- 要添加的BeanContextMembershipListener - 异常
-
NullPointerException- 如果参数为空
-
removeBeanContextMembershipListener
public void removeBeanContextMembershipListener(BeanContextMembershipListener bcml)
删除一个BeanContextMembershipListener- Specified by:
-
removeBeanContextMembershipListener在接口BeanContext - 参数
-
bcml- 要删除的BeanContextMembershipListener - 异常
-
NullPointerException- 如果参数为空
-
getResourceAsStream
public InputStream getResourceAsStream(String name, BeanContextChild bcc)
说明从界面BeanContext复制对于java.lang.ClassLoader.getResourceAsStream(),这种方法允许BeanContext实施介入孩子Component和底层ClassLoader之间的行为。- Specified by:
-
getResourceAsStream在接口BeanContext - 参数
-
name- 请求的资源的名称。 -
bcc- 提出请求的子对象。 - 结果
- 所请求的资源作为InputStream
- 异常
-
NullPointerException- 如果参数为空
-
getResource
public URL getResource(String name, BeanContextChild bcc)
描述从接口BeanContext复制对于java.lang.ClassLoader.getResource(),这种方法允许BeanContext实现介入孩子Component和底层的ClassLoader之间的行为。- Specified by:
-
getResource在接口BeanContext - 参数
-
name- 请求的资源的名称。 -
bcc- 提出请求的子对象。 - 结果
- 所请求的资源作为InputStream
-
setDesignTime
public void setDesignTime(boolean dTime)
设置这个BeanContext的新设计时间值。- Specified by:
-
setDesignTime在接口DesignMode - 参数
-
dTime- 新的designTime值 - 另请参见:
-
BeanContext,BeanContextMembershipListener,PropertyChangeEvent
-
isDesignTime
public boolean isDesignTime()
报告此对象是否在当前处于设计时模式。- Specified by:
-
isDesignTime在接口DesignMode - 结果
-
true如果在设计时模式下,如果没有false
-
setLocale
public void setLocale(Locale newLocale) throws PropertyVetoException
设置此BeanContext的区域设置。- 参数
-
newLocale- 新的地区。 如果newLocale为null则此方法调用将null。 - 异常
-
PropertyVetoException- 如果新值被拒绝
-
getLocale
public Locale getLocale()
获取此BeanContext的区域设置。- 结果
-
当前的Locale的
BeanContext
-
needsGui
public boolean needsGui()
通常从环境中调用此方法,以确定实现者是否“需要”GUI。
本文使用的算法测试BeanContextPeer及其当前的子节点,以确定它们是容器,组件,还是实现可见性并返回needsGui()== true。
- Specified by:
-
needsGui在接口Visibility - 结果
-
true如果实现者需要一个GUI
-
dontUseGui
public void dontUseGui()
通知此实例可能不再呈现GUI。- Specified by:
-
dontUseGui在接口Visibility
-
okToUseGui
public void okToUseGui()
通知此实例,它现在可以呈现GUI- Specified by:
-
okToUseGui在接口Visibility
-
avoidingGui
public boolean avoidingGui()
用于确定BeanContext孩子是否避免使用其GUI。- Specified by:
-
avoidingGui在接口Visibility - 结果
- 这个实例是避免使用GUI吗?
- 另请参见:
-
Visibility
-
isSerializing
public boolean isSerializing()
这是BeanContext在序列化的过程中吗?- 结果
-
如果这个
BeanContext目前正在序列化
-
bcsChildren
protected Iterator<BeanContextSupport.BCSChild> bcsChildren()
返回此BeanContext的所有子代的迭代器。- 结果
- 所有当前BCSChild值的迭代器
-
bcsPreSerializationHook
protected void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException
在writeWriteObject()之后但在序列化当前可序列化的孩子之前调用writeObject。 这个方法可能被子类覆盖,以便在这个超类序列化孩子之前执行其状态的自定义序列化。 然而,这个方法不应该被子类用来替换它们自己的writeObject()的实现(如果有的话)。- 参数
-
oos- 序列化期间使用的ObjectOutputStream - 异常
-
IOException- 如果序列化失败
-
bcsPreDeserializationHook
protected void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException
通过readObject在defaultReadObject()之后调用,但在任何孩子反序列化之前。 这个方法可能会被子类覆盖,以便在这个超类反序列化子进程之前执行其状态的自定义反序列化。 然而,这个方法不应该被子类用来替换它们自己的readObject()的实现(如果有的话)。- 参数
-
ois- 反序列化期间使用的ObjectInputStream - 异常
-
IOException- 如果反序列化失败 -
ClassNotFoundException- 如果没有找到需要的类
-
childDeserializedHook
protected void childDeserializedHook(Object child, BeanContextSupport.BCSChild bcsc)
由readObject与新反序列化的小孩和BCSChild调用。- 参数
-
child- 新反序列化的孩子 -
bcsc- 新反序列化的BCSChild
-
serialize
protected final void serialize(ObjectOutputStream oos, Collection<?> coll) throws IOException
由writeObject用于序列化集合。- 参数
-
oos- 序列化期间使用的ObjectOutputStream -
coll-Collection要序列化 - 异常
-
IOException- 如果序列化失败
-
deserialize
protected final void deserialize(ObjectInputStream ois, Collection coll) throws IOException, ClassNotFoundException
由readObject用于反序列化集合。- 参数
-
ois- 要使用的ObjectInputStream -
coll- 集合 - 异常
-
IOException- 如果反序列化失败 -
ClassNotFoundException- 如果没有找到需要的类
-
writeChildren
public final void writeChildren(ObjectOutputStream oos) throws IOException
用于序列化这个BeanContext所有孩子。- 参数
-
oos- 序列化期间使用的ObjectOutputStream - 异常
-
IOException- 如果序列化失败
-
readChildren
public final void readChildren(ObjectInputStream ois) throws IOException, ClassNotFoundException
当这个类的实例被用作实现BeanContext协议(及其子协议)的委托时,在反序列化期间存在一个'鸡和蛋'问题- 参数
-
ois- 要使用的ObjectInputStream - 异常
-
IOException- 如果反序列化失败 -
ClassNotFoundException- 如果没有找到需要的类
-
vetoableChange
public void vetoableChange(PropertyChangeEvent pce) throws PropertyVetoException
子类可以包围以监视否决权子变化。- Specified by:
-
vetoableChange在接口VetoableChangeListener - 参数
-
pce- 描述事件源和已更改的属性的PropertyChangeEvent对象。 - 异常
-
PropertyVetoException- 如果收件人希望回滚属性更改。
-
propertyChange
public void propertyChange(PropertyChangeEvent pce)
子类可以包围以监视子属性更改。- Specified by:
-
propertyChange在接口PropertyChangeListener - 参数
-
pce- 描述事件源和已更改的属性的PropertyChangeEvent对象。
-
validatePendingAdd
protected boolean validatePendingAdd(Object targetChild)
此类的子类可以覆盖或包络此方法,以便为BeanContext添加验证行为,以便在添加到BeanContext之前立即检查子对象。
- 参数
-
targetChild- 孩子代表孩子创建 - 结果
- 如果孩子可能被添加到此BeanContext,则为true,否则为false。
-
validatePendingRemove
protected boolean validatePendingRemove(Object targetChild)
此类的子类可以覆盖或包络此方法,以便为BeanContext添加验证行为,以便在BeanContext从BeanContext中删除之前立即检查子对象。
- 参数
-
targetChild- 代表孩子创建孩子 - 结果
- 如果小孩可能从此BeanContext中删除,则为true,否则为false。
-
childJustAddedHook
protected void childJustAddedHook(Object child, BeanContextSupport.BCSChild bcsc)
子类可以覆盖此方法,以便在添加子项之后和事件通知发生之前简单地扩展add()语义。 该方法与子进程同步调用。- 参数
-
child- 小孩 -
bcsc- BCSChild
-
childJustRemovedHook
protected void childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)
子类可以覆盖此方法,以便在子进程已被删除之后和事件通知发生之前简单地扩展remove()语义。 该方法与子进程同步调用。- 参数
-
child- 小孩 -
bcsc- BCSChild
-
getChildVisibility
protected static final Visibility getChildVisibility(Object child)
获取与指定子项关联的组件(如果有)。- 参数
-
child- 指定的孩子 - 结果
- 与指定子项相关联的组件(如果有)。
-
getChildSerializable
protected static final Serializable getChildSerializable(Object child)
获取与指定的Child相关联的Serializable(如果有)- 参数
-
child- 指定的孩子 - 结果
- 与指定的Child相关联的Serializable(如果有)
-
getChildPropertyChangeListener
protected static final PropertyChangeListener getChildPropertyChangeListener(Object child)
获取指定子对象的PropertyChangeListener(如果有)- 参数
-
child- 指定的孩子 - 结果
- 指定子的PropertyChangeListener(如果有)
-
getChildVetoableChangeListener
protected static final VetoableChangeListener getChildVetoableChangeListener(Object child)
获取指定子节点的VetoableChangeListener(如果有)- 参数
-
child- 指定的小孩 - 结果
- 指定子代的VetoableChangeListener(如果有)
-
getChildBeanContextMembershipListener
protected static final BeanContextMembershipListener getChildBeanContextMembershipListener(Object child)
获取指定子节点的BeanContextMembershipListener(如果有)- 参数
-
child- 指定的孩子 - 结果
- 指定子对象的BeanContextMembershipListener(如果有)
-
getChildBeanContextChild
protected static final BeanContextChild getChildBeanContextChild(Object child)
获取指定子节点的BeanContextChild(如果有)- 参数
-
child- 指定的孩子 - 结果
- 指定子的BeanContextChild(如果有的话)
- 异常
-
IllegalArgumentException- 如果子实现了两个BeanContextChild和BeanContextProxy
-
fireChildrenAdded
protected final void fireChildrenAdded(BeanContextMembershipEvent bcme)
在BeanContextMembershipListener接口上激活BeanContextshipEvent- 参数
-
bcme- 事件发生
-
fireChildrenRemoved
protected final void fireChildrenRemoved(BeanContextMembershipEvent bcme)
在BeanContextMembershipListener接口上激活BeanContextshipEvent- 参数
-
bcme- 事件发生
-
initialize
protected void initialize()
protected方法从构造函数和readObject调用,初始化BeanContextSupport实例的暂态。 此类使用此方法来实例化用于监视子对象的PropertyChange和VetoableChange事件的内部类侦听器。 子类可以包含这个方法来添加自己的初始化行为
-
copyChildren
protected final Object[] copyChildren()
获取这个BeanContext的孩子的副本。- 结果
- 当前嵌套的孩子的副本
-
-