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){
if(helper.isBuiltInJavaType(restrictionJavaClass)){
restrictionBase = getSchemaTypeFor(helper.getJavaClass(restrictionClass));
}else{
TypeInfo restrictionInfo = typeInfo.get(restrictionJavaClass.getQualifiedName());
if(restrictionInfo == null){
JavaClass[] jClasses = new JavaClass[] { restrictionJavaClass };
buildNewTypeInfo(jClasses);
restrictionInfo = typeInfo.get(restrictionJavaClass.getQualifiedName());
}else if(restrictionInfo != null && !restrictionInfo.isPostBuilt()){
postBuildTypeInfo(new JavaClass[] { restrictionJavaClass });
}
Property xmlValueProp =restrictionInfo.getXmlValueProperty();
if(xmlValueProp != null){
restrictionJavaClass = xmlValueProp.getActualType();
restrictionBase = getSchemaTypeFor(restrictionJavaClass);
restrictionClass = helper.getClassForJavaClass(restrictionJavaClass);
}
}
}else{
while (restrictionIsEnum) {
TypeInfo restrictionTypeInfo = processReferencedClass(restrictionJavaClass);
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);
}
}
}