Class BeanContextSupport

java.lang.Object
java.beans.beancontext.BeanContextChildSupport
java.beans.beancontext.BeanContextSupport
All Implemented Interfaces:
BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, DesignMode, PropertyChangeListener, VetoableChangeListener, Visibility, Serializable, Iterable, Collection, EventListener
Direct Known Subclasses:
BeanContextServicesSupport

Deprecated, for removal: This API element is subject to removal in a future version.
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.

Since:
1.2
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected class 
    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 
    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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    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.
    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
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
    The current locale of this BeanContext.
    protected boolean
    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.

    Fields declared in interface java.beans.beancontext.BeanContext

    globalHierarchyLock

    Fields declared in interface java.beans.DesignMode

    PROPERTYNAME
  • Constructor Summary

    Constructors
    Constructor
    Description
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create an instance using with a default locale
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create an instance using the specified locale
    BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime)
    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(BeanContext peer, Locale lcle, boolean dTime, boolean visible)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Construct a BeanContextSupport instance
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(Object targetChild)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds/nests a child within this BeanContext.
    boolean
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a BeanContextMembershipListener
    boolean
    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.
    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
    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
    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
    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
    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
    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(Class<?> first, Class<?> second)
    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
    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
    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
    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
    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[]
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets a copy of the this BeanContext's children.
    createBCSChild(Object targetChild, Object peer)
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
    used by readObject to deserialize a collection.
    void
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
    Fire a BeanContextMembershipEvent on the BeanContextMembershipListener interface
    protected final void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Fire a BeanContextMembershipEvent on the BeanContextMembershipListener interface
    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
    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
    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
    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
    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
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the Component (if any) associated with the specified child.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the locale for this BeanContext.
    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.
    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
    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.
    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
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reports whether or not this BeanContext is empty.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Is this BeanContext in the process of being serialized?
    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
    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
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
    subclasses may envelope to monitor child property changes.
    final void
    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(Object targetChild)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes a child from this BeanContext.
    protected boolean
    remove(Object targetChild, boolean callChildSetBC)
    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
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes a BeanContextMembershipListener
    boolean
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
    Used by writeObject to serialize a Collection.
    void
    setDesignTime(boolean dTime)
    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(Locale newLocale)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the locale of this BeanContext.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the number of children currently nested in this BeanContext.
    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.
    toArray(Object[] arry)
    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
    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
    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
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
    Used to serialize all children of this BeanContext.

    Methods declared in class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods declared in interface java.util.Collection

    equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray

    Methods declared in interface java.lang.Iterable

    forEach
  • Field Details

    • children

      protected transient HashMap<Object, BeanContextSupport.BCSChild> 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.
    • bcmListeners

      protected transient ArrayList<BeanContextMembershipListener> 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.
    • locale

      protected Locale locale
      Deprecated, for removal: This API element is subject to removal in a future version.
      The current locale of this BeanContext.
    • okToUseGui

      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.
    • designTime

      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.
  • Constructor Details

    • BeanContextSupport

      public BeanContextSupport(BeanContext peer, Locale lcle, boolean dTime, boolean visible)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Construct a BeanContextSupport instance
      Parameters:
      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.
      See Also:
    • BeanContextSupport

      public BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create an instance using the specified Locale and design mode.
      Parameters:
      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.
      See Also:
    • BeanContextSupport

      public BeanContextSupport(BeanContext peer, Locale lcle)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create an instance using the specified locale
      Parameters:
      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.
      See Also:
    • BeanContextSupport

      public BeanContextSupport(BeanContext peer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create an instance using with a default locale
      Parameters:
      peer - The peer BeanContext we are supplying an implementation for, or null if this object is its own peer
    • BeanContextSupport

      public 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
  • Method Details

    • getBeanContextPeer

      public 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.
      Returns:
      the BeanContext instance
    • instantiateChild

      public Object instantiateChild(String beanName) throws IOException, ClassNotFoundException
      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.

      The semantics of the beanName parameter are defined by java.beans.Beans.instantiate.

      Specified by:
      instantiateChild in interface BeanContext
      Parameters:
      beanName - the name of the Bean to instantiate within this BeanContext
      Returns:
      the new object
      Throws:
      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
    • size

      public 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.
      Specified by:
      size in interface Collection
      Returns:
      number of children
    • isEmpty

      public boolean isEmpty()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Reports whether or not this BeanContext is empty. A BeanContext is considered empty when it contains zero nested children.
      Specified by:
      isEmpty in interface Collection
      Returns:
      true if there are no children, otherwise false
    • contains

      public boolean contains(Object o)
      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.
      Specified by:
      contains in interface Collection
      Parameters:
      o - the Object in question
      Returns:
      true if this object is a child, otherwise false
    • containsKey

      public boolean containsKey(Object o)
      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.
      Parameters:
      o - the Object in question
      Returns:
      true if this object is a child, otherwise false
    • iterator

      public Iterator<Object> 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.
      Specified by:
      iterator in interface Collection
      Specified by:
      iterator in interface Iterable
      Returns:
      an Iterator of the nested children
    • toArray

      public 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.
      Specified by:
      toArray in interface Collection
      Returns:
      an array, whose runtime component type is Object, containing all of the elements in this collection
    • toArray

      public Object[] toArray(Object[] arry)
      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.
      Specified by:
      toArray in interface Collection
      Parameters:
      arry - The array of object types that are of interest.
      Returns:
      an array of children
    • createBCSChild

      protected BeanContextSupport.BCSChild createBCSChild(Object targetChild, Object peer)
      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.

      Parameters:
      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
      Returns:
      Subtype-specific subclass of Child without overriding collection methods
    • add

      public boolean add(Object targetChild)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.

      Specified by:
      add in interface Collection
      Parameters:
      targetChild - The child objects to nest within this BeanContext
      Returns:
      true if the child was added successfully.
      See Also:
    • remove

      public boolean remove(Object targetChild)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes a child from this BeanContext. If the child object is not for adding then this method throws an IllegalStateException.
      Specified by:
      remove in interface Collection
      Parameters:
      targetChild - The child objects to remove
      Returns:
      true if an element was removed as a result of this call
      See Also:
    • remove

      protected boolean remove(Object targetChild, boolean callChildSetBC)
      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.
      Parameters:
      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.
      Returns:
      whether or not was present before being removed
    • containsAll

      public boolean containsAll(Collection c)
      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.
      Specified by:
      containsAll in interface Collection
      Parameters:
      c - the specified Collection
      Returns:
      true if all objects in the collection are children of this BeanContext, false if not.
      See Also:
    • addAll

      public boolean addAll(Collection c)
      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
      Specified by:
      addAll in interface Collection
      Parameters:
      c - collection containing elements to be added to this collection
      Returns:
      this implementation unconditionally throws UnsupportedOperationException
      Throws:
      UnsupportedOperationException - thrown unconditionally by this implementation
      See Also:
    • removeAll

      public boolean removeAll(Collection c)
      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
      Specified by:
      removeAll in interface Collection
      Parameters:
      c - collection containing elements to be removed from this collection
      Returns:
      this implementation unconditionally throws UnsupportedOperationException
      Throws:
      UnsupportedOperationException - thrown unconditionally by this implementation
      See Also:
    • retainAll

      public boolean retainAll(Collection c)
      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
      Specified by:
      retainAll in interface Collection
      Parameters:
      c - collection containing elements to be retained in this collection
      Returns:
      this implementation unconditionally throws UnsupportedOperationException
      Throws:
      UnsupportedOperationException - thrown unconditionally by this implementation
      See Also:
    • clear

      public 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
      Specified by:
      clear in interface Collection
      Throws:
      UnsupportedOperationException - thrown unconditionally by this implementation
    • addBeanContextMembershipListener

      public void addBeanContextMembershipListener(BeanContextMembershipListener bcml)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a BeanContextMembershipListener
      Specified by:
      addBeanContextMembershipListener in interface BeanContext
      Parameters:
      bcml - the BeanContextMembershipListener to add
      Throws:
      NullPointerException - if the argument is null
    • removeBeanContextMembershipListener

      public void removeBeanContextMembershipListener(BeanContextMembershipListener bcml)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes a BeanContextMembershipListener
      Specified by:
      removeBeanContextMembershipListener in interface BeanContext
      Parameters:
      bcml - the BeanContextMembershipListener to remove
      Throws:
      NullPointerException - if the argument is null
    • getResourceAsStream

      public InputStream getResourceAsStream(String name, BeanContextChild bcc)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: BeanContext
      Analogous to java.lang.ClassLoader.getResourceAsStream(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader.
      Specified by:
      getResourceAsStream in interface BeanContext
      Parameters:
      name - the name of the resource requested.
      bcc - the child object making the request.
      Returns:
      the requested resource as an InputStream
      Throws:
      NullPointerException - if the argument is null
    • getResource

      public URL getResource(String name, BeanContextChild bcc)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: BeanContext
      Analogous to java.lang.ClassLoader.getResource(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader.
      Specified by:
      getResource in interface BeanContext
      Parameters:
      name - the name of the resource requested.
      bcc - the child object making the request.
      Returns:
      the requested resource as an InputStream
    • setDesignTime

      public void setDesignTime(boolean dTime)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the new design time value for this BeanContext.
      Specified by:
      setDesignTime in interface DesignMode
      Parameters:
      dTime - the new designTime value
      See Also:
    • isDesignTime

      public 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.
      Specified by:
      isDesignTime in interface DesignMode
      Returns:
      true if in design time mode, false if not
    • setLocale

      public void setLocale(Locale newLocale) throws PropertyVetoException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the locale of this BeanContext.
      Parameters:
      newLocale - the new locale. This method call will have no effect if newLocale is null.
      Throws:
      PropertyVetoException - if the new value is rejected
    • getLocale

      public Locale getLocale()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the locale for this BeanContext.
      Returns:
      the current Locale of the BeanContext
    • needsGui

      public 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.

      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.

      Specified by:
      needsGui in interface Visibility
      Returns:
      true if the implementor needs a GUI
    • dontUseGui

      public 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.
      Specified by:
      dontUseGui in interface Visibility
    • okToUseGui

      public 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
      Specified by:
      okToUseGui in interface Visibility
    • avoidingGui

      public 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.
      Specified by:
      avoidingGui in interface Visibility
      Returns:
      is this instance avoiding using its GUI?
      See Also:
    • isSerializing

      public 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?
      Returns:
      true if this BeanContext is currently being serialized, otherwise false
    • bcsChildren

      protected Iterator<BeanContextSupport.BCSChild> bcsChildren()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns an iterator of all children of this BeanContext.
      Returns:
      an iterator for all the current BCSChild values
    • bcsPreSerializationHook

      protected void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException
      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. 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().
      Parameters:
      oos - the ObjectOutputStream to use during serialization
      Throws:
      IOException - if serialization failed
    • bcsPreDeserializationHook

      protected void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException
      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. 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().
      Parameters:
      ois - the ObjectInputStream to use during deserialization
      Throws:
      IOException - if deserialization failed
      ClassNotFoundException - if needed classes are not found
    • childDeserializedHook

      protected void childDeserializedHook(Object child, BeanContextSupport.BCSChild bcsc)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Called by readObject with the newly deserialized child and BCSChild.
      Parameters:
      child - the newly deserialized child
      bcsc - the newly deserialized BCSChild
    • serialize

      protected final void serialize(ObjectOutputStream oos, Collection<?> coll) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Used by writeObject to serialize a Collection.
      Parameters:
      oos - the ObjectOutputStream to use during serialization
      coll - the Collection to serialize
      Throws:
      IOException - if serialization failed
    • deserialize

      protected final void deserialize(ObjectInputStream ois, Collection coll) throws IOException, ClassNotFoundException
      Deprecated, for removal: This API element is subject to removal in a future version.
      used by readObject to deserialize a collection.
      Parameters:
      ois - the ObjectInputStream to use
      coll - the Collection
      Throws:
      IOException - if deserialization failed
      ClassNotFoundException - if needed classes are not found
    • writeChildren

      public final void writeChildren(ObjectOutputStream oos) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Used to serialize all children of this BeanContext.
      Parameters:
      oos - the ObjectOutputStream to use during serialization
      Throws:
      IOException - if serialization failed
    • readChildren

      public final void readChildren(ObjectInputStream ois) throws IOException, ClassNotFoundException
      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
      Parameters:
      ois - the ObjectInputStream to use
      Throws:
      IOException - if deserialization failed
      ClassNotFoundException - if needed classes are not found
    • vetoableChange

      public void vetoableChange(PropertyChangeEvent pce) throws PropertyVetoException
      Deprecated, for removal: This API element is subject to removal in a future version.
      subclasses may envelope to monitor veto child property changes.
      Specified by:
      vetoableChange in interface VetoableChangeListener
      Parameters:
      pce - a PropertyChangeEvent object describing the event source and the property that has changed.
      Throws:
      PropertyVetoException - if the recipient wishes the property change to be rolled back.
    • propertyChange

      public void propertyChange(PropertyChangeEvent pce)
      Deprecated, for removal: This API element is subject to removal in a future version.
      subclasses may envelope to monitor child property changes.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      pce - A PropertyChangeEvent object describing the event source and the property that has changed.
    • validatePendingAdd

      protected boolean validatePendingAdd(Object targetChild)
      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.

      Parameters:
      targetChild - the child to create the Child on behalf of
      Returns:
      true iff the child may be added to this BeanContext, otherwise false.
    • validatePendingRemove

      protected boolean validatePendingRemove(Object targetChild)
      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.

      Parameters:
      targetChild - the child to create the Child on behalf of
      Returns:
      true iff the child may be removed from this BeanContext, otherwise false.
    • childJustAddedHook

      protected void childJustAddedHook(Object child, BeanContextSupport.BCSChild bcsc)
      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. The method is called with the child synchronized.
      Parameters:
      child - the child
      bcsc - the BCSChild
    • childJustRemovedHook

      protected void childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)
      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. The method is called with the child synchronized.
      Parameters:
      child - the child
      bcsc - the BCSChild
    • getChildVisibility

      protected static final Visibility getChildVisibility(Object child)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the Component (if any) associated with the specified child.
      Parameters:
      child - the specified child
      Returns:
      the Component (if any) associated with the specified child.
    • getChildSerializable

      protected static final Serializable getChildSerializable(Object child)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the Serializable (if any) associated with the specified Child
      Parameters:
      child - the specified child
      Returns:
      the Serializable (if any) associated with the specified Child
    • getChildPropertyChangeListener

      protected static final PropertyChangeListener getChildPropertyChangeListener(Object child)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the PropertyChangeListener (if any) of the specified child
      Parameters:
      child - the specified child
      Returns:
      the PropertyChangeListener (if any) of the specified child
    • getChildVetoableChangeListener

      protected static final VetoableChangeListener getChildVetoableChangeListener(Object child)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the VetoableChangeListener (if any) of the specified child
      Parameters:
      child - the specified child
      Returns:
      the VetoableChangeListener (if any) of the specified child
    • getChildBeanContextMembershipListener

      protected static final BeanContextMembershipListener getChildBeanContextMembershipListener(Object child)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the BeanContextMembershipListener (if any) of the specified child
      Parameters:
      child - the specified child
      Returns:
      the BeanContextMembershipListener (if any) of the specified child
    • getChildBeanContextChild

      protected static final BeanContextChild getChildBeanContextChild(Object child)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the BeanContextChild (if any) of the specified child
      Parameters:
      child - the specified child
      Returns:
      the BeanContextChild (if any) of the specified child
      Throws:
      IllegalArgumentException - if child implements both BeanContextChild and BeanContextProxy
    • fireChildrenAdded

      protected final void fireChildrenAdded(BeanContextMembershipEvent bcme)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Fire a BeanContextMembershipEvent on the BeanContextMembershipListener interface
      Parameters:
      bcme - the event to fire
    • fireChildrenRemoved

      protected final void fireChildrenRemoved(BeanContextMembershipEvent bcme)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Fire a BeanContextMembershipEvent on the BeanContextMembershipListener interface
      Parameters:
      bcme - the event to fire
    • initialize

      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. 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
    • copyChildren

      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.
      Returns:
      a copy of the current nested children
    • classEquals

      protected static final boolean classEquals(Class<?> first, Class<?> second)
      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.
      Parameters:
      first - the first object
      second - the second object
      Returns:
      true if equal, false if not