26 package java.beans.beancontext; 27 28 /** 29 * <p> 30 * This interface is implemented by a JavaBean that does 31 * not directly have a BeanContext(Child) associated with 32 * it (via implementing that interface or a subinterface thereof), 33 * but has a public BeanContext(Child) delegated from it. 34 * For example, a subclass of java.awt.Container may have a BeanContext 35 * associated with it that all Component children of that Container shall 36 * be contained within. 37 * </p> 38 * <p> 39 * An Object may not implement this interface and the 40 * BeanContextChild interface 41 * (or any subinterfaces thereof) they are mutually exclusive. 42 * </p> 43 * <p> 44 * Callers of this interface shall examine the return type in order to 45 * obtain a particular subinterface of BeanContextChild as follows: 46 * <code> 47 * BeanContextChild bcc = o.getBeanContextProxy(); 48 * 49 * if (bcc instanceof BeanContext) { 50 * // ... 51 * } 52 * </code> 53 * or 54 * <code> 55 * BeanContextChild bcc = o.getBeanContextProxy(); 56 * BeanContext bc = null; 57 * 58 * try { 59 * bc = (BeanContext)bcc; 60 * } catch (ClassCastException cce) { 61 * // cast failed, bcc is not an instanceof BeanContext 62 * } 63 * </code> 64 * </p> 65 * <p> 66 * The return value is a constant for the lifetime of the implementing 67 * instance 68 * </p> 69 * @author Laurence P. G. Cable 70 * @since 1.2 71 * 72 * @see java.beans.beancontext.BeanContextChild 73 * @see java.beans.beancontext.BeanContextChildSupport 74 */ 75 76 public interface BeanContextProxy { 77 78 /** 79 * Gets the <code>BeanContextChild</code> (or subinterface) 80 * associated with this object. 81 * @return the <code>BeanContextChild</code> (or subinterface) 82 * associated with this object 83 */ 84 BeanContextChild getBeanContextProxy(); 85 } | 26 package java.beans.beancontext; 27 28 /** 29 * <p> 30 * This interface is implemented by a JavaBean that does 31 * not directly have a BeanContext(Child) associated with 32 * it (via implementing that interface or a subinterface thereof), 33 * but has a public BeanContext(Child) delegated from it. 34 * For example, a subclass of java.awt.Container may have a BeanContext 35 * associated with it that all Component children of that Container shall 36 * be contained within. 37 * </p> 38 * <p> 39 * An Object may not implement this interface and the 40 * BeanContextChild interface 41 * (or any subinterfaces thereof) they are mutually exclusive. 42 * </p> 43 * <p> 44 * Callers of this interface shall examine the return type in order to 45 * obtain a particular subinterface of BeanContextChild as follows: 46 * <pre>{@code 47 * BeanContextChild bcc = o.getBeanContextProxy(); 48 * 49 * if (bcc instanceof BeanContext) { 50 * // ... 51 * } 52 * }</pre> 53 * or 54 * <pre>{@code 55 * BeanContextChild bcc = o.getBeanContextProxy(); 56 * BeanContext bc = null; 57 * 58 * try { 59 * bc = (BeanContext)bcc; 60 * } catch (ClassCastException cce) { 61 * // cast failed, bcc is not an instanceof BeanContext 62 * } 63 * }</pre> 64 * <p> 65 * The return value is a constant for the lifetime of the implementing 66 * instance 67 * </p> 68 * @author Laurence P. G. Cable 69 * @since 1.2 70 * 71 * @see java.beans.beancontext.BeanContextChild 72 * @see java.beans.beancontext.BeanContextChildSupport 73 */ 74 75 public interface BeanContextProxy { 76 77 /** 78 * Gets the {@code BeanContextChild} (or subinterface) 79 * associated with this object. 80 * @return the {@code BeanContextChild} (or subinterface) 81 * associated with this object 82 */ 83 BeanContextChild getBeanContextProxy(); 84 } |