Robert,

We have pretty limited internet access here at work. I will resume this
project at home...

As far as my three concerns, you covered 2 and 3. I didn't include the code
for 1. It would look like:

--- betwixt_backup\XMLIntrospector.java 2003-06-11 14:39:38.000000000 -0400
+++ commons-betwixt\src\java\org\apache\commons\betwixt\XMLIntrospector.java
2003-06-05 02:59:56.000000000 -0400
@@ -238,7 +238,6 @@
       * @throws IntrospectionException when the bean introspection fails
       */
     public XMLBeanInfo introspect(Class aClass) throws
IntrospectionException {
-
         // we first reset the beaninfo searchpath.
         String[] searchPath = null;
         if (!useBeanInfoSearchPath) {
@@ -329,15 +328,14 @@
         } else {
             List elements = new ArrayList();
             List attributes = new ArrayList();
-            List contents = new ArrayList();
 
-            addProperties( beanInfo, elements, attributes, contents );
+            addProperties( beanInfo, elements, attributes );
 
             BeanInfo[] additionals = beanInfo.getAdditionalBeanInfo();
             if ( additionals != null ) {
                 for ( int i = 0, size = additionals.length; i < size; i++ )
{
                     BeanInfo otherInfo = additionals[i];
-                    addProperties( otherInfo, elements, attributes,
contents );
+                    addProperties( otherInfo, elements, attributes );
                 }
             }
 
@@ -353,16 +351,6 @@
                 attributes.toArray( descriptors );
                 elementDescriptor.setAttributeDescriptors( descriptors );
             }
-            // 06/11/03 Is this necessary? And Correct?
-            // See the above declaration and the changes in the
addProperties and addProperty methods.
-            size = contents.size();
-            if ( size > 0 ) {
-                Descriptor[] descriptors = new Descriptor[size];
-                contents.toArray( descriptors );
-                elementDescriptor.setContentDescriptors( descriptors );
-            }
-
-
         }
 
         answer.setElementDescriptor( elementDescriptor );
@@ -583,14 +571,13 @@
     protected void addProperties(
                                     BeanInfo beanInfo,
                                     List elements,
-                                    List attributes,
-                                    List contents)
+                                    List attributes) 
                                         throws
                                             IntrospectionException {
         PropertyDescriptor[] descriptors =
beanInfo.getPropertyDescriptors();
         if ( descriptors != null ) {
             for ( int i = 0, size = descriptors.length; i < size; i++ ) {
-                addProperty(beanInfo, descriptors[i], elements, attributes,
contents);
+                addProperty(beanInfo, descriptors[i], elements,
attributes);
             }
         }
         if (log.isTraceEnabled()) {
@@ -614,8 +601,7 @@
                                 BeanInfo beanInfo,
                                 PropertyDescriptor propertyDescriptor,
                                 List elements,
-                                List attributes,
-                                List contents)
+                                List attributes) 
                                     throws
                                         IntrospectionException {
         NodeDescriptor nodeDescriptor = XMLIntrospectorHelper
@@ -627,12 +613,9 @@
         }
         if (nodeDescriptor instanceof ElementDescriptor) {
            elements.add(nodeDescriptor);
-        } else if (nodeDescriptor instanceof AttributeDescriptor ){
-           attributes.add(nodeDescriptor);
         } else {
-            contents.add(nodeDescriptor);
+           attributes.add(nodeDescriptor);
         }
-
     }
 
     /**


Thanks a lot for your help.


Abraham Fathman
eBusiness Architecture
513-534-4607

-----Original Message-----
From: robert burrell donkin
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 5:31 PM
To: Jakarta Commons Developers List
Subject: Re: Betwixt Question (Mixed Content) (Patch for reading mixed
con tent)


hi Abraham

On Wednesday, June 11, 2003, at 08:45 PM, Fathman, Abraham wrote:

> Robert,
>
> Thanks for the quick response. I think that I have solved the easy use 
> case
> that you mentioned (It works for my situation anyway).
>
> I do have a few questions though:
>
> 1) In org.apache.commons.betwixt.XMLIntrospector line 330, should I add 
> the
> abilitiy to copy the ContentDescriptors?

i'm not sure i see this. it might be that some small stuff changed. it 
would very cool if you could get CVS set up and work from CVS HEAD. (if 
you need some instructors then i can supply some urls).

> 2) In org.apache.commons.betwixt.digester.TextRule line 135, should we be
> overriding the beanClass member variable with a local beanClass variable?

this looks very, very much like a coding mistake. i think that maybe the 
field at the top is a relic from a past incarnations. i've removed it in 
CVS HEAD.

> 3) In org.apache.commons.betwixt.io.BeanRuleSet line 347, is that the
> correct expression to make sure that we don't add duplicates? A better way
> to handle it, starting at line 248, might be to just handle the
> ElementDescriptors with the for loop and handle the non ElementDescriptors
> (TextDescriptors) in afterwards, line 351 for example.

(again, i'm a little unclear about the line numbers). are you talking 
about the getElementDescriptor method?

> I have included the patch (diff -r -u -d on the src directories between 
> the
> 060503-src.zip and what I changed) below.

(my first impressions) is that this looks fine. (but cvs diff -u against 
CVS HEAD would have been even better.)

could you supply some test cases? (we're big on test cases and usually 
they take me as long to write as the original code.) if you need some 
examples, look in the src/test directory structure.

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to