• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to get XML form javaobject using JAXB  RSS feed

 
krishna chitturi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i have java object and i need to get xml from it, we are using JAXB for unmarshal(java object to xml).we are generating JAXB object it has two methods named marshal and unmarshal.unmarshal is used to get java object from XML , how to call marshal to get xml from jaxb.that unmarshal method is taking Marshallaer as parameter, how can i pass Marshaller as Marshaller is private final class.
please help me out.
 
Greg Charles
Sheriff
Posts: 3015
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, let's be clear first. Marshalling is taking an object and turning it into XML. Unmarshalling is taking XML and turning it into an object.
JAXB has the following code snippets right in their API documentation. They show how to do both marshalling and unmarshalling.

P.S. nosferatu.xml. Those guys are too funny!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!