public void foundElementsInChoice(ChoiceEvent cEvent) {
if(cEvent.isMultiple()) {
jibx.addCollection(cEvent.isWrapped()?cEvent.getName():null, cEvent.getName(), cEvent.isNillable());
for(int i=0;i<cEvent.getElementEvents().size();i++) {
ElementEvent eEvent = (ElementEvent)cEvent.getElementEvents().get(i);
if(eEvent.isComplexType()) {
jibx.addStructureToCollection(eEvent.getName(), null, cEvent.getNs(),
nsContext.getTypeNS(eEvent.getTypeQName()), eEvent.isNillable(), eEvent.isOptional());
if(cEvent.isNillable()) jibx.getCurrentStructure().setType(eEvent.getJavaQName().toString());
addNamespace(cEvent.getNs(), "none");
} else {
jibx.addValueToCollection(eEvent.getName(), null, cEvent.getNs(),
eEvent.getJavaQName().toString(), eEvent.isNillable(), eEvent.isOptional());
addNamespace(cEvent.getNs(), "none");
}
}
} else {
jibx.addStructure(null, cEvent.getName(), null, cEvent.isNillable(), cEvent.isOptional());
jibx.getCurrentStructure().setChoice(true);
jibx.getCurrentStructure().setOrdered(Boolean.FALSE.toString());
for(int i=0;i<cEvent.getElementEvents().size();i++) {
ElementEvent eEvent = (ElementEvent)cEvent.getElementEvents().get(i);
JibxStructure struct = jibx.addStructureToStructure(eEvent.getName(), null,
nsContext.getTypeNS(eEvent.getTypeQName()), eEvent.isNillable(), eEvent.isOptional());
struct.setNs(eEvent.getTypeQName().getNamespaceURI());
if(cEvent.isNillable()) struct.setType(eEvent.getJavaQName().toString());
}
}
}