Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB binding files  RSS feed

Greg Jewell
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I know this isn't strictly web service related, but this seems like the most appropriate forum since JAX-WS utilizes JAXB.

I am using JAXB to generate Java classes from a set of schemas that I have been given. The data types in these schemas reference each other frequently. Due to various reasons, I need to change the name of several fields in the generated code. To do this, I'm using bindings files to look for the nodes in question, and then to rename them in the Java code.

I'm running into issues, however, when a single schema may be processed by xjc multiple times. (As I mentioned, these schemas quite frequently reference each other.) Depending on the order that the schemas are processed, the Java code may be regenerated without the changed parameter names unless I duplicate all of the customization across all of the bindings files.

Is there any way to import/include one binding file in another? I want to do something like this:

I know that xjc allows any number of binding files to be specified, but I'm using ant to invoke the xjc task, and things get hairy when I have different numbers of bindings that are needed for different invocations.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!