final FactoryState state) {
//------------------------------/
//- handle elements and groups -/
//------------------------------/
ContentModelGroup contentModel = model;
Enumeration<Annotated> enumeration = contentModel.enumerate();
//-- handle choice item
if (new XMLInfoNature(state.getClassInfo()).isChoice()
&& state.getFieldInfoForChoice() == null) {
state.setFieldInfoForChoice(_memberFactory.createFieldInfoForChoiceValue());
state.getFieldInfoForChoice().getMemberAndAccessorFactory().createJavaField(
state.getFieldInfoForChoice(),
state.getJClass());
state.getFieldInfoForChoice().getMemberAndAccessorFactory().createAccessMethods(
state.getFieldInfoForChoice(), state.getJClass(), getConfig().useJava50(),
getConfig().getAnnotationBuilders());
}
FieldInfo fieldInfo = null;
XMLBindingComponent component = new XMLBindingComponent(getConfig(), getGroupNaming());
if (_binding != null) {
component.setBinding(_binding);
}
while (enumeration.hasMoreElements()) {
Annotated annotated = enumeration.nextElement();
component.setView(annotated);
switch (annotated.getStructureType()) {
case Structure.ELEMENT: //-- handle element declarations
fieldInfo = _memberFactory.createFieldInfo(
component, state, getConfig().useJava50());
//-- Fix for element declarations being used in
//-- a group with minOccurs = 0;
//-- (kvisco - 20021007)
if (contentModel.getMinOccurs() == 0) {
XMLInfoNature xmlNature = new XMLInfoNature(fieldInfo);
xmlNature.setRequired(false);
}
handleField(fieldInfo, state, component);
break;
case Structure.GROUP: //-- handle groups
Group group = (Group) annotated;
//set the compositor
if ((contentModel instanceof ComplexType)
|| (contentModel instanceof ModelGroup)) {
if (group.getOrder() == Order.choice) {
new XMLInfoNature(state.getClassInfo()).getGroupInfo().setAsChoice();
} else if (group.getOrder() == Order.all) {
new XMLInfoNature(state.getClassInfo()).getGroupInfo().setAsAll();
} else if (group.getOrder() == Order.sequence) {
new XMLInfoNature(state.getClassInfo()).getGroupInfo().setAsSequence();
}
}
//-- create class member,if necessary
if (!((contentModel instanceof ComplexType)
|| (contentModel instanceof ModelGroup))) {
if (contentModel instanceof ModelGroup) {
ModelGroup mg = (ModelGroup) contentModel;
if (mg.isReference()) {
contentModel = mg.getReference();
}
}
if (contentModel.getParticleCount() > 0) {
fieldInfo = _memberFactory.createFieldInfo(
component, state.getSGStateInfo(), getConfig().useJava50());
handleField(fieldInfo, state, component);
}
} else {