* @return
*/
public static boolean isArrayWrapper(XmlSchemaComplexType complexType) {
if(complexType==null) return false;
if(complexType.getAttributes().getCount()>0) return false;
XmlSchemaObjectCollection items = null;
XmlSchemaContentModel contentModel = complexType.getContentModel();
if(contentModel!=null)
return false;
XmlSchemaParticle particle = complexType.getParticle();
if(particle==null) {
return false;
} else if(particle instanceof XmlSchemaSequence) {
XmlSchemaSequence sequence = (XmlSchemaSequence)particle;
items = sequence.getItems();
} else if(particle instanceof XmlSchemaChoice) {
XmlSchemaChoice choice = (XmlSchemaChoice)particle;
if(choice.getMaxOccurs()>1) return true;
} else if(particle instanceof XmlSchemaAll) {
XmlSchemaAll all = (XmlSchemaAll)particle;
items = all.getItems();
} else {
return false;
}
// sequence & all
if(items==null) return false;
if(items.getCount()!=1) return false;
XmlSchemaElement element = (XmlSchemaElement)items.getItem(0);
if(element.getMaxOccurs()<2) return false;
return true;
}