How to write an external binding file for xjc?

前端 未结 1 1037
梦如初夏
梦如初夏 2021-02-04 04:27

The documentation of JAXB xjc says:

-b Specify one or more external binding files to process. (Each binding file must have it\'s own \"-b\" switch.

1条回答
  •  北恋
    北恋 (楼主)
    2021-02-04 05:18

    The external binding file is documented on the Customizing JAXB Bindings page on oracle.com

    Quote:

    External Binding Customization Files

    Customizations to JAXB bindings made by means of an external file containing binding declarations take the general form shown below.

    
       *
          
       
     
    

    schemaLocation is a URI reference to the remote schema node is an XPath 1.0 expression that identifies the schema node within schemaLocation to which the given binding declaration is associated. For example, the first schemaLocation/node declaration in a JAXB binding declarations file specifies the schema name and the root schema node:

     
    

    A subsequent schemaLocation/node declaration, say for a simpleType element named ZipCodeType in the above schema, would take the form:

     
    

    See also; the JAXB Compiler Options


    Another good resource for information on the external binding file is oreilly. An example binding file from oreilly is:

    Quote:

    Listing 11. Using An External Binding File

    
        
            
                
                
            
            
                
            
        
    
    

    0 讨论(0)
提交回复
热议问题