| public class java.beans.beancontext BeanContextSupport
|
Java SE 6 |
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.
| version | 1.46, 01/13/03 |
| since | 1.2 |
| Fields | |
|---|---|
| protected HashMap | children all accesses to the protected HashMap children field
shall be synchronized on that object.
|
| protected ArrayList | bcmListeners all accesses to the protected ArrayList bcmListeners field
shall be synchronized on that object.
|
| protected Locale | locale The current locale of this BeanContext. |
| protected boolean | okToUseGui A boolean indicating if this instance may now render a GUI. |
| protected boolean | designTime A boolean indicating whether or not this object is currently in design time mode. |
| Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public | BeanContextSupport(BeanContext peer, Locale lcle, boolean dTime, boolean visible) Details
Construct a BeanContextSupport instance
| ||||||||||
| public | BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime) Details
Create an instance using the specified Locale and design mode.
| ||||||||||
| public | BeanContextSupport(BeanContext peer, Locale lcle) Details
Create an instance using the specified locale
| ||||||||||
| public | BeanContextSupport(BeanContext peer) Details
Create an instance using with a default locale
| ||||||||||
| public | BeanContextSupport() Create an instance that is not a delegate of another object | ||||||||||
| Methods | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| public boolean | add(Object targetChild) Details
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.
| ||||||||
| public boolean | addAll(Collection c) Details
add Collection to set of Children (Unsupported)
implementations must synchronized on the hierarchy lock and "children" protected field
| ||||||||
| public void | addBeanContextMembershipListener(BeanContextMembershipListener bcml) Details
Adds a BeanContextMembershipListener
| ||||||||
| public boolean | avoidingGui() Details
Used to determine if the BeanContext
child is avoiding using its GUI.
| ||||||||
| protected Iterator | bcsChildren() Details
Returns an iterator of all children
of this BeanContext.
| ||||||||
| protected void | bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException 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(). | ||||||||
| protected void | bcsPreSerializationHook(ObjectOutputStream oos) throws IOException 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(). | ||||||||
| protected void | childDeserializedHook(Object child, BeanContextSupport.BCSChild bcsc) Details
Called by readObject with the newly deserialized child and BCSChild.
| ||||||||
| protected void | childJustAddedHook(Object child, BeanContextSupport.BCSChild bcsc) 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. | ||||||||
| protected void | childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc) 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. | ||||||||
| final protected static boolean | classEquals(Class first, Class second) Details
Tests to see if two class objects,
or their names are equal.
| ||||||||
| public void | clear() Details
clear the children (Unsupported)
implementations must synchronized on the hierarchy lock and "children" protected field
| ||||||||
| public boolean | contains(Object o) Details
Determines whether or not the specified object
is currently a child of this BeanContext.
| ||||||||
| public boolean | containsAll(Collection c) Details
Tests to see if all objects in the
specified Collection are children of
this BeanContext.
| ||||||||
| public boolean | containsKey(Object o) Details
Determines whether or not the specified object
is currently a child of this BeanContext.
| ||||||||
| final protected Object[] | copyChildren() Details
Gets a copy of the this BeanContext's children.
| ||||||||
| protected BeanContextSupport.BCSChild | createBCSChild(Object targetChild, Object peer) Details
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.
| ||||||||
| final protected void | deserialize(ObjectInputStream ois, Collection coll) throws IOException, ClassNotFoundException Details
used by readObject to deserialize a collection.
| ||||||||
| public void | dontUseGui() notify this instance that it may no longer render a GUI. | ||||||||
| final protected void | fireChildrenAdded(BeanContextMembershipEvent bcme) Fire a BeanContextshipEvent on the BeanContextMembershipListener interface | ||||||||
| final protected void | fireChildrenRemoved(BeanContextMembershipEvent bcme) Fire a BeanContextshipEvent on the BeanContextMembershipListener interface | ||||||||
| protected void | initialize() 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 | ||||||||
| public Object | instantiateChild(String beanName) throws IOException, ClassNotFoundException Details
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.
| ||||||||
| public Iterator | iterator() Details
Gets all JavaBean or BeanContext instances
currently nested in this BeanContext.
| ||||||||
| public boolean | needsGui() Details
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.
| ||||||||
| public void | okToUseGui() Notify this instance that it may now render a GUI | ||||||||
| public void | propertyChange(PropertyChangeEvent pce) subclasses may envelope to monitor child property changes. | ||||||||
| final public void | readChildren(ObjectInputStream ois) throws IOException, ClassNotFoundException 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 | ||||||||
| public boolean | remove(Object targetChild) Details
Removes a child from this BeanContext. If the child object is not
for adding then this method throws an IllegalStateException.
| ||||||||
| protected boolean | remove(Object targetChild, boolean callChildSetBC) Details
internal remove used when removal caused by
unexpected setBeanContext or
by remove() invocation.
| ||||||||
| public boolean | removeAll(Collection c) Details
remove all specified children (Unsupported)
implementations must synchronized on the hierarchy lock and "children" protected field
| ||||||||
| public void | removeBeanContextMembershipListener(BeanContextMembershipListener bcml) Details
Removes a BeanContextMembershipListener
| ||||||||
| public boolean | retainAll(Collection c) Details
retain only specified children (Unsupported)
implementations must synchronized on the hierarchy lock and "children" protected field
| ||||||||
| final protected void | serialize(ObjectOutputStream oos, Collection coll) throws IOException Details
Used by writeObject to serialize a Collection.
| ||||||||
| public int | size() Details
Gets the number of children currently nested in
this BeanContext.
| ||||||||
| public Object[] | toArray() Gets all JavaBean or BeanContext instances currently nested in this BeanContext. | ||||||||
| public Object[] | toArray(Object[] arry) Details
Gets an array containing all children of
this BeanContext that match
the types contained in arry.
| ||||||||
| protected boolean | validatePendingAdd(Object targetChild) Details
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(Object targetChild) Details
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.
| ||||||||
| public void | vetoableChange(PropertyChangeEvent pce) throws PropertyVetoException subclasses may envelope to monitor veto child property changes. | ||||||||
| final public void | writeChildren(ObjectOutputStream oos) throws IOException Details
Used to serialize all children of
this BeanContext.
| ||||||||
| Properties | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| public BeanContext | getBeanContextPeer() Details
Gets the instance of BeanContext that
this object is providing the implementation for.
| ||||||||
| final protected static BeanContextChild | getChildBeanContextChild(Object child) Details
Gets the BeanContextChild (if any) of the specified child
| ||||||||
| final protected static BeanContextMembershipListener | getChildBeanContextMembershipListener(Object child) Details
Gets the BeanContextMembershipListener
(if any) of the specified child
| ||||||||
| final protected static PropertyChangeListener | getChildPropertyChangeListener(Object child) Details
Gets the PropertyChangeListener
(if any) of the specified child
| ||||||||
| final protected static Serializable | getChildSerializable(Object child) Details
Gets the Serializable (if any) associated with the specified Child
| ||||||||
| final protected static VetoableChangeListener | getChildVetoableChangeListener(Object child) Details
Gets the VetoableChangeListener
(if any) of the specified child
| ||||||||
| final protected static Visibility | getChildVisibility(Object child) Details
Gets the Component (if any) associated with the specified child.
| ||||||||
| public void | setDesignTime(boolean dTime) Details
Sets the new design time value for this BeanContext.
| ||||||||
| public boolean | isDesignTime() Details
Reports whether or not this object is in
currently in design time mode.
| ||||||||
| public boolean | isEmpty() Details
Reports whether or not this
BeanContext is empty.
A BeanContext is considered
empty when it contains zero
nested children.
| ||||||||
| public void | setLocale(Locale newLocale) throws PropertyVetoException Details
Sets the locale of this BeanContext.
| ||||||||
| public Locale | getLocale() Details
Gets the locale for this BeanContext.
| ||||||||
| public URL | getResource(String name, BeanContextChild bcc) Details
| ||||||||
| public InputStream | getResourceAsStream(String name, BeanContextChild bcc) Details
| ||||||||
| public boolean | isSerializing() Details
Is this BeanContext in the
process of being serialized?
| ||||||||
| About DocWeb · Bundles · Export · Export All | Top 10 · Statistics · Login |
| About Sun · Contact · Privacy · Terms of Use · Trademarks | Java SE 6 · Copyright © 1994-2013 Sun Microsystems, Inc.All rights reserved. Use is subject to license terms |
![]() |
![]() |
|