boolean isChoice = (parentCompositor instanceof Choice);
ComplexType parentType = type;
if (!helper.isAnnotationPresent(next.getElement(), XmlTransient.class)) {
// deal with the XmlElementWrapper case
if (!isChoice && helper.isAnnotationPresent(next.getElement(), XmlElementWrapper.class)) {
XmlElementWrapper wrapper = (XmlElementWrapper) helper.getAnnotation(next.getElement(), XmlElementWrapper.class);
Element wrapperElement = new Element();
String name = wrapper.name();
if (name.equals("##default")) {
name = next.getPropertyName();
}
// handle nillable
wrapperElement.setNillable(wrapper.nillable());
// namespace in not the target or ##default, create a ref with min/max = 1
String wrapperNS = wrapper.namespace();
if (!wrapperNS.equals("##default") && !wrapperNS.equals(schema.getTargetNamespace())) {
wrapperElement.setMinOccurs(Occurs.ONE);
wrapperElement.setMaxOccurs(Occurs.ONE);
String prefix = getPrefixForNamespace(wrapperNS, schema.getNamespaceResolver());