* @param properties
* @param descriptors
* @param isCollection
*/
protected void processChoiceMapping(Map<Field, Class> fieldToClassMap, List<XMLChoiceFieldToClassAssociation> choiceFieldToClassList, Sequence seq, ComplexType ct, HashMap<String, Schema> schemaForNamespace, Schema workingSchema, SchemaModelGeneratorProperties properties, List<Descriptor> descriptors, boolean isCollection) {
Choice theChoice = new Choice();
if (isCollection) {
theChoice.setMaxOccurs(Occurs.UNBOUNDED);
}
for (XMLChoiceFieldToClassAssociation next : choiceFieldToClassList) {
Field field = next.getXmlField();
Element element = buildElement(field.getXPathFragment().getShortName(), Occurs.ZERO, null);
QName schemaTypeQName = field.getSchemaType();
if (schemaTypeQName != null) {
element.setType(getSchemaTypeString(schemaTypeQName, workingSchema));
} else {
element = processReferenceDescriptor(element, getDescriptorByClass(fieldToClassMap.get(field), descriptors), schemaForNamespace, workingSchema, properties, descriptors, field, false);
}
theChoice.addElement(element);
}
seq.addChoice(theChoice);
}