• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB  RSS feed

 
Ravikanth Reddy Bapathi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using jaxb 2.0, trying to generate classes using xjc compiler, could do it successfully, but the classes that were generated are using annotations, can any one let me know how to suppress the annotations using jaxb 2.0

I could also find an option for xjc "npa" -- to suppress only package level annonation, but not other class level and field level annotations.

It would be great if any one could help me in suppressing all the other annotations also

Quick help is appreciated.

Thanks,
Ravikanth
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JAXB 2.0 uses annotations , so you can't supress them. Why would you want to supress annotations.
 
Ravikanth Reddy Bapathi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application uses lower version of java, which doesnt use annotations.
backward compatibility for jaxb should have been there ?
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you will have to look at some mapping tools like XMLBeans. Check if older version of JAXB is available.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here you go
https://jaxb.dev.java.net/1.0/
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another option is JiBX- you write the Java classes yourself and specify the binding.

So in fact it gives more control than either version of JAXB - it will require for more effort, though significantly less than coding the (un)marshalling code yourself.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!