Hi Matthew,

thanks for the patch. :)

The mailing list does not allow attachments, so the patch was removed from the mail. :(

Please create a issues at https://issues.apache.org/jira/browse/BEANUTILS/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel and attach the patch to it.

Thanks,
Pascal

Am 25.10.2015 um 18:55 schrieb Matthew Mann:
Please consider the attached patch for the commons-beanutils2 project. I added support for nested properties and automatic conversion. Excerpt from AutoConversionTest:

*final*DateFormat dateFormat= *new*SimpleDateFormat("MMMM d, yyyy");

*final*TransformerRegistry transformerRegistry= *new*TransformerRegistry()

.register(*new*StringToDate(dateFormat))

.register(*new*IntegerToString())

.register(*new*StringToColor())

.register(*new*IntegerToColor())

.register(*new*StringToURL())

.register(*new* StringToPhoneNumber());

*final*PhoneNumber phoneNumber= *new*PhoneNumber();

phoneNumber.setAreaCode("202");

phoneNumber.setPrefix("456");

phoneNumber.setLineNumber("1111");

*final*Address address= *new*Address();

address.setStreetAddress("1600 Pennsylvania Avenue Northwest");

address.setCity("Washington");

address.setStateCode("DC");

address.setPostalCode("20500");

address.setCountryCode("US");

*final*Person person= *new*Person();

person.setFirstName("Barack");

person.setLastName("Obama");

person.setBirthDate(dateFormat.parse("August 4, 1961"));

person.setEyeColor(Color./decode/("#362819"));

person.setHairColor(*/GRAY/*);

person.setPhoneNumber(phoneNumber);

person.setAddress(address);

person.setWebsite(*new*URL("https://www.barackobama.com/";));

/assertEquals/(person, /on/(*new*Person(), transformerRegistry)

.set("firstName").with("Barack")

.set("lastName").with("Obama")

.set("birthDate").with("August 4, 1961")

.set("hairColor").with(0x808080)

.set("eyeColor").with("#362819")

.set("website").with("https://www.barackobama.com/";)

.set("phoneNumber").with("202-456-1111")

.set("address").with(*new*Address())

.set("address.streetAddress").with("1600 Pennsylvania Avenue Northwest")

.set("address.city").with("Washington")

.set("address.stateCode").with("DC")

.set("address.postalCode").with(20500)

.set("address.countryCode").with("US")

.get());


Thanks,
Matt

On Sat, Oct 24, 2015 at 4:16 PM, Matthew Mann <mattmann...@gmail.com <mailto:mattmann...@gmail.com>> wrote:

    When will BeanUtils2 be released? According to Benedikt Ritter:
    "One big part that is still missing is automatic conversion of
    values." Anything else?

    -Matt

    On Wed, Oct 7, 2015 at 1:22 PM, Benedikt Ritter
    <brit...@apache.org <mailto:brit...@apache.org>> wrote:

        Hello Matthew,

        sorry this took so long. We don't have a road map. There is
        not much
        activity in BeanUtils2 at the moment. One big part that is
        still missing is
        automatic conversion of values. If you're interested to get
        involved in the
        development of BeanUtils 2, it's probably the best to reach
        out for other
        developers on the dev ML. You can also look into the SANDBOX
        project in the
        ASF jira and filter for tickets with the BeanUtils2 component
        to see what
        need work.

        Best regards,
        Benedikt

        2015-10-04 23:42 GMT+02:00 Matthew Mann <mattmann...@gmail.com
        <mailto:mattmann...@gmail.com>>:

        > Please share the release road map with me? Or, is it online
        somewhere?
        > Anything I can do to help?
        >
        > -Matt
        >
        > On Sat, Sep 26, 2015 at 6:31 PM, Matthew Mann
        <mattmann...@gmail.com <mailto:mattmann...@gmail.com>>
        > wrote:
        >
        > > Cool! Is the road map online somewhere?
        > >
        > > On Wed, Sep 23, 2015 at 9:17 AM, Benedikt Ritter
        <brit...@apache.org <mailto:brit...@apache.org>>
        > > wrote:
        > >
        > >> Woops, hit send to early...
        > >>
        > >> 2015-09-23 15:16 GMT+02:00 Benedikt Ritter
        <brit...@apache.org <mailto:brit...@apache.org>>:
        > >>
        > >> >
        > >> >
        > >> > 2015-09-19 22:17 GMT+02:00 Matthew Mann
        <mattmann...@gmail.com <mailto:mattmann...@gmail.com>>:
        > >> >
        > >> >> When will beanutils2 be released?
        > >> >>
        > >> >
        > >> > There are now plans/release road map. The plan more
        features so that
        > it
        > >> is
        > >> > a real substitute to BeanUtils1.
        > >> >
        > >>
        > >> Should be "the plan was to add more features..."
        > >>
        > >>
        > >> >
        > >> > Regards,
        > >> > Benedikt
        > >> >
        > >> >
        > >> >
        > >> > --
        > >> > http://people.apache.org/~britter/
        <http://people.apache.org/%7Ebritter/>
        > >> > http://www.systemoutprintln.de/
        > >> > http://twitter.com/BenediktRitter
        > >> > http://github.com/britter
        > >> >
        > >>
        > >>
        > >>
        > >> --
        > >> http://people.apache.org/~britter/
        <http://people.apache.org/%7Ebritter/>
        > >> http://www.systemoutprintln.de/
        > >> http://twitter.com/BenediktRitter
        > >> http://github.com/britter
        > >>
        > >
        > >
        >



        --
        http://people.apache.org/~britter/
        <http://people.apache.org/%7Ebritter/>
        http://www.systemoutprintln.de/
        http://twitter.com/BenediktRitter
        http://github.com/britter





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

Reply via email to