56 * </p> 57 * 58 * @author Laurence P. G. Cable 59 * @since 1.2 60 * 61 * @see java.beans.beancontext.BeanContext 62 * @see java.beans.PropertyChangeEvent 63 * @see java.beans.PropertyChangeListener 64 * @see java.beans.PropertyVetoException 65 * @see java.beans.VetoableChangeListener 66 */ 67 68 public interface BeanContextChild { 69 70 /** 71 * <p> 72 * Objects that implement this interface, 73 * shall fire a java.beans.PropertyChangeEvent, with parameters: 74 * 75 * propertyName "beanContext", oldValue (the previous nesting 76 * <code>BeanContext</code> instance, or <code>null</code>), 77 * newValue (the current nesting 78 * <code>BeanContext</code> instance, or <code>null</code>). 79 * <p> 80 * A change in the value of the nesting BeanContext property of this 81 * BeanContextChild may be vetoed by throwing the appropriate exception. 82 * </p> 83 * @param bc The <code>BeanContext</code> with which 84 * to associate this <code>BeanContextChild</code>. 85 * @throws PropertyVetoException if the 86 * addition of the specified <code>BeanContext</code> is refused. 87 */ 88 void setBeanContext(BeanContext bc) throws PropertyVetoException; 89 90 /** 91 * Gets the <code>BeanContext</code> associated 92 * with this <code>BeanContextChild</code>. 93 * @return the <code>BeanContext</code> associated 94 * with this <code>BeanContextChild</code>. 95 */ 96 BeanContext getBeanContext(); 97 98 /** 99 * Adds a <code>PropertyChangeListener</code> 100 * to this <code>BeanContextChild</code> 101 * in order to receive a <code>PropertyChangeEvent</code> 102 * whenever the specified property has changed. 103 * @param name the name of the property to listen on 104 * @param pcl the <code>PropertyChangeListener</code> to add 105 */ 106 void addPropertyChangeListener(String name, PropertyChangeListener pcl); 107 108 /** 109 * Removes a <code>PropertyChangeListener</code> from this 110 * <code>BeanContextChild</code> so that it no longer 111 * receives <code>PropertyChangeEvents</code> when the 112 * specified property is changed. 113 * 114 * @param name the name of the property that was listened on 115 * @param pcl the <code>PropertyChangeListener</code> to remove 116 */ 117 void removePropertyChangeListener(String name, PropertyChangeListener pcl); 118 119 /** 120 * Adds a <code>VetoableChangeListener</code> to 121 * this <code>BeanContextChild</code> 122 * to receive events whenever the specified property changes. 123 * @param name the name of the property to listen on 124 * @param vcl the <code>VetoableChangeListener</code> to add 125 */ 126 void addVetoableChangeListener(String name, VetoableChangeListener vcl); 127 128 /** 129 * Removes a <code>VetoableChangeListener</code> from this 130 * <code>BeanContextChild</code> so that it no longer receives 131 * events when the specified property changes. 132 * @param name the name of the property that was listened on. 133 * @param vcl the <code>VetoableChangeListener</code> to remove. 134 */ 135 void removeVetoableChangeListener(String name, VetoableChangeListener vcl); 136 137 } | 56 * </p> 57 * 58 * @author Laurence P. G. Cable 59 * @since 1.2 60 * 61 * @see java.beans.beancontext.BeanContext 62 * @see java.beans.PropertyChangeEvent 63 * @see java.beans.PropertyChangeListener 64 * @see java.beans.PropertyVetoException 65 * @see java.beans.VetoableChangeListener 66 */ 67 68 public interface BeanContextChild { 69 70 /** 71 * <p> 72 * Objects that implement this interface, 73 * shall fire a java.beans.PropertyChangeEvent, with parameters: 74 * 75 * propertyName "beanContext", oldValue (the previous nesting 76 * {@code BeanContext} instance, or {@code null}), 77 * newValue (the current nesting 78 * {@code BeanContext} instance, or {@code null}). 79 * <p> 80 * A change in the value of the nesting BeanContext property of this 81 * BeanContextChild may be vetoed by throwing the appropriate exception. 82 * </p> 83 * @param bc The {@code BeanContext} with which 84 * to associate this {@code BeanContextChild}. 85 * @throws PropertyVetoException if the 86 * addition of the specified {@code BeanContext} is refused. 87 */ 88 void setBeanContext(BeanContext bc) throws PropertyVetoException; 89 90 /** 91 * Gets the {@code BeanContext} associated 92 * with this {@code BeanContextChild}. 93 * @return the {@code BeanContext} associated 94 * with this {@code BeanContextChild}. 95 */ 96 BeanContext getBeanContext(); 97 98 /** 99 * Adds a {@code PropertyChangeListener} 100 * to this {@code BeanContextChild} 101 * in order to receive a {@code PropertyChangeEvent} 102 * whenever the specified property has changed. 103 * @param name the name of the property to listen on 104 * @param pcl the {@code PropertyChangeListener} to add 105 */ 106 void addPropertyChangeListener(String name, PropertyChangeListener pcl); 107 108 /** 109 * Removes a {@code PropertyChangeListener} from this 110 * {@code BeanContextChild} so that it no longer 111 * receives {@code PropertyChangeEvents} when the 112 * specified property is changed. 113 * 114 * @param name the name of the property that was listened on 115 * @param pcl the {@code PropertyChangeListener} to remove 116 */ 117 void removePropertyChangeListener(String name, PropertyChangeListener pcl); 118 119 /** 120 * Adds a {@code VetoableChangeListener} to 121 * this {@code BeanContextChild} 122 * to receive events whenever the specified property changes. 123 * @param name the name of the property to listen on 124 * @param vcl the {@code VetoableChangeListener} to add 125 */ 126 void addVetoableChangeListener(String name, VetoableChangeListener vcl); 127 128 /** 129 * Removes a {@code VetoableChangeListener} from this 130 * {@code BeanContextChild} so that it no longer receives 131 * events when the specified property changes. 132 * @param name the name of the property that was listened on. 133 * @param vcl the {@code VetoableChangeListener} to remove. 134 */ 135 void removeVetoableChangeListener(String name, VetoableChangeListener vcl); 136 137 } |