Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to implement adapter pattern for JAXB classes in java.

 
muthukumar mahadevan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi dudes,

I am using REST web service as Client. To handle the REST Response i am using JAXB.
Could you guide me to implement the converted jaxb classes in java by using the adapter design pattern..

Thanks in advance...
 
Shiva.Om Kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Adapter on Wiki

 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
The "classic approach" is to create one or more XML schemas that describe the data your web service will send and receive.
Then one use the XJC JAXB schema compiler to generate the JAXB bean classes. The XJC schema compiler can be used from Maven or Ant, so it can be part of your build process.
Finally, the JAXB bean classes are used in the code either to interpret received XML or to prepare an object representation of response data, which is later marshalled into XML.
Ask for more details!
Best wishes!
 
muthukumar mahadevan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh! Thanks a lot.

i got some clear idea now. ill try my level best.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic