} else if (particle instanceof XmlSchemaAll) {
List<XmlSchemaElement> items = ((XmlSchemaAll) particle).getItems();
processSchemaAllItems(parentElementQName, items, metainfHolder, false, parentSchema);
} else if (particle instanceof XmlSchemaChoice) {
XmlSchemaChoice xmlSchemaChoice = (XmlSchemaChoice) particle;
List<XmlSchemaObject> items = ((XmlSchemaChoice) particle).getItems();
if ((xmlSchemaChoice.getMaxOccurs() > 1)) {
// we have to process many sequence types
BeanWriterMetaInfoHolder beanWriterMetaInfoHolder = new BeanWriterMetaInfoHolder();
beanWriterMetaInfoHolder.setChoice(true);
processChoiceItems(parentElementQName, items, beanWriterMetaInfoHolder, false,
parentSchema);
beanWriterMetaInfoHolder.setParticleClass(true);
QName choiceQName = new QName(parentElementQName.getNamespaceURI(),
parentElementQName.getLocalPart() + "Choice");
String javaClassName = writeComplexParticle(choiceQName, beanWriterMetaInfoHolder);
processedTypemap.put(choiceQName, javaClassName);
// add this as an array to the original class
metainfHolder.registerMapping(choiceQName,
choiceQName,
findClassName(choiceQName, true),
SchemaConstants.ARRAY_TYPE);
metainfHolder.setOrdered(true);
metainfHolder.setHasParticleType(true);
metainfHolder.registerQNameIndex(choiceQName, metainfHolder.getOrderStartPoint() + 1);
metainfHolder.addtStatus(choiceQName, SchemaConstants.PARTICLE_TYPE_ELEMENT);
metainfHolder.addMaxOccurs(choiceQName, xmlSchemaChoice.getMaxOccurs());
metainfHolder.addMinOccurs(choiceQName, xmlSchemaChoice.getMinOccurs());
} else {
metainfHolder.setChoice(true);
processChoiceItems(parentElementQName, items, metainfHolder, false, parentSchema);
}