What's the purpose of minOccurs, nillable and restriction?

后端 未结 5 1906
故里飘歌
故里飘歌 2021-02-02 13:44

Documentation for required says:

If required() is true, then Javabean property is mapped to an XML schema ele

5条回答
  •  甜味超标
    2021-02-02 14:35

    I looked into the XSD structure that you have posted - and find that you have not used complex type that you have defined for the month , Insteqad of handling it on java code you can mention that all in XSD , and also the minOccur on month - element in your complex type is missing . Please use any standered XSD to java generator , it will do all the java file generation task for you

    The convention are as follow - 
    
    MinOccur = 0 --> the element can be abscent in input , and can be present
    
    MinOccur = 1 --> the element must be there in input
    (but if you use it, then your java generated member will be of list type - list of ENUM for Int )
    
    If you don't write MinOccur in attributes - then it makes the element mandatory , ( then you java generated member will be of simply ENUM for int )
    
    
    MaxOccur = 1 --> minimum one element can be there in input 
    (but if you use it, then your java generated member will be of list type - list of ENUM for Int )
    
    
    MaxOccur = unbound --> only one element can be there in input 
    (if you use it, then your java generated member will be of list type - list of ENUM for Int )
    
       
      
        
        
      
    
    
    
      
        
        
        
        
        
        
        
      
    
    

提交回复
热议问题