JAXB - Property “Value” is already defined. Use to resolve this conflict

前端 未结 7 600
再見小時候
再見小時候 2020-11-30 19:01

Using JAXB to generate XML binding classes.

The schema is based on a set of legacy XML files, and includes this snippet:



        
7条回答
  •  无人及你
    2020-11-30 19:57

    The answer lies in making use of JAXB bindings (site-template.xjb):

    
        
            
            
                
            
    
            
            
                
                    
                
            
        
    
    

    The XPath expressions locate the nodes and renames it, thereby avoiding the naming conflict.

    Using this bindings XML file, the generated Java class ends up having the desired getValueAttribute() (as well as the getValue()).

提交回复
热议问题