You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2006/09/23 00:21:23 UTC

[jira] Commented: (BETWIXT-55) Suppress Empty Collection Wrapper Elements

    [ http://issues.apache.org/jira/browse/BETWIXT-55?page=comments#action_12437020 ] 
            
Henri Yandell commented on BETWIXT-55:
--------------------------------------

Thanks for the enhancement Jesse. The format of the diff incorrect for using with the patch command so it's not as easy to apply as it might be. 

The simplest way to create a diff is with 'svn diff src/java/org/apache/commons/betwixt/io/AbstractBeanWriter.java', any chance you could give that a shot?

> Suppress Empty Collection Wrapper Elements
> ------------------------------------------
>
>                 Key: BETWIXT-55
>                 URL: http://issues.apache.org/jira/browse/BETWIXT-55
>             Project: Commons Betwixt
>          Issue Type: Improvement
>         Environment: N/A
>            Reporter: Jesse Sweetland
>            Priority: Trivial
>         Attachments: AbstractBeanWriter.java.diff
>
>
> Attached is a patch that modifies the isEmptyElement method of AbstractBeanWriter to consider collective element descriptors as empty if the collection properties they reference have no elements.  This suppresses the output of empty wrapper elements.  For example, consider the following .betwixt file for class Foo:
> <info> 
>   <element name="foo"> 
>     <element name="bars"> 
>       <element name="bar" property="bars"/> 
>     </element> 
>     <addDefaults/> 
>   </element> 
> </info> 
> Under Betwixt 0.7, an empty <bars/> element is written even if Foo.getBars() returns a null or empty collection.  This patch determines that the collection descriptor for the <bar> element is empty, so all of the children elements of the <bars> wrapper element descriptor are empty, so the <bars> element descriptor itself is empty, and is therefore ignored.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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