Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

setting values to JAXBElement<Object> type

SrikOraJun 20 2016 — edited Jun 20 2016

Hi,

I have the following scenario

I have a class called SimpleEnquiry with this setter

    public void setLocationAddress(JAXBElement<Address> value) {

        this.locationAddress = value;

    }

I'm trying to set the values from another class like this

Address a = new Address();

a.setStreet("aaa");

a.setPostcode(3000);

SimpleEnquiry s = new SimpleEnquiry ();


s.setLocationAddress( ?)    ..


How can i pass Address object 'a' to setLocationAddress() as it is expecting JAXBElement<Address> type ?



Would really appreciate if someone can assist with this query


Thanks

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 18 2016
Added on Jun 20 2016
0 comments
784 views