[jboss-svn-commits] JBoss Common SVN: r2610 - jbossxb/trunk/src/main/java/org/jboss/xb/builder.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Oct 6 09:07:08 EDT 2007


Author: scott.stark at jboss.org
Date: 2007-10-06 09:07:08 -0400 (Sat, 06 Oct 2007)
New Revision: 2610

Modified:
   jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java
Log:
Add support for setting a value property for non-collection type with JBossXmlChildren

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java	2007-10-06 04:11:24 UTC (rev 2609)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java	2007-10-06 13:07:08 UTC (rev 2610)
@@ -1579,8 +1579,17 @@
             if (typeInfo.isCollection())
                interceptor = ChildCollectionInterceptor.SINGLETON;
             else
-               throw new UnsupportedOperationException("TODO");
+            {
+               // Expect a type with a value property to accept the child value
+               PropertyInfo property = beanInfo.getProperty("value");
+               if (property == null)
+                  throw new UnsupportedOperationException("Expected a value property for non-collection type with JBossXmlChildren");
+               TypeInfo propertyType = property.getType();
+               interceptor = new PropertyInterceptor(property, propertyType);
+            }
             typeBinding.pushInterceptor(qName, interceptor);
+            if (trace)
+               log.trace("Added interceptor " + qName + " for type=" + childType + " interceptor=" + interceptor);
          }
       }
 




More information about the jboss-svn-commits mailing list