}
if(areEquals(pType, Object.class)) {
setTypedTextField(xmlField);
}
Mapping nestedMapping;
AbstractNullPolicy nullPolicy = null;
if(isCollection){
ChoiceCollectionMapping xmlChoiceCollectionMapping = (ChoiceCollectionMapping) mapping;
xmlChoiceCollectionMapping.addChoiceElement(xmlField, element.getJavaTypeName());
nestedMapping = (Mapping) xmlChoiceCollectionMapping.getChoiceElementMappings().get(xmlField);
if(nestedMapping.isAbstractCompositeCollectionMapping()){
((CompositeCollectionMapping)nestedMapping).setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
nullPolicy = ((CompositeCollectionMapping)nestedMapping).getNullPolicy();
}
if (nestedMapping.isAbstractCompositeDirectCollectionMapping()) {
DirectCollectionMapping nestedCompositeDirectCollectionMapping = (DirectCollectionMapping) nestedMapping;
nullPolicy = nestedCompositeDirectCollectionMapping.getNullPolicy();
if(pType.isEnum()) {
TypeInfo enumTypeInfo = typeInfo.get(pType.getQualifiedName());
nestedCompositeDirectCollectionMapping.setValueConverter(buildJAXBEnumTypeConverter(nestedCompositeDirectCollectionMapping, (EnumTypeInfo) enumTypeInfo));
}
if(element.isList()){
XMLListConverter listConverter = new XMLListConverter();
listConverter.setObjectClassName(element.getJavaType().getQualifiedName());
((DirectCollectionMapping)nestedMapping).setValueConverter(listConverter);
}
}else if(nestedMapping instanceof BinaryDataCollectionMapping){
nullPolicy = ((BinaryDataCollectionMapping)nestedMapping).getNullPolicy();
}
} else {
ChoiceObjectMapping xmlChoiceObjectMapping = (ChoiceObjectMapping) mapping;
xmlChoiceObjectMapping.addChoiceElement(xmlField, element.getJavaTypeName());
nestedMapping = (Mapping) xmlChoiceObjectMapping.getChoiceElementMappings().get(xmlField);
if(pType.isEnum()) {
TypeInfo enumTypeInfo = typeInfo.get(pType.getQualifiedName());
((DirectMapping)nestedMapping).setConverter(buildJAXBEnumTypeConverter(nestedMapping, (EnumTypeInfo) enumTypeInfo));
}
if(nestedMapping.isAbstractCompositeObjectMapping()){
((CompositeObjectMapping)nestedMapping).setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
nullPolicy = ((CompositeObjectMapping)nestedMapping).getNullPolicy();
}else if(nestedMapping instanceof BinaryDataMapping){
nullPolicy = ((BinaryDataMapping)nestedMapping).getNullPolicy();
}else if(nestedMapping instanceof DirectMapping){
nullPolicy = ((DirectMapping)nestedMapping).getNullPolicy();
}
}
if(nullPolicy != null){
nullPolicy.setNullRepresentedByEmptyNode(false);
nullPolicy.setMarshalNullRepresentation(XMLNullRepresentationType.XSI_NIL);
nullPolicy.setNullRepresentedByXsiNil(true);
}
if (!element.isXmlRootElement()) {
Class scopeClass = element.getScopeClass();
if (scopeClass == javax.xml.bind.annotation.XmlElementDecl.GLOBAL.class){
scopeClass = JAXBElement.GlobalScope.class;