commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/digester AddDefaultsRule.java XMLIntrospectorHelper.java
Date Mon, 08 Jul 2002 16:51:38 GMT
jvanzyl     2002/07/08 09:51:38

  Modified:    betwixt/src/java/org/apache/commons/betwixt/digester
                        AddDefaultsRule.java XMLIntrospectorHelper.java
  Log:
  o This commit fixes an error where the wrapCollectionsInElement was not
    being propagated properly. The createDescriptor method now takes the
    XMLIntrospector as a parameter so that it can get hold of the
    wrapCollectionsInElement property.
  
  Revision  Changes    Path
  1.2       +1 -1      jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/digester/AddDefaultsRule.java
  
  Index: AddDefaultsRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/digester/AddDefaultsRule.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AddDefaultsRule.java	10 Jun 2002 17:53:35 -0000	1.1
  +++ AddDefaultsRule.java	8 Jul 2002 16:51:38 -0000	1.2
  @@ -123,7 +123,7 @@
                               continue;
                           }
                           NodeDescriptor nodeDescriptor = XMLIntrospectorHelper.createDescriptor(

  -                            descriptor, attributesForPrimitives 
  +                            descriptor, attributesForPrimitives, getXMLIntrospector()
                           );
                           if ( nodeDescriptor != null ) {
                               addDescriptor( nodeDescriptor );
  
  
  
  1.4       +19 -4     jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/digester/XMLIntrospectorHelper.java
  
  Index: XMLIntrospectorHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/digester/XMLIntrospectorHelper.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XMLIntrospectorHelper.java	2 Jul 2002 11:24:49 -0000	1.3
  +++ XMLIntrospectorHelper.java	8 Jul 2002 16:51:38 -0000	1.4
  @@ -119,10 +119,14 @@
        * The class property is ignored.
        */
       public static NodeDescriptor createDescriptor( 
  -        PropertyDescriptor propertyDescriptor,
  -        boolean useAttributesForPrimitives
  +        PropertyDescriptor propertyDescriptor, 
  +        boolean useAttributesForPrimitives,
  +        XMLIntrospector introspector
       ) throws IntrospectionException {
           Class type = propertyDescriptor.getPropertyType();
  +        
  +        System.out.println(propertyDescriptor.getPropertyType());
  +        
           NodeDescriptor nodeDescriptor = null;
           Method readMethod = propertyDescriptor.getReadMethod();
           Method writeMethod = propertyDescriptor.getWriteMethod();
  @@ -167,8 +171,9 @@
               if ( Map.class.isAssignableFrom( type ) ) {
                   loopDescriptor.setQualifiedName( "entry" );
               }
  -            
  +
               ElementDescriptor elementDescriptor = new ElementDescriptor();
  +            elementDescriptor.setWrapCollectionsInElement(introspector.isWrapCollectionsInElement());
               elementDescriptor.setElementDescriptors( new ElementDescriptor[] { loopDescriptor
} );
               
               nodeDescriptor = elementDescriptor;            
  @@ -225,7 +230,7 @@
               elementDescriptor.setPrimitiveType(true);
           }
           else if ( isLoopType( type ) ) {
  -            log.trace("Loop type");
  +            log.trace("Loop type ??");
               
               // don't wrap this in an extra element as its specified in the 
               // XML descriptor so no need.            
  @@ -321,9 +326,19 @@
                           // and if so, we'll set a new Updater on it if there
                           // is not one already
                           ElementDescriptor descriptor = findGetCollectionDescriptor( introspector,
rootDescriptor, propertyName );
  +                            
  +                            if ( log.isDebugEnabled() ) {
  +                                log.debug( "!! " + propertyName + " -> " + descriptor);
  +                            }
  +                        
                           if ( descriptor != null ) {
                               descriptor.setUpdater( new MethodUpdater( method ) );
                               descriptor.setSingularPropertyType( types[0] );
  +                            
  +                            if ( log.isDebugEnabled() ) {
  +                                log.debug( "!! " + method);
  +                                log.debug( "!! " + types[0]);
  +                            }
                               
                               // is there a child element with no localName
                               ElementDescriptor[] children = descriptor.getElementDescriptors();
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message