Hi All,
 
Regarding the implementation of complex content restriction,
 
I need to check each element that is going to be written with its correspondent in the base type.
For each element in the complex content restriction I'm thinking of following these rules:
 
1) if an optional element is missing from the base type,
    override the getter and setter corresponding to the element and throw appropriate exceptions.   
2) if the type of the element is a subtype of its corresponding type in the base type,
    write the element and its getter and setter as a not inherited field in the class.
3) if the minOccurs and maxOccurs differs, (????)
4) if the attributes of the restricted type are different, (????),
    Also please note that processing attributes are not handled completely in the current version.
 
So far we have two cases, either I should write the element completely as a field with its getter and setter
or just overriding the getter and setter.
 
* In (1) the DOM tree generated in the JavaBeanWriter.addPropertyEntries(...) needs to be edited
  since the removed element is not an inherited element any more. There are two approaches here, either adding a "isRestricted"
  attribute to the property nodes or we can have separate nodes named "restricted" per missing elements.
  But, in order to edit this tree I need to have the root element of the tree, but some how it returns null when I    use:   
  Element root = model.getDocumentElement();
 
* In (2) just another element is added to the tree like before.  
 
* I need suggestions on (3) and (4).
 
Comments are appreciated ...
 
Thanks,
Maryam
 
 

Reply via email to