[jira] Created: (JIBX-342) <collection> should allow specifying get-method without specifying set-method

View: New views
1 Messages — Rating Filter:   Alert me  

[jira] Created: (JIBX-342) <collection> should allow specifying get-method without specifying set-method

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

<collection> should allow specifying get-method without specifying set-method
-----------------------------------------------------------------------------

                 Key: JIBX-342
                 URL: http://jira.codehaus.org/browse/JIBX-342
             Project: JiBX
          Issue Type: Improvement
          Components: core
    Affects Versions: JiBX 1.2.1
            Reporter: Archie Cobbs
             Fix For: JiBX 1.2.2


In many cases, a property of a class that is a collection type has only a getter:

  public class Bar {

    private final Set<Foo> foos = new HashSet<Foo>();

    public Set<Foo> getFoos() {
        return this.foos;
    }
  }

But trying to map it like this is illegal:

  <collection item-type="pkg.Foo" get-method="getFoos"/>

because JiBX requires a "set-method". So to use this class with JiBX, you have to create a dummy method that does nothing:

    public void dummySetFoos(Set<Foo> foos) {
       // dummy method required by JiBX
    }

and then do:

  <collection item-type="pkg.Foo" get-method="getFoos" set-method="setFoos"/>

Improvement request: relax the requirement for a "set-method" when a "get-method" is provided and the property is a collection.


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

       

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
jibx-devs mailing list
jibx-devs@...
https://lists.sourceforge.net/lists/listinfo/jibx-devs