What is an .episode file..?

后端 未结 4 1277
失恋的感觉
失恋的感觉 2020-11-29 07:57

what is a .episode file in JAXB..? Is it generated by the JAXB or is it a configuration file that we\'d manipulate to avoid regeneration of the same classes by JAXB..?

4条回答
  •  粉色の甜心
    2020-11-29 08:27

    Note: I'm the EclipseLink JAXB (MOXy) lead and a member of the JAXB 2 (JSR-222) expert group.

    A .episode file is generated by the XJC (XML Schema to Java) compiler. It is a schema bindings that associates schema types with existing classes. It is useful when you have one XML schema that is imported by other schemas as it prevents the model from being regenerated. Below is an example:

    Product.xsd

    
    
        
            
                
                    
                    
                
            
        
    
    

    Since multiple XML schemas import Product.xsd we can leverage episode files so that the classes corresponding to Product.xsd are only generated once.

    xjc -d out -episode product.episode Product.xsd
    

    ProductPurchaseRequest.xsd

    Below is an example of an XML schema that imports Product.xsd:

    
    
        
        
            
                
                    
                
            
        
    
    

    When we generate classes from this XML schema we will reference the episode file we created when we generated Java classes from Product.xsd.

    xjc -d out ProductPurchaseRequest.xsd -extension -b product.episode
    

    ProductQuoteRequest.xsd

    Below is another example of an XML schema that imports Product.xsd:

    
    
        
        
            
                
                    
                
            
        
    
    

    Again when we generate classes from this XML schema we will reference the episode file we created when we generated Java classes from Product.xsd.

    xjc -d out ProductQuoteRequest.xsd -extension -b product.episode
    

    For More Information

    • http://blog.bdoughan.com/2011/12/reusing-generated-jaxb-classes.html

提交回复
热议问题