if (xmlEnum != null)
xmlEnumValue = xmlEnum.value();
TypeInfo enumType = typeInfo.getTypeInfoFactory().getTypeInfo(xmlEnumValue);
// Resolve the enum type as the parent (must be simple)
TypeBinding parent = getSimpleType(enumType);
// Create the enum type
QName qName = null;
TypeBinding typeBinding = null;
if (root)
{
qName = generateXmlName(typeInfo, XmlNsForm.QUALIFIED, overrideNamespace, overrideName);
typeBinding = new TypeBinding(qName, parent);
}
else
{
typeBinding = new TypeBinding(null, parent);
}
typeBinding.setValueAdapter(new EnumValueAdapter(qName, typeInfo, enumType));
if (trace)
log.trace("Created enum=" + typeInfo.getName() + " type=" + typeBinding + " rootType=" + root);
// Bind it as a global type
if (root)
schemaBinding.addType(typeBinding);
else
typeBinding.setSchemaBinding(schemaBinding);
return typeBinding;
}