Forum Stats

  • 3,838,458 Users
  • 2,262,366 Discussions
  • 7,900,651 Comments

Discussions

setting values to JAXBElement<Object> type

SrikOra
SrikOra Member Posts: 52
edited Jun 20, 2016 9:32PM in Java Technology & XML

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

This discussion has been closed.