BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, DesignMode, PropertyChangeListener, VetoableChangeListener, Visibility, Serializable, Iterable, Collection, EventListenerBeanContextServicesSupport@Deprecated(since="23", forRemoval=true) public class BeanContextSupport extends BeanContextChildSupport implements BeanContext, Serializable, PropertyChangeListener, VetoableChangeListener
Since this class directly implements the BeanContext interface, the class can, and is intended to be used either by subclassing this implementation, or via ad-hoc delegation of an instance of this class from another.
| Modifier and Type | Class | Description |
|---|---|---|
protected class |
BeanContextSupport.BCSChild |
Deprecated, for removal: This API element is subject to removal in a future version. A protected nested class containing per-child information in the children hashtable. |
protected static final class |
BeanContextSupport.BCSIterator |
Deprecated, for removal: This API element is subject to removal in a future version. protected final subclass that encapsulates an iterator but implements a noop remove() method. |
| Modifier and Type | Field | Description |
|---|---|---|
protected ArrayList |
bcmListeners |
Deprecated, for removal: This API element is subject to removal in a future version. all accesses to the protected ArrayList bcmListeners field shall be synchronized on that object. |
protected HashMap |
children |
Deprecated, for removal: This API element is subject to removal in a future version. all accesses to the protected HashMap children field shall be synchronized on that object. |
protected boolean |
designTime |
Deprecated, for removal: This API element is subject to removal in a future version. A boolean indicating whether or not this object is currently in design time mode. |
protected Locale |
locale |
Deprecated, for removal: This API element is subject to removal in a future version. The current locale of this BeanContext. |
protected boolean |
okToUseGui |
Deprecated, for removal: This API element is subject to removal in a future version. A boolean indicating if this instance may now render a GUI. |
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport
globalHierarchyLock
PROPERTYNAME
| Constructor | Description |
|---|---|
BeanContextSupport() |
Deprecated, for removal: This API element is subject to removal in a future version. Create an instance that is not a delegate of another object |
BeanContextSupport |
Deprecated, for removal: This API element is subject to removal in a future version. Create an instance using with a default locale |
BeanContextSupport |
Deprecated, for removal: This API element is subject to removal in a future version. Create an instance using the specified locale |
BeanContextSupport |
Deprecated, for removal: This API element is subject to removal in a future version. Create an instance using the specified Locale and design mode. |
BeanContextSupport |
Deprecated, for removal: This API element is subject to removal in a future version. Construct a BeanContextSupport instance |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add |
Deprecated, for removal: This API element is subject to removal in a future version. Adds/nests a child within this BeanContext. |
boolean |
addAll |
Deprecated, for removal: This API element is subject to removal in a future version. add Collection to set of Children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field |
void |
addBeanContextMembershipListener |
Deprecated, for removal: This API element is subject to removal in a future version. Adds a BeanContextMembershipListener |
boolean |
avoidingGui() |
Deprecated, for removal: This API element is subject to removal in a future version. Used to determine if the BeanContext child is avoiding using its GUI. |
protected Iterator |
bcsChildren() |
Deprecated, for removal: This API element is subject to removal in a future version. Returns an iterator of all children of this BeanContext. |
protected void |
bcsPreDeserializationHook |
Deprecated, for removal: This API element is subject to removal in a future version. called by readObject after defaultReadObject() but prior to deserialization of any children. |
protected void |
bcsPreSerializationHook |
Deprecated, for removal: This API element is subject to removal in a future version. called by writeObject after defaultWriteObject() but prior to serialization of currently serializable children. |
protected void |
childDeserializedHook |
Deprecated, for removal: This API element is subject to removal in a future version. Called by readObject with the newly deserialized child and BCSChild. |
protected void |
childJustAddedHook |
Deprecated, for removal: This API element is subject to removal in a future version. subclasses may override this method to simply extend add() semantics after the child has been added and before the event notification has occurred. |
protected void |
childJustRemovedHook |
Deprecated, for removal: This API element is subject to removal in a future version. subclasses may override this method to simply extend remove() semantics after the child has been removed and before the event notification has occurred. |
protected static final boolean |
classEquals |
Deprecated, for removal: This API element is subject to removal in a future version. Tests to see if two class objects, or their names are equal. |
void |
clear() |
Deprecated, for removal: This API element is subject to removal in a future version. clear the children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field |
boolean |
contains |
Deprecated, for removal: This API element is subject to removal in a future version. Determines whether or not the specified object is currently a child of this BeanContext. |
boolean |
containsAll |
Deprecated, for removal: This API element is subject to removal in a future version. Tests to see if all objects in the specified Collection are children of this BeanContext. |
boolean |
containsKey |
Deprecated, for removal: This API element is subject to removal in a future version. Determines whether or not the specified object is currently a child of this BeanContext. |
protected final Object[] |
copyChildren() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets a copy of the this BeanContext's children. |
protected BeanContextSupport.BCSChild |
createBCSChild |
Deprecated, for removal: This API element is subject to removal in a future version. Subclasses can override this method to insert their own subclass of Child without having to override add() or the other Collection methods that add children to the set. |
protected final void |
deserialize |
Deprecated, for removal: This API element is subject to removal in a future version. used by readObject to deserialize a collection. |
void |
dontUseGui() |
Deprecated, for removal: This API element is subject to removal in a future version. notify this instance that it may no longer render a GUI. |
protected final void |
fireChildrenAdded |
Deprecated, for removal: This API element is subject to removal in a future version. Fire a BeanContextMembershipEvent on the BeanContextMembershipListener interface |
protected final void |
fireChildrenRemoved |
Deprecated, for removal: This API element is subject to removal in a future version. Fire a BeanContextMembershipEvent on the BeanContextMembershipListener interface |
BeanContext |
getBeanContextPeer() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the instance of BeanContext that this object is providing the implementation for. |
protected static final BeanContextChild |
getChildBeanContextChild |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the BeanContextChild (if any) of the specified child |
protected static final BeanContextMembershipListener |
getChildBeanContextMembershipListener |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the BeanContextMembershipListener (if any) of the specified child |
protected static final PropertyChangeListener |
getChildPropertyChangeListener |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the PropertyChangeListener (if any) of the specified child |
protected static final Serializable |
getChildSerializable |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the Serializable (if any) associated with the specified Child |
protected static final VetoableChangeListener |
getChildVetoableChangeListener |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the VetoableChangeListener (if any) of the specified child |
protected static final Visibility |
getChildVisibility |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the Component (if any) associated with the specified child. |
Locale |
getLocale() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the locale for this BeanContext. |
URL |
getResource |
Deprecated, for removal: This API element is subject to removal in a future version. Analogous to java.lang.ClassLoader.getResource(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader. |
InputStream |
getResourceAsStream |
Deprecated, for removal: This API element is subject to removal in a future version. Analogous to java.lang.ClassLoader.getResourceAsStream(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader. |
protected void |
initialize() |
Deprecated, for removal: This API element is subject to removal in a future version. protected method called from constructor and readObject to initialize transient state of BeanContextSupport instance. |
Object |
instantiateChild |
Deprecated, for removal: This API element is subject to removal in a future version. The instantiateChild method is a convenience hook in BeanContext to simplify the task of instantiating a Bean, nested, into a BeanContext. |
boolean |
isDesignTime() |
Deprecated, for removal: This API element is subject to removal in a future version. Reports whether or not this object is in currently in design time mode. |
boolean |
isEmpty() |
Deprecated, for removal: This API element is subject to removal in a future version. Reports whether or not this BeanContext is empty. |
boolean |
isSerializing() |
Deprecated, for removal: This API element is subject to removal in a future version. Is this BeanContext in the process of being serialized? |
Iterator |
iterator() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets all JavaBean or BeanContext instances currently nested in this BeanContext. |
boolean |
needsGui() |
Deprecated, for removal: This API element is subject to removal in a future version. This method is typically called from the environment in order to determine if the implementor "needs" a GUI. |
void |
okToUseGui() |
Deprecated, for removal: This API element is subject to removal in a future version. Notify this instance that it may now render a GUI |
void |
propertyChange |
Deprecated, for removal: This API element is subject to removal in a future version. subclasses may envelope to monitor child property changes. |
final void |
readChildren |
Deprecated, for removal: This API element is subject to removal in a future version. When an instance of this class is used as a delegate for the implementation of the BeanContext protocols (and its subprotocols) there exists a 'chicken and egg' problem during deserialization |
boolean |
remove |
Deprecated, for removal: This API element is subject to removal in a future version. Removes a child from this BeanContext. |
protected boolean |
remove |
Deprecated, for removal: This API element is subject to removal in a future version. internal remove used when removal caused by unexpected setBeanContext or by remove() invocation. |
boolean |
removeAll |
Deprecated, for removal: This API element is subject to removal in a future version. remove all specified children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field |
void |
removeBeanContextMembershipListener |
Deprecated, for removal: This API element is subject to removal in a future version. Removes a BeanContextMembershipListener |
boolean |
retainAll |
Deprecated, for removal: This API element is subject to removal in a future version. retain only specified children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field |
protected final void |
serialize |
Deprecated, for removal: This API element is subject to removal in a future version. Used by writeObject to serialize a Collection. |
void |
setDesignTime |
Deprecated, for removal: This API element is subject to removal in a future version. Sets the new design time value for this BeanContext. |
void |
setLocale |
Deprecated, for removal: This API element is subject to removal in a future version. Sets the locale of this BeanContext. |
int |
size() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the number of children currently nested in this BeanContext. |
Object[] |
toArray() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets all JavaBean or BeanContext instances currently nested in this BeanContext. |
Object[] |
toArray |
Deprecated, for removal: This API element is subject to removal in a future version. Gets an array containing all children of this BeanContext that match the types contained in arry. |
protected boolean |
validatePendingAdd |
Deprecated, for removal: This API element is subject to removal in a future version. Subclasses of this class may override, or envelope, this method to add validation behavior for the BeanContext to examine child objects immediately prior to their being added to the BeanContext. |
protected boolean |
validatePendingRemove |
Deprecated, for removal: This API element is subject to removal in a future version. Subclasses of this class may override, or envelope, this method to add validation behavior for the BeanContext to examine child objects immediately prior to their being removed from the BeanContext. |
void |
vetoableChange |
Deprecated, for removal: This API element is subject to removal in a future version. subclasses may envelope to monitor veto child property changes. |
final void |
writeChildren |
Deprecated, for removal: This API element is subject to removal in a future version. Used to serialize all children of this 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, parallelStream, removeIf, spliterator, stream, toArray
protected transient HashMap<Object, BeanContextSupport.BCSChild> children
protected HashMap children field shall be synchronized on that object.protected transient ArrayList<BeanContextMembershipListener> bcmListeners
protected ArrayList bcmListeners field shall be synchronized on that object.protected Locale locale
protected boolean okToUseGui
boolean indicating if this instance may now render a GUI.protected boolean designTime
boolean indicating whether or not this object is currently in design time mode.public BeanContextSupport(BeanContext peer, Locale lcle, boolean dTime, boolean visible)
peer - The peer BeanContext we are supplying an implementation for, or null if this object is its own peerlcle - The current Locale for this BeanContext. If lcle is null, the default locale is assigned to the BeanContext instance.dTime - The initial state, true if in design mode, false if runtime.visible - The initial visibility.public BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime)
peer - The peer BeanContext we are supplying an implementation for, or null if this object is its own peerlcle - The current Locale for this BeanContext. If lcle is null, the default locale is assigned to the BeanContext instance.dtime - The initial state, true if in design mode, false if runtime.public BeanContextSupport(BeanContext peer, Locale lcle)
peer - The peer BeanContext we are supplying an implementation for, or null if this object is its own peerlcle - The current Locale for this BeanContext. If lcle is null, the default locale is assigned to the BeanContext instance.public BeanContextSupport(BeanContext peer)
peer - The peer BeanContext we are supplying an implementation for, or null if this object is its own peerpublic BeanContextSupport()
public BeanContext getBeanContextPeer()
BeanContext that this object is providing the implementation for.public Object instantiateChild(String beanName) throws IOException, ClassNotFoundException
The instantiateChild method is a convenience hook in BeanContext to simplify the task of instantiating a Bean, nested, into a BeanContext.
The semantics of the beanName parameter are defined by java.beans.Beans.instantiate.
instantiateChild in interface BeanContext
beanName - the name of the Bean to instantiate within this BeanContextIOException - if there is an I/O error when the bean is being deserializedClassNotFoundException - if the class identified by the beanName parameter is not foundpublic int size()
size in interface Collection
public boolean isEmpty()
BeanContext is empty. A BeanContext is considered empty when it contains zero nested children.isEmpty in interface Collection
true if there are no children, otherwise false
public boolean contains(Object o)
BeanContext.contains in interface Collection
o - the Object in questiontrue if this object is a child, otherwise false
public boolean containsKey(Object o)
BeanContext.o - the Object in questiontrue if this object is a child, otherwise false
public Iterator<Object> iterator()
BeanContext instances currently nested in this BeanContext.iterator in interface Collection
iterator in interface Iterable
Iterator of the nested childrenpublic Object[] toArray()
BeanContext instances currently nested in this BeanContext.toArray in interface Collection
Object, containing all of the elements in this collectionpublic Object[] toArray(Object[] arry)
BeanContext that match the types contained in arry.toArray in interface Collection
arry - The array of object types that are of interest.protected BeanContextSupport.BCSChild createBCSChild(Object targetChild, Object peer)
Subclasses can override this method to insert their own subclass of Child without having to override add() or the other Collection methods that add children to the set.
targetChild - the child to create the Child on behalf ofpeer - the peer if the tragetChild and the peer are related by an implementation of BeanContextProxypublic boolean add(Object targetChild)
BeanContext. Invoked as a side effect of java.beans.Beans.instantiate(). If the child object is not valid for adding then this method throws an IllegalStateException.
add in interface Collection
targetChild - The child objects to nest within this BeanContext
public boolean remove(Object targetChild)
remove in interface Collection
targetChild - The child objects to removetrue if an element was removed as a result of this callprotected boolean remove(Object targetChild, boolean callChildSetBC)
setBeanContext or by remove() invocation.targetChild - the JavaBean, BeanContext, or Object to be removedcallChildSetBC - used to indicate that the child should be notified that it is no longer nested in this BeanContext.public boolean containsAll(Collection c)
Collection are children of this BeanContext.containsAll in interface Collection
c - the specified Collection
true if all objects in the collection are children of this BeanContext, false if not.public boolean addAll(Collection c)
addAll in interface Collection
c - collection containing elements to be added to this collectionUnsupportedOperationException
UnsupportedOperationException - thrown unconditionally by this implementationpublic boolean removeAll(Collection c)
removeAll in interface Collection
c - collection containing elements to be removed from this collectionUnsupportedOperationException
UnsupportedOperationException - thrown unconditionally by this implementationpublic boolean retainAll(Collection c)
retainAll in interface Collection
c - collection containing elements to be retained in this collectionUnsupportedOperationException
UnsupportedOperationException - thrown unconditionally by this implementationpublic void clear()
clear in interface Collection
UnsupportedOperationException - thrown unconditionally by this implementationpublic void addBeanContextMembershipListener(BeanContextMembershipListener bcml)
addBeanContextMembershipListener in interface BeanContext
bcml - the BeanContextMembershipListener to addNullPointerException - if the argument is nullpublic void removeBeanContextMembershipListener(BeanContextMembershipListener bcml)
removeBeanContextMembershipListener in interface BeanContext
bcml - the BeanContextMembershipListener to removeNullPointerException - if the argument is nullpublic InputStream getResourceAsStream(String name, BeanContextChild bcc)
BeanContextjava.lang.ClassLoader.getResourceAsStream(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader.getResourceAsStream in interface BeanContext
name - the name of the resource requested.bcc - the child object making the request.NullPointerException - if the argument is nullpublic URL getResource(String name, BeanContextChild bcc)
BeanContextjava.lang.ClassLoader.getResource(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader.getResource in interface BeanContext
name - the name of the resource requested.bcc - the child object making the request.public void setDesignTime(boolean dTime)
BeanContext.setDesignTime in interface DesignMode
dTime - the new designTime valuepublic boolean isDesignTime()
isDesignTime in interface DesignMode
true if in design time mode, false if notpublic void setLocale(Locale newLocale) throws PropertyVetoException
newLocale - the new locale. This method call will have no effect if newLocale is null.PropertyVetoException - if the new value is rejectedpublic Locale getLocale()
BeanContext.BeanContext
public boolean needsGui()
This method is typically called from the environment in order to determine if the implementor "needs" a GUI.
The algorithm used herein tests the BeanContextPeer, and its current children to determine if they are either Containers, Components, or if they implement Visibility and return needsGui() == true.
needsGui in interface Visibility
true if the implementor needs a GUIpublic void dontUseGui()
dontUseGui in interface Visibility
public void okToUseGui()
okToUseGui in interface Visibility
public boolean avoidingGui()
BeanContext child is avoiding using its GUI.avoidingGui in interface Visibility
public boolean isSerializing()
BeanContext in the process of being serialized?true if this BeanContext is currently being serialized, otherwise false
protected Iterator<BeanContextSupport.BCSChild> bcsChildren()
BeanContext.protected void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException
oos - the ObjectOutputStream to use during serializationIOException - if serialization failedprotected void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException
ois - the ObjectInputStream to use during deserializationIOException - if deserialization failedClassNotFoundException - if needed classes are not foundprotected void childDeserializedHook(Object child, BeanContextSupport.BCSChild bcsc)
child - the newly deserialized childbcsc - the newly deserialized BCSChildprotected final void serialize(ObjectOutputStream oos, Collection<?> coll) throws IOException
oos - the ObjectOutputStream to use during serializationcoll - the Collection to serializeIOException - if serialization failedprotected final void deserialize(ObjectInputStream ois, Collection coll) throws IOException, ClassNotFoundException
ois - the ObjectInputStream to usecoll - the CollectionIOException - if deserialization failedClassNotFoundException - if needed classes are not foundpublic final void writeChildren(ObjectOutputStream oos) throws IOException
BeanContext.oos - the ObjectOutputStream to use during serializationIOException - if serialization failedpublic final void readChildren(ObjectInputStream ois) throws IOException, ClassNotFoundException
ois - the ObjectInputStream to useIOException - if deserialization failedClassNotFoundException - if needed classes are not foundpublic void vetoableChange(PropertyChangeEvent pce) throws PropertyVetoException
vetoableChange in interface VetoableChangeListener
pce - a PropertyChangeEvent object describing the event source and the property that has changed.PropertyVetoException - if the recipient wishes the property change to be rolled back.public void propertyChange(PropertyChangeEvent pce)
propertyChange in interface PropertyChangeListener
pce - A PropertyChangeEvent object describing the event source and the property that has changed.protected boolean validatePendingAdd(Object targetChild)
Subclasses of this class may override, or envelope, this method to add validation behavior for the BeanContext to examine child objects immediately prior to their being added to the BeanContext.
targetChild - the child to create the Child on behalf ofprotected boolean validatePendingRemove(Object targetChild)
Subclasses of this class may override, or envelope, this method to add validation behavior for the BeanContext to examine child objects immediately prior to their being removed from the BeanContext.
targetChild - the child to create the Child on behalf ofprotected void childJustAddedHook(Object child, BeanContextSupport.BCSChild bcsc)
child - the childbcsc - the BCSChildprotected void childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)
child - the childbcsc - the BCSChildprotected static final Visibility getChildVisibility(Object child)
child - the specified childprotected static final Serializable getChildSerializable(Object child)
child - the specified childprotected static final PropertyChangeListener getChildPropertyChangeListener(Object child)
child - the specified childprotected static final VetoableChangeListener getChildVetoableChangeListener(Object child)
child - the specified childprotected static final BeanContextMembershipListener getChildBeanContextMembershipListener(Object child)
child - the specified childprotected static final BeanContextChild getChildBeanContextChild(Object child)
child - the specified childIllegalArgumentException - if child implements both BeanContextChild and BeanContextProxyprotected final void fireChildrenAdded(BeanContextMembershipEvent bcme)
bcme - the event to fireprotected final void fireChildrenRemoved(BeanContextMembershipEvent bcme)
bcme - the event to fireprotected void initialize()
protected final Object[] copyChildren()
protected static final boolean classEquals(Class<?> first, Class<?> second)
first - the first objectsecond - the second object
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.desktop/java/beans/beancontext/BeanContextSupport.html