java.lang.Object | ||
↳ | java.beans.beancontext.BeanContextChildSupport | |
↳ | java.beans.beancontext.BeanContextSupport |
Known Direct Subclasses |
This helper class provides a utility implementation of the java.beans.beancontext.BeanContext interface.
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.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BeanContextSupport.BCSChild | |||||||||||
BeanContextSupport.BCSIterator | protected final subclass that encapsulates an iterator but implements a noop remove() method. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
java.beans.DesignMode
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
bcmListeners | all accesses to the protected ArrayList bcmListeners field
shall be synchronized on that object. |
||||||||||
children | all accesses to the protected HashMap children field
shall be synchronized on that object. |
||||||||||
designTime | A boolean indicating whether or not this object is currently in design time mode. | ||||||||||
locale | The current locale of this BeanContext. | ||||||||||
okToUseGui | A boolean indicating if this instance may now render a GUI. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.beans.beancontext.BeanContextChildSupport
| |||||||||||
From interface
java.beans.beancontext.BeanContext
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct a BeanContextSupport instance
| |||||||||||
Create an instance using the specified Locale and design mode.
| |||||||||||
Create an instance using the specified locale
| |||||||||||
Create an instance using with a default locale
| |||||||||||
Create an instance that is not a delegate of another object
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds/nests a child within this BeanContext.
| |||||||||||
add Collection to set of Children (Unsupported)
implementations must synchronized on the hierarchy lock and "children" protected field
| |||||||||||
Adds a BeanContextMembershipListener
| |||||||||||
Used to determine if the BeanContext
child is avoiding using its GUI.
| |||||||||||
clear the children (Unsupported)
implementations must synchronized on the hierarchy lock and "children" protected field
| |||||||||||
Determines whether or not the specified object
is currently a child of this BeanContext.
| |||||||||||
Tests to see if all objects in the
specified Collection are children of
this BeanContext.
| |||||||||||
Determines whether or not the specified object
is currently a child of this BeanContext.
| |||||||||||
notify this instance that it may no longer render a GUI.
| |||||||||||
Gets the instance of BeanContext that
this object is providing the implementation for.
| |||||||||||
Gets the locale for this BeanContext.
| |||||||||||
Analagous to
java.lang.ClassLoader.getResource() , this
method allows a BeanContext implementation to interpose
behavior between the child Component
and underlying ClassLoader . | |||||||||||
Analagous to
java.lang.ClassLoader.getResourceAsStream() ,
this method allows a BeanContext implementation
to interpose behavior between the child Component
and underlying ClassLoader . | |||||||||||
The instantiateChild method is a convenience hook in BeanContext to simplify the task of instantiating a Bean, nested, into a BeanContext. | |||||||||||
Reports whether or not this object is in
currently in design time mode.
| |||||||||||
Reports whether or not this
BeanContext is empty.
| |||||||||||
Is this BeanContext in the
process of being serialized?
| |||||||||||
Gets all JavaBean or BeanContext instances
currently nested in this BeanContext.
| |||||||||||
This method is typically called from the environment in order to determine if the implementor "needs" a GUI. | |||||||||||
Notify this instance that it may now render a GUI
| |||||||||||
subclasses may envelope to monitor child property changes.
| |||||||||||
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
| |||||||||||
Removes a child from this BeanContext.
| |||||||||||
remove all specified children (Unsupported)
implementations must synchronized on the hierarchy lock and "children" protected field
| |||||||||||
Removes a BeanContextMembershipListener
| |||||||||||
retain only specified children (Unsupported)
implementations must synchronized on the hierarchy lock and "children" protected field
| |||||||||||
Sets the new design time value for this BeanContext.
| |||||||||||
Sets the locale of this BeanContext.
| |||||||||||
Gets the number of children currently nested in
this BeanContext.
| |||||||||||
Gets an array containing all children of
this BeanContext that match
the types contained in arry.
| |||||||||||
Gets all JavaBean or BeanContext
instances currently nested in this BeanContext.
| |||||||||||
subclasses may envelope to monitor veto child property changes.
| |||||||||||
Used to serialize all children of
this BeanContext.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an iterator of all children
of this BeanContext.
| |||||||||||
called by readObject after defaultReadObject() but prior to
deserialization of any children.
| |||||||||||
called by writeObject after defaultWriteObject() but prior to
serialization of currently serializable children.
| |||||||||||
Called by readObject with the newly deserialized child and BCSChild.
| |||||||||||
subclasses may override this method to simply extend add() semantics
after the child has been added and before the event notification has
occurred.
| |||||||||||
subclasses may override this method to simply extend remove() semantics
after the child has been removed and before the event notification has
occurred.
| |||||||||||
Tests to see if two class objects,
or their names are equal.
| |||||||||||
Gets a copy of the this BeanContext's children.
| |||||||||||
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. | |||||||||||
used by readObject to deserialize a collection.
| |||||||||||
Fire a BeanContextshipEvent on the BeanContextMembershipListener interface
| |||||||||||
Fire a BeanContextshipEvent on the BeanContextMembershipListener interface
| |||||||||||
Gets the BeanContextChild (if any) of the specified child
| |||||||||||
Gets the BeanContextMembershipListener
(if any) of the specified child
| |||||||||||
Gets the PropertyChangeListener
(if any) of the specified child
| |||||||||||
Gets the Serializable (if any) associated with the specified Child
| |||||||||||
Gets the VetoableChangeListener
(if any) of the specified child
| |||||||||||
Gets the Component (if any) associated with the specified child.
| |||||||||||
protected method called from constructor and readObject to initialize
transient state of BeanContextSupport instance.
| |||||||||||
internal remove used when removal caused by
unexpected setBeanContext or
by remove() invocation.
| |||||||||||
Used by writeObject to serialize a Collection.
| |||||||||||
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. | |||||||||||
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. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.beans.beancontext.BeanContextChildSupport
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.beans.DesignMode
| |||||||||||
From interface
java.beans.PropertyChangeListener
| |||||||||||
From interface
java.beans.VetoableChangeListener
| |||||||||||
From interface
java.beans.Visibility
| |||||||||||
From interface
java.beans.beancontext.BeanContext
| |||||||||||
From interface
java.beans.beancontext.BeanContextChild
| |||||||||||
From interface
java.beans.beancontext.BeanContextServiceRevokedListener
| |||||||||||
From interface
java.beans.beancontext.BeanContextServicesListener
| |||||||||||
From interface
java.lang.Iterable
| |||||||||||
From interface
java.util.Collection
|
all accesses to the protected ArrayList bcmListeners
field
shall be synchronized on that object.
all accesses to the protected HashMap children
field
shall be synchronized on that object.
A boolean indicating whether or not this object is currently in design time mode.
A boolean indicating if this instance may now render a GUI.
Construct a BeanContextSupport instance
peer | The peer BeanContext we are supplying an implementation for, or null if this object is its own peer |
---|---|
lcle | 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. |
Create an instance using the specified Locale and design mode.
peer | The peer BeanContext we are supplying an implementation for, or null if this object is its own peer |
---|---|
lcle | 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. |
Create an instance using the specified locale
peer | The peer BeanContext we are supplying an implementation for, or null if this object is its own peer |
---|---|
lcle | The current Locale for this BeanContext. If lcle is null, the default locale is assigned to the BeanContext instance. |
Create an instance using with a default locale
peer | The peer BeanContext we are supplying an implementation for, or null if this object is its own peer |
---|
Create an instance that is not a delegate of another object
Adds/nests a child within this 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.
targetChild | The child objects to nest within this BeanContext |
---|
add Collection to set of Children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field
Adds a BeanContextMembershipListener
bcml | the BeanContextMembershipListener to add |
---|
NullPointerException |
---|
Used to determine if the BeanContext child is avoiding using its GUI.
clear the children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field
Determines whether or not the specified object is currently a child of this BeanContext.
o | the Object in question |
---|
Tests to see if all objects in the specified Collection are children of this BeanContext.
c | the specified Collection |
---|
Determines whether or not the specified object is currently a child of this BeanContext.
o | the Object in question |
---|
notify this instance that it may no longer render a GUI.
Gets the instance of BeanContext that this object is providing the implementation for.
Gets the locale for this BeanContext.
Analagous to java.lang.ClassLoader.getResource()
, this
method allows a BeanContext
implementation to interpose
behavior between the child Component
and underlying ClassLoader
.
name | the name of the resource requested. |
---|---|
bcc | the child object making the request. |
Analagous to java.lang.ClassLoader.getResourceAsStream()
,
this method allows a BeanContext
implementation
to interpose behavior between the child Component
and underlying ClassLoader
.
name | the name of the resource requested. |
---|---|
bcc | the child object making the request. |
NullPointerException |
---|
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.instantate.
beanName | the name of the Bean to instantiate within this BeanContext |
---|
IOException | if there is an I/O error when the bean is being deserialized |
---|---|
ClassNotFoundException | if the class identified by the beanName parameter is not found |
Reports whether or not this object is in currently in design time mode.
Reports whether or not this BeanContext is empty. A BeanContext is considered empty when it contains zero nested children.
Is this BeanContext in the process of being serialized?
Gets all JavaBean or BeanContext instances currently nested in this BeanContext.
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.
Notify this instance that it may now render a GUI
subclasses may envelope to monitor child property changes.
pce | A PropertyChangeEvent object describing the event source and the property that has changed. |
---|
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
Removes a child from this BeanContext. If the child object is not for adding then this method throws an IllegalStateException.
targetChild | The child objects to remove |
---|
remove all specified children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field
Removes a BeanContextMembershipListener
bcml | the BeanContextMembershipListener to remove |
---|
NullPointerException |
---|
retain only specified children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field
Sets the new design time value for this BeanContext.
dTime | the new designTime value |
---|
Sets the locale of this BeanContext.
newLocale | the new locale. This method call will have
no effect if newLocale is null . |
---|
PropertyVetoException | if the new value is rejected |
---|
Gets the number of children currently nested in this BeanContext.
Gets an array containing all children of this BeanContext that match the types contained in arry.
arry | The array of object types that are of interest. |
---|
Gets all JavaBean or BeanContext instances currently nested in this BeanContext.
subclasses may envelope to monitor veto child property changes.
pce | a PropertyChangeEvent object describing the
event source and the property that has changed. |
---|
PropertyVetoException |
---|
Used to serialize all children of this BeanContext.
oos | the ObjectOutputStream to use during serialization |
---|
IOException | if serialization failed |
---|
Returns an iterator of all children of this BeanContext.
called by readObject after defaultReadObject() but prior to deserialization of any children. This method may be overridden by subclasses to perform custom deserialization of their state prior to this superclass deserializing the children. This method should not however be used by subclasses to replace their own implementation (if any) of readObject().
called by writeObject after defaultWriteObject() but prior to serialization of currently serializable children. This method may be overridden by subclasses to perform custom serialization of their state prior to this superclass serializing the children. This method should not however be used by subclasses to replace their own implementation (if any) of writeObject().
IOException |
---|
Called by readObject with the newly deserialized child and BCSChild.
child | the newly deserialized child |
---|---|
bcsc | the newly deserialized BCSChild |
subclasses may override this method to simply extend add() semantics after the child has been added and before the event notification has occurred. The method is called with the child synchronized.
subclasses may override this method to simply extend remove() semantics after the child has been removed and before the event notification has occurred. The method is called with the child synchronized.
Tests to see if two class objects, or their names are equal.
first | the first object |
---|---|
second | the second object |
Gets a copy of the this BeanContext's children.
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 of |
---|---|
peer | the peer if the tragetChild and the peer are related by an implementation of BeanContextProxy |
used by readObject to deserialize a collection.
ois | the ObjectInputStream to use |
---|---|
coll | the Collection |
Fire a BeanContextshipEvent on the BeanContextMembershipListener interface
Fire a BeanContextshipEvent on the BeanContextMembershipListener interface
Gets the BeanContextChild (if any) of the specified child
child | the specified child |
---|
IllegalArgumentException | if child implements both BeanContextChild and BeanContextProxy |
---|
Gets the BeanContextMembershipListener (if any) of the specified child
child | the specified child |
---|
Gets the PropertyChangeListener (if any) of the specified child
child | the specified child |
---|
Gets the Serializable (if any) associated with the specified Child
child | the specified child |
---|
Gets the VetoableChangeListener (if any) of the specified child
child | the specified child |
---|
Gets the Component (if any) associated with the specified child.
child | the specified child |
---|
protected method called from constructor and readObject to initialize transient state of BeanContextSupport instance. This class uses this method to instantiate inner class listeners used to monitor PropertyChange and VetoableChange events on children. subclasses may envelope this method to add their own initialization behavior
internal remove used when removal caused by unexpected setBeanContext or by remove() invocation.
targetChild | the JavaBean, BeanContext, or Object to be removed |
---|---|
callChildSetBC | used to indicate that the child should be notified that it is no longer nested in this BeanContext. |
Used by writeObject to serialize a Collection.
oos | the ObjectOutputStream to use during serialization |
---|---|
coll | the Collection to serialize |
IOException | if serialization failed |
---|
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.
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.