if ( datatype.isSequenced() )
{
complexType.setMixed(true);
XSDModelGroup choice = xsdFactory.createXSDModelGroup();
choice.setCompositor(XSDCompositor.CHOICE_LITERAL);
XSDParticle aParticle = xsdFactory.createXSDParticle();
aParticle.setContent(choice);
aParticle.setMaxOccurs(-1);
complexType.setContent(aParticle);
}
else
{
//hack to handle group property as choice
/*if ( getPropertyStartsWithName(datatype.getDeclaredProperties(), GROUP).size() > 0 )
{
XmlSchemaChoice choice = new XmlSchemaChoice();
choice.setMaxOccurs(Long.MAX_VALUE);
complexType.setParticle(choice);
}
else*/
{
XSDModelGroup sequence = xsdFactory.createXSDModelGroup();
sequence.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
XSDParticle aParticle = xsdFactory.createXSDParticle();
aParticle.setContent(sequence);
complexType.setContent(aParticle);
}
}
}