Interface BeanContext

All Superinterfaces:
BeanContextChild, Collection, DesignMode, Iterable, Visibility
All Known Subinterfaces:
BeanContextServices
All Known Implementing Classes:
BeanContextServicesSupport, BeanContextSupport

@Deprecated(since="23", forRemoval=true) public interface BeanContext extends BeanContextChild, Collection, DesignMode, Visibility
Deprecated, for removal: This API element is subject to removal in a future version.

The BeanContext acts a logical hierarchical container for JavaBeans.

Since:
1.2
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Object
    Deprecated, for removal: This API element is subject to removal in a future version.
    This global lock is used by both BeanContext and BeanContextServices implementors to serialize changes in a BeanContext hierarchy and any service requests etc.

    Fields declared in interface DesignMode

    PROPERTYNAME
    Modifier and Type
    Field
    Description
    static final String
    The standard value of the propertyName as fired from a BeanContext or other source of PropertyChangeEvents.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds the specified BeanContextMembershipListener to receive BeanContextMembershipEvents from this BeanContext whenever it adds or removes a child Component(s).
    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.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Instantiate the javaBean named as a child of this BeanContext.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes the specified BeanContextMembershipListener so that it no longer receives BeanContextMembershipEvents when the child Component(s) are added or removed.

    Methods declared in interface BeanContextChild

    addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext
    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a PropertyChangeListener to this BeanContextChild in order to receive a PropertyChangeEvent whenever the specified property has changed.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Adds a VetoableChangeListener to this BeanContextChild to receive events whenever the specified property changes.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the BeanContext associated with this BeanContextChild.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes a PropertyChangeListener from this BeanContextChild so that it no longer receives PropertyChangeEvents when the specified property is changed.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Removes a VetoableChangeListener from this BeanContextChild so that it no longer receives events when the specified property changes.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Objects that implement this interface, shall fire a java.beans.PropertyChangeEvent, with parameters: propertyName "beanContext", oldValue (the previous nesting BeanContext instance, or null), newValue (the current nesting BeanContext instance, or null).

    Methods declared in interface Collection

    add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
    Modifier and Type
    Method
    Description
    boolean
    Ensures that this collection contains the specified element (optional operation).
    boolean
    Adds all of the elements in the specified collection to this collection (optional operation).
    void
    Removes all of the elements from this collection (optional operation).
    boolean
    Returns true if this collection contains the specified element.
    boolean
    Returns true if this collection contains all of the elements in the specified collection.
    boolean
    Compares the specified object with this collection for equality.
    int
    Returns the hash code value for this collection.
    boolean
    Returns true if this collection contains no elements.
    Returns an iterator over the elements in this collection.
    default Stream
    Returns a possibly parallel Stream with this collection as its source.
    boolean
    Removes a single instance of the specified element from this collection, if it is present (optional operation).
    boolean
    Removes all of this collection's elements that are also contained in the specified collection (optional operation).
    default boolean
    Removes all of the elements of this collection that satisfy the given predicate (optional operation).
    boolean
    Retains only the elements in this collection that are contained in the specified collection (optional operation).
    int
    Returns the number of elements in this collection.
    default Spliterator
    Creates a Spliterator over the elements in this collection.
    default Stream
    Returns a sequential Stream with this collection as its source.
    Returns an array containing all of the elements in this collection.
    default <T> Object[]
    toArray(IntFunction generator)
    Returns an array containing all of the elements in this collection, using the provided generator function to allocate the returned array.
    <T> Object[]
    Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.

    Methods declared in interface DesignMode

    isDesignTime, setDesignTime
    Modifier and Type
    Method
    Description
    boolean
    A value of true denotes that JavaBeans should behave in design time mode, a value of false denotes runtime behavior.
    void
    setDesignTime(boolean designTime)
    Sets the "value" of the "designTime" property.

    Methods declared in interface Iterable

    forEach
    Modifier and Type
    Method
    Description
    default void
    forEach(Consumer action)
    Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.

    Methods declared in interface Visibility

    avoidingGui, dontUseGui, needsGui, okToUseGui
    Modifier and Type
    Method
    Description
    boolean
    Determines whether this bean is avoiding using a GUI.
    void
    This method instructs the bean that it should not use the Gui.
    boolean
    Determines whether this bean needs a GUI.
    void
    This method instructs the bean that it is OK to use the Gui.
  • Field Details

    • globalHierarchyLock

      static final Object globalHierarchyLock
      Deprecated, for removal: This API element is subject to removal in a future version.
      This global lock is used by both BeanContext and BeanContextServices implementors to serialize changes in a BeanContext hierarchy and any service requests etc.
  • Method Details

    • instantiateChild

      Object instantiateChild(String beanName) throws IOException, ClassNotFoundException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Instantiate the javaBean named as a child of this BeanContext. The implementation of the JavaBean is derived from the value of the beanName parameter, and is defined by the java.beans.Beans.instantiate() method.
      Parameters:
      beanName - The name of the JavaBean to instantiate as a child of this BeanContext
      Returns:
      a javaBean named as a child of this BeanContext
      Throws:
      IOException - if an IO problem occurs
      ClassNotFoundException - if the class identified by the beanName parameter is not found
    • getResourceAsStream

      InputStream getResourceAsStream(String name, BeanContextChild bcc) throws IllegalArgumentException
      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.
      Parameters:
      name - the resource name
      bcc - the specified child
      Returns:
      an InputStream for reading the resource, or null if the resource could not be found.
      Throws:
      IllegalArgumentException - if the resource is not valid
    • getResource

      URL getResource(String name, BeanContextChild bcc) throws IllegalArgumentException
      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.
      Parameters:
      name - the resource name
      bcc - the specified child
      Returns:
      a URL for the named resource for the specified child
      Throws:
      IllegalArgumentException - if the resource is not valid
    • addBeanContextMembershipListener

      void addBeanContextMembershipListener(BeanContextMembershipListener bcml)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds the specified BeanContextMembershipListener to receive BeanContextMembershipEvents from this BeanContext whenever it adds or removes a child Component(s).
      Parameters:
      bcml - the BeanContextMembershipListener to be added
    • removeBeanContextMembershipListener

      void removeBeanContextMembershipListener(BeanContextMembershipListener bcml)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes the specified BeanContextMembershipListener so that it no longer receives BeanContextMembershipEvents when the child Component(s) are added or removed.
      Parameters:
      bcml - the BeanContextMembershipListener to be removed