info.setClassName(javaClass.getQualifiedName());
Class restrictionClass = String.class;
QName restrictionBase = getSchemaTypeFor(helper.getJavaClass(restrictionClass));
if (helper.isAnnotationPresent(javaClass, XmlEnum.class)) {
XmlEnum xmlEnum = (XmlEnum) helper.getAnnotation(javaClass, XmlEnum.class);
restrictionClass = xmlEnum.value();
JavaClass restrictionJavaClass= helper.getJavaClass(restrictionClass);
boolean restrictionIsEnum = helper.isAnnotationPresent(restrictionJavaClass, XmlEnum.class);
if(!restrictionIsEnum){
restrictionBase = getSchemaTypeFor(helper.getJavaClass(restrictionClass));
}else{
while (restrictionIsEnum) {
TypeInfo restrictionTypeInfo = typeInfo.get(restrictionJavaClass.getQualifiedName());
if(restrictionTypeInfo == null && shouldGenerateTypeInfo(restrictionJavaClass)){
JavaClass[] jClasses = new JavaClass[] { restrictionJavaClass };
buildNewTypeInfo(jClasses);
restrictionTypeInfo = typeInfo.get(restrictionJavaClass.getQualifiedName());
}
restrictionBase = new QName(restrictionTypeInfo.getClassNamespace(), restrictionTypeInfo.getSchemaTypeName());
xmlEnum = (XmlEnum) helper.getAnnotation(restrictionJavaClass, XmlEnum.class);
restrictionClass = xmlEnum.value();
restrictionJavaClass= helper.getJavaClass(restrictionClass);
restrictionIsEnum = helper.isAnnotationPresent(restrictionJavaClass, XmlEnum.class);
}
}
}