Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Specify superclass for Java Objects generated from XSD using castor

 
Elinor Chang
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The casterbuilder.properties file has an option for you to specify a superclass for all java objects generated from castor. However, the properties file are included in the caster-xml.jar file. Is there anyway I could overwrite the parameter/value when perform the data binding?

Thanks!
 
Bindul Bhowmik
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway I could overwrite the parameter/value when perform the data binding?


Have a properties file called castor.properties in your ${JAVA_HOME}/lib or working directory (from where you are calling Castor) and properties in this file will override those which are defined in the jar file.

The entries from the file in your working directory have the highest preference and the one in the jar the lowest.

Another workaround: Get the source files of Castor from the distribution or CVS and change the values in the properties file. Though this dosen't look neat!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic