Class BeanContextSupport
- All Implemented Interfaces:
BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, DesignMode, PropertyChangeListener, VetoableChangeListener, Visibility, Serializable, Iterable, Collection, EventListener
- Direct Known Subclasses:
BeanContextServicesSupport
@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.
- Since:
- 1.2
- See Also:
Nested Class Summary
| 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. |
Field Summary
| 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. |
Fields declared in class BeanContextChildSupport
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport | Modifier and Type | Field | Description |
|---|---|---|
protected BeanContext |
beanContext |
Deprecated, for removal: This API element is subject to removal in a future version. The bean context. |
BeanContextChild |
beanContextChildPeer |
Deprecated, for removal: This API element is subject to removal in a future version. The BeanContext in which this BeanContextChild is nested. |
protected PropertyChangeSupport |
pcSupport |
Deprecated, for removal: This API element is subject to removal in a future version. The PropertyChangeSupport associated with this BeanContextChildSupport. |
protected boolean |
rejectedSetBCOnce |
Deprecated, for removal: This API element is subject to removal in a future version. A flag indicating that there has been at least one PropertyChangeVetoException thrown for the attempted setBeanContext operation. |
protected VetoableChangeSupport |
vcSupport |
Deprecated, for removal: This API element is subject to removal in a future version. The VetoableChangeSupport associated with this BeanContextChildSupport. |
Fields declared in interface BeanContext
globalHierarchyLock | Modifier and Type | Field | Description |
|---|---|---|
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. |
Fields declared in interface DesignMode
PROPERTYNAME | Modifier and Type | Field | Description |
|---|---|---|
static final String |
PROPERTYNAME |
The standard value of the propertyName as fired from a BeanContext or other source of PropertyChangeEvents. |
Constructor Summary
| 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 |
Method Summary
| 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. |
Methods declared in class BeanContextChildSupport
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, initializeBeanContextResources, isDelegated, releaseBeanContextResources, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, validatePendingSetBeanContext | Modifier and Type | Method | Description |
|---|---|---|
void |
addPropertyChangeListener |
Deprecated, for removal: This API element is subject to removal in a future version. Add a PropertyChangeListener for a specific property. |
void |
addVetoableChangeListener |
Deprecated, for removal: This API element is subject to removal in a future version. Add a VetoableChangeListener for a specific property. |
void |
firePropertyChange |
Deprecated, for removal: This API element is subject to removal in a future version. Report a bound property update to any registered listeners. |
void |
fireVetoableChange |
Deprecated, for removal: This API element is subject to removal in a future version. Report a vetoable property update to any registered listeners. |
BeanContext |
getBeanContext() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the nesting BeanContext for this BeanContextChildSupport. |
BeanContextChild |
getBeanContextChildPeer() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the BeanContextChild associated with this BeanContextChildSupport. |
protected void |
initializeBeanContextResources() |
Deprecated, for removal: This API element is subject to removal in a future version. This method may be overridden by subclasses to provide their own initialization behaviors. |
boolean |
isDelegated() |
Deprecated, for removal: This API element is subject to removal in a future version. Reports whether or not this class is a delegate of another. |
protected void |
releaseBeanContextResources() |
Deprecated, for removal: This API element is subject to removal in a future version. This method may be overridden by subclasses to provide their own release behaviors. |
void |
removePropertyChangeListener |
Deprecated, for removal: This API element is subject to removal in a future version. Remove a PropertyChangeListener for a specific property. |
void |
removeVetoableChangeListener |
Deprecated, for removal: This API element is subject to removal in a future version. Removes a VetoableChangeListener. |
void |
serviceAvailable |
Deprecated, for removal: This API element is subject to removal in a future version. A new service is available from the nesting BeanContext. |
void |
serviceRevoked |
Deprecated, for removal: This API element is subject to removal in a future version. A service provided by the nesting BeanContext has been revoked. |
void |
setBeanContext |
Deprecated, for removal: This API element is subject to removal in a future version. Sets the BeanContext for this BeanContextChildSupport. |
boolean |
validatePendingSetBeanContext |
Deprecated, for removal: This API element is subject to removal in a future version. Called from setBeanContext to validate (or otherwise) the pending change in the nesting BeanContext property value. |
Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | Modifier and Type | Method | Description |
|---|---|---|
protected Object |
clone() |
Creates and returns a copy of this object. |
boolean |
equals |
Indicates whether some other object is "equal to" this one. |
protected void |
finalize() |
Deprecated, for removal: This API element is subject to removal in a future version. Finalization is deprecated and subject to removal in a future release. |
final Class |
getClass() |
Returns the runtime class of this Object. |
int |
hashCode() |
Returns a hash code value for this object. |
final void |
notify() |
Wakes up a single thread that is waiting on this object's monitor. |
final void |
notifyAll() |
Wakes up all threads that are waiting on this object's monitor. |
String |
toString() |
Returns a string representation of the object. |
final void |
wait() |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
Methods declared in interface Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray | Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals |
Compares the specified object with this collection for equality. |
int |
hashCode() |
Returns the hash code value for this collection. |
default Stream |
parallelStream() |
Returns a possibly parallel Stream with this collection as its source. |
default boolean |
removeIf |
Removes all of the elements of this collection that satisfy the given predicate (optional operation). |
default Spliterator |
spliterator() |
Creates a Spliterator over the elements in this collection. |
default Stream |
stream() |
Returns a sequential Stream with this collection as its source. |
default <T> Object[] |
toArray |
Returns an array containing all of the elements in this collection, using the provided generator function to allocate the returned array. |
Field Details
children
protected transient HashMap<Object, BeanContextSupport.BCSChild> children
protected HashMap children field shall be synchronized on that object.bcmListeners
protected transient ArrayList<BeanContextMembershipListener> bcmListeners
protected ArrayList bcmListeners field shall be synchronized on that object.locale
protected Locale locale
okToUseGui
protected boolean okToUseGui
boolean indicating if this instance may now render a GUI.designTime
protected boolean designTime
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)
- Parameters:
-
peer- The peerBeanContextwe are supplying an implementation for, ornullif this object is its own peer -
lcle- The current Locale for this BeanContext. Iflcleisnull, the default locale is assigned to theBeanContextinstance. -
dTime- The initial state,trueif in design mode,falseif runtime. -
visible- The initial visibility. - See Also:
BeanContextSupport
public BeanContextSupport(BeanContext peer, Locale lcle, boolean dtime)
- Parameters:
-
peer- The peerBeanContextwe are supplying an implementation for, ornullif this object is its own peer -
lcle- The current Locale for thisBeanContext. Iflcleisnull, the default locale is assigned to theBeanContextinstance. -
dtime- The initial state,trueif in design mode,falseif runtime. - See Also:
BeanContextSupport
public BeanContextSupport(BeanContext peer, Locale lcle)
- Parameters:
-
peer- The peer BeanContext we are supplying an implementation for, ornullif this object is its own peer -
lcle- The current Locale for thisBeanContext. Iflcleisnull, the default locale is assigned to theBeanContextinstance. - See Also:
BeanContextSupport
public BeanContextSupport(BeanContext peer)
- Parameters:
-
peer- The peerBeanContextwe are supplying an implementation for, ornullif this object is its own peer
BeanContextSupport
public BeanContextSupport()
Method Details
getBeanContextPeer
public BeanContext getBeanContextPeer()
BeanContext that this object is providing the implementation for.- Returns:
- the BeanContext instance
instantiateChild
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.
- Specified by:
-
instantiateChildin interfaceBeanContext - 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()
- Specified by:
-
sizein interfaceCollection - Returns:
- number of children
isEmpty
public boolean isEmpty()
BeanContext is empty. A BeanContext is considered empty when it contains zero nested children.- Specified by:
-
isEmptyin interfaceCollection - Returns:
-
trueif there are no children, otherwisefalse
contains
public boolean contains(Object o)
BeanContext.- Specified by:
-
containsin interfaceCollection - Parameters:
-
o- the Object in question - Returns:
-
trueif this object is a child, otherwisefalse
containsKey
public boolean containsKey(Object o)
BeanContext.- Parameters:
-
o- the Object in question - Returns:
-
trueif this object is a child, otherwisefalse
iterator
public Iterator<Object> iterator()
BeanContext instances currently nested in this BeanContext.- Specified by:
-
iteratorin interfaceCollection - Specified by:
-
iteratorin interfaceIterable - Returns:
- an
Iteratorof the nested children
toArray
public Object[] toArray()
BeanContext instances currently nested in this BeanContext.- Specified by:
-
toArrayin interfaceCollection - Returns:
- an array, whose runtime component type is
Object, containing all of the elements in this collection
toArray
public Object[] toArray(Object[] arry)
BeanContext that match the types contained in arry.- Specified by:
-
toArrayin interfaceCollection - 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)
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)
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:
-
addin interfaceCollection - Parameters:
-
targetChild- The child objects to nest within thisBeanContext - Returns:
- true if the child was added successfully.
- See Also:
remove
public boolean remove(Object targetChild)
- Specified by:
-
removein interfaceCollection - Parameters:
-
targetChild- The child objects to remove - Returns:
-
trueif an element was removed as a result of this call - See Also:
remove
protected boolean remove(Object targetChild, boolean callChildSetBC)
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 thisBeanContext. - Returns:
- whether or not was present before being removed
containsAll
public boolean containsAll(Collection c)
Collection are children of this BeanContext.- Specified by:
-
containsAllin interfaceCollection - Parameters:
-
c- the specifiedCollection - Returns:
-
trueif all objects in the collection are children of thisBeanContext, false if not. - See Also:
addAll
public boolean addAll(Collection c)
- Specified by:
-
addAllin interfaceCollection - 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)
- Specified by:
-
removeAllin interfaceCollection - 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)
- Specified by:
-
retainAllin interfaceCollection - 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()
- Specified by:
-
clearin interfaceCollection - Throws:
-
UnsupportedOperationException- thrown unconditionally by this implementation
addBeanContextMembershipListener
public void addBeanContextMembershipListener(BeanContextMembershipListener bcml)
- Specified by:
-
addBeanContextMembershipListenerin interfaceBeanContext - Parameters:
-
bcml- the BeanContextMembershipListener to add - Throws:
-
NullPointerException- if the argument is null
removeBeanContextMembershipListener
public void removeBeanContextMembershipListener(BeanContextMembershipListener bcml)
- Specified by:
-
removeBeanContextMembershipListenerin interfaceBeanContext - Parameters:
-
bcml- the BeanContextMembershipListener to remove - Throws:
-
NullPointerException- if the argument is null
getResourceAsStream
public 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.- Specified by:
-
getResourceAsStreamin interfaceBeanContext - 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)
BeanContextjava.lang.ClassLoader.getResource(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader.- Specified by:
-
getResourcein interfaceBeanContext - 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)
BeanContext.- Specified by:
-
setDesignTimein interfaceDesignMode - Parameters:
-
dTime- the new designTime value - See Also:
isDesignTime
public boolean isDesignTime()
- Specified by:
-
isDesignTimein interfaceDesignMode - Returns:
-
trueif in design time mode,falseif not
setLocale
public void setLocale(Locale newLocale) throws PropertyVetoException
- Parameters:
-
newLocale- the new locale. This method call will have no effect if newLocale isnull. - Throws:
-
PropertyVetoException- if the new value is rejected
getLocale
public Locale getLocale()
BeanContext.- Returns:
- the current Locale of the
BeanContext
needsGui
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.
- Specified by:
-
needsGuiin interfaceVisibility - Returns:
-
trueif the implementor needs a GUI
dontUseGui
public void dontUseGui()
- Specified by:
-
dontUseGuiin interfaceVisibility
okToUseGui
public void okToUseGui()
- Specified by:
-
okToUseGuiin interfaceVisibility
avoidingGui
public boolean avoidingGui()
BeanContext child is avoiding using its GUI.- Specified by:
-
avoidingGuiin interfaceVisibility - Returns:
- is this instance avoiding using its GUI?
- See Also:
isSerializing
public boolean isSerializing()
BeanContext in the process of being serialized?- Returns:
-
trueif thisBeanContextis currently being serialized, otherwisefalse
bcsChildren
protected Iterator<BeanContextSupport.BCSChild> bcsChildren()
BeanContext.- Returns:
- an iterator for all the current BCSChild values
bcsPreSerializationHook
protected void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException
- Parameters:
-
oos- theObjectOutputStreamto use during serialization - Throws:
-
IOException- if serialization failed
bcsPreDeserializationHook
protected void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException
- Parameters:
-
ois- theObjectInputStreamto use during deserialization - Throws:
-
IOException- if deserialization failed -
ClassNotFoundException- if needed classes are not found
childDeserializedHook
protected void childDeserializedHook(Object child, BeanContextSupport.BCSChild bcsc)
- Parameters:
-
child- the newly deserialized child -
bcsc- the newly deserialized BCSChild
serialize
protected final void serialize(ObjectOutputStream oos, Collection<?> coll) throws IOException
- Parameters:
-
oos- theObjectOutputStreamto use during serialization -
coll- theCollectionto serialize - Throws:
-
IOException- if serialization failed
deserialize
protected final void deserialize(ObjectInputStream ois, Collection coll) throws IOException, ClassNotFoundException
- 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
BeanContext.- Parameters:
-
oos- theObjectOutputStreamto use during serialization - Throws:
-
IOException- if serialization failed
readChildren
public final void readChildren(ObjectInputStream ois) throws IOException, ClassNotFoundException
- 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
- Specified by:
-
vetoableChangein interfaceVetoableChangeListener - Parameters:
-
pce- aPropertyChangeEventobject 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)
- Specified by:
-
propertyChangein interfacePropertyChangeListener - Parameters:
-
pce- A PropertyChangeEvent object describing the event source and the property that has changed.
validatePendingAdd
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.
- 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)
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)
- Parameters:
-
child- the child -
bcsc- the BCSChild
childJustRemovedHook
protected void childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)
- Parameters:
-
child- the child -
bcsc- the BCSChild
getChildVisibility
protected static final Visibility getChildVisibility(Object child)
- Parameters:
-
child- the specified child - Returns:
- the Component (if any) associated with the specified child.
getChildSerializable
protected static final Serializable getChildSerializable(Object child)
- Parameters:
-
child- the specified child - Returns:
- the Serializable (if any) associated with the specified Child
getChildPropertyChangeListener
protected static final PropertyChangeListener getChildPropertyChangeListener(Object child)
- Parameters:
-
child- the specified child - Returns:
- the PropertyChangeListener (if any) of the specified child
getChildVetoableChangeListener
protected static final VetoableChangeListener getChildVetoableChangeListener(Object child)
- Parameters:
-
child- the specified child - Returns:
- the VetoableChangeListener (if any) of the specified child
getChildBeanContextMembershipListener
protected static final BeanContextMembershipListener getChildBeanContextMembershipListener(Object child)
- Parameters:
-
child- the specified child - Returns:
- the BeanContextMembershipListener (if any) of the specified child
getChildBeanContextChild
protected static final BeanContextChild getChildBeanContextChild(Object 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)
- Parameters:
-
bcme- the event to fire
fireChildrenRemoved
protected final void fireChildrenRemoved(BeanContextMembershipEvent bcme)
- Parameters:
-
bcme- the event to fire
initialize
protected void initialize()
copyChildren
protected final Object[] copyChildren()
- Returns:
- a copy of the current nested children
classEquals
protected static final boolean classEquals(Class<?> first, Class<?> second)
- Parameters:
-
first- the first object -
second- the second object - Returns:
- true if equal, false if not
© 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.