castor

Cannot overwrite nameConflictStrategies using castor-srcgen ant task and via attribute properties

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.1
  • Fix Version/s: None
  • Component/s: XML code generator
  • Labels:
    None
  • Number of attachments :
    2

Description

Following call to ant task castor-srcgen:

<castor-srcgen
file="${basedir}/${schema}"
bindingfile="${basedir}/${binding}"
todir="${basedir}/${jaxbsrc}"
package="${base_package}"
types="j2"
properties="${basedir}/binding.generation.properties"
verbose="true"
warnings="true"
/>

In my binding.generation.properties, I want to overwrite the name conflict strategy using
org.exolab.castor.builder.nameConflictStrategies=org.exolab.castor.builder.conflictresolution.InformViaLogClassNameCRStrategy

This setting does not have any effect, I always get the default strategy where it interactively asks me "Continue anyway [not recommended] (y|n|?)".
Other settings in the properties file like "org.exolab.castor.builder.javaVersion=5.0" have an effect, so the property file is read.

Activity

Hide
Werner Guttmann added a comment -

Matthias, a few clarifications:

a) You'll need to leave the 'org.exolab.castor.builder.nameConflictStrategies' as is in castorbuilder.properties. This property enlists the conflict strategies available, is is not meant to be a means of selecting one or another.

b) SourceGenerator.java has already a new setter that allows one to select one of the available strategies

c) The Ant task for XML code generation still needs to be modified to allow configuration of the strategy to be used.

Show
Werner Guttmann added a comment - Matthias, a few clarifications: a) You'll need to leave the 'org.exolab.castor.builder.nameConflictStrategies' as is in castorbuilder.properties. This property enlists the conflict strategies available, is is not meant to be a means of selecting one or another. b) SourceGenerator.java has already a new setter that allows one to select one of the available strategies c) The Ant task for XML code generation still needs to be modified to allow configuration of the strategy to be used.
Hide
Werner Guttmann added a comment -

Initial patch for review. This patch basically adds a new property to the Ant task for the XML code generator.

Show
Werner Guttmann added a comment - Initial patch for review. This patch basically adds a new property to the Ant task for the XML code generator.
Hide
Werner Guttmann added a comment -

Added information about the 'nameConflictStrategy' to the HTML docs.

Show
Werner Guttmann added a comment - Added information about the 'nameConflictStrategy' to the HTML docs.
Hide
Werner Guttmann added a comment -

Matthias, any chances you could apply the patch and build the JARs yourself, and provide me with feedback ?

Show
Werner Guttmann added a comment - Matthias, any chances you could apply the patch and build the JARs yourself, and provide me with feedback ?
Hide
Matthias Hanisch added a comment -

Yes. Will look on that (and also on the other open issues) during this day.

Show
Matthias Hanisch added a comment - Yes. Will look on that (and also on the other open issues) during this day.
Hide
Matthias Hanisch added a comment -

Ok. Works within castor-srcgen ant task.

Show
Matthias Hanisch added a comment - Ok. Works within castor-srcgen ant task.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: