return eEnum; }
return eEnum;
  protected EEnum computeEEnum(XSDSimpleTypeDefinition xsdSimpleTypeDefinition)  {    // If it has enumerators and each one is a valid Java identifier.    //    if (!xsdSimpleTypeDefinition.getEnumerationFacets().isEmpty())    {      List enumerators = new ArrayList();      LOOP:      for (Iterator i = xsdSimpleTypeDefinition.getEnumerationFacets().iterator();            i.hasNext(); )      {        XSDEnumerationFacet xsdEnumerationFacet = (XSDEnumerationFacet)i.next();        String enumerator = xsdEnumerationFacet.getLexicalValue();        if (enumerator != null && enumerator.length() != 0)        {          if (Character.isJavaIdentifierStart(enumerator.charAt(0)))          {            for (int j = enumerator.length() - 1; j > 0; --j)            {              if (!Character.isJavaIdentifierPart(enumerator.charAt(j)))              {                enumerators.clear();                break LOOP;              }            }          }          else          {            enumerators.clear();            break;          }          enumerators.add(xsdEnumerationFacet);          continue;        }        enumerators.clear();        break;      }      if (!enumerators.isEmpty())      {        EEnum eEnum = EcoreFactory.eINSTANCE.createEEnum();        setAnnotations(eEnum, xsdSimpleTypeDefinition);        String name = getEcoreAttribute(xsdSimpleTypeDefinition, "name");        if (name == null)        {          name = validName(xsdSimpleTypeDefinition.getAliasName(), true);        }        eEnum.setName(name);        extendedMetaData.setName(eEnum, xsdSimpleTypeDefinition.getAliasName());        EPackage ePackage = getEPackage(xsdSimpleTypeDefinition);        addToSortedList(ePackage.getEClassifiers(), eEnum);        for (ListIterator i = enumerators.listIterator(); i.hasNext(); )        {          XSDEnumerationFacet xsdEnumerationFacet = (XSDEnumerationFacet)i.next();          String enumerator = xsdEnumerationFacet.getLexicalValue();          EEnumLiteral eEnumLiteral = EcoreFactory.eINSTANCE.createEEnumLiteral();          setAnnotations(eEnumLiteral, xsdEnumerationFacet);          eEnumLiteral.setName(enumerator);          eEnumLiteral.setValue(i.previousIndex());          eEnum.getELiterals().add(eEnumLiteral);          map(xsdEnumerationFacet, eEnumLiteral);        }        checkForPrimitive(eEnum);        return eEnum;      }    }    return null;  }