summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gilbert <david.gilbert@object-refinery.com>2006-11-11 06:14:17 +0000
committerDavid Gilbert <david.gilbert@object-refinery.com>2006-11-11 06:14:17 +0000
commit5a7231e58f2b64cd18389479181b89e8da7e1bae (patch)
tree59c2e9a7ddb5f5f10a4f7e6e468a4636fe5c95ce
parent3c80784c4c2f2983b6fef0b0278ad85305fc5cf7 (diff)
downloadclasspath-5a7231e58f2b64cd18389479181b89e8da7e1bae.tar.gz
2006-11-11 David Gilbert <david.gilbert@object-refinery.com>
* java/beans/beancontext/BeanContextSupport.java (getChildBeanContextChild): Implemented.
-rw-r--r--ChangeLog5
-rw-r--r--java/beans/beancontext/BeanContextSupport.java26
2 files changed, 27 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 32a9b165b..e004bfb85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-11 David Gilbert <david.gilbert@object-refinery.com>
+
+ * java/beans/beancontext/BeanContextSupport.java
+ (getChildBeanContextChild): Implemented.
+
2006-11-10 Roman Kennke <kennke@aicas.com>
* javax/swing/text/View.java
diff --git a/java/beans/beancontext/BeanContextSupport.java b/java/beans/beancontext/BeanContextSupport.java
index 4e8c5bbea..2dc2a4e4a 100644
--- a/java/beans/beancontext/BeanContextSupport.java
+++ b/java/beans/beancontext/BeanContextSupport.java
@@ -478,10 +478,28 @@ public class BeanContextSupport extends BeanContextChildSupport
return (BeanContext) beanContextChildPeer;
}
- protected static final BeanContextChild getChildBeanContextChild (Object child)
- throws NotImplementedException
- {
- throw new Error ("Not implemented");
+ /**
+ * Returns the {@link BeanContextChild} implementation for the given child.
+ *
+ * @param child the child (<code>null</code> permitted).
+ *
+ * @return The bean context child.
+ *
+ * @throws IllegalArgumentException if <code>child</code> implements both
+ * the {@link BeanContextChild} and {@link BeanContextProxy} interfaces.
+ */
+ protected static final BeanContextChild getChildBeanContextChild(Object child)
+ {
+ if (child == null)
+ return null;
+ if (child instanceof BeanContextChild && child instanceof BeanContextProxy)
+ throw new IllegalArgumentException("Child cannot implement "
+ + "BeanContextChild and BeanContextProxy simultaneously.");
+ if (child instanceof BeanContextChild)
+ return (BeanContextChild) child;
+ if (child instanceof BeanContextProxy)
+ return ((BeanContextProxy) child).getBeanContextProxy();
+ return null;
}
protected static final BeanContextMembershipListener getChildBeanContextMembershipListener (Object child)