org.eclipse.xsd_2.7.1.v20120130-0943

ERAL, "_UI_UnresolvedTypeDefinition_message", "");
    } else if (theBaseTypeDefinition.getContainer() == null) {
      createDiagnostic(XSDDiagnosticSeverity.ERROR_LITERAL, "_UI_UnresolvedTypeDefinition_message", theBaseTypeDefinition.getURI());
    } else if (isSetVariety()) {
      switch (getVariety().getValue())
      {
      case 0: 
        if (theBaseTypeDefinition.getFinal().contains(XSDSimpleFinal.RESTRICTION_LITERAL)) {
          createDiagnostic(XSDDiagnosticSeverity.ERROR_LITERAL, "cos-st-restricts.1.2", theBaseTypeDefinition.getURI());
        }
        if (isCircular()) {
          reportConstraintViolation(
            "http://www.w3.org/TR/xmlschema-2/", 
            "st-props-correct.2", 
            getElement(), 
            "base", 
            new Object[0]);
        }
        if ((XSDConstants.isSchemaForSchemaNamespace(getTargetNamespace())) || 
          (!XSDConstants.isAnySimpleType(theBaseTypeDefinition)) || (
          (theElement != null) && (
          (theRestrictionElement == null) || (!theRestrictionElement.hasAttributeNS(null, "base"))))) {
          break;
        }
        createDiagnostic(XSDDiagnosticSeverity.ERROR_LITERAL, "cos-st-retricts.0.0", theBaseTypeDefinition.getURI());
        
        break;
      case 1: 
        if (!XSDConstants.isURType(theBaseTypeDefinition))
        {
          if (theBaseTypeDefinition.getFinal().contains(XSDSimpleFinal.RESTRICTION_LITERAL)) {
            createDiagnostic(XSDDiagnosticSeverity.ERROR_LITERAL, "cos-st-restricts.1.2", theBaseTypeDefinition.getURI());
          }
        }
        else
        {
          XSDSimpleTypeDefinition theItemTypeDefinition = getItemTypeDefinition();
          if (theItemTypeDefinition == null) {
            createDiagnostic(XSDDiagnosticSeverity.ERROR_LITERAL, "_UI_UnresolvedTypeDefinition_message", "");
          } else if (theItemTypeDefinition.getContainer() == null) {
            createDiagnostic(
              XSDDiagnosticSeverity.ERROR_LITERAL, "_UI_UnresolvedTypeDefinition_message", theItemTypeDefinition.getURI());
          } else if ((XSDVariety.ATOMIC_LITERAL != theItemTypeDefinition.getVariety()) && 
            (XSDVariety.UNION_LITERAL != theItemTypeDefinition.getVariety())) {
            reportConstraintViolation(
              "http://www.w3.org/TR/xmlschema-2/", 
              "cos-list-of-atomic", 
              getElement(), 
              "itemType", 
              new Object[0]);
          } else if (theItemTypeDefinition.getFinal().contains(XSDSimpleFinal.LIST_LITERAL)) {
            createDiagnostic(XSDDiagnosticSeverity.ERROR_LITERAL, "cos-st-restricts.2.0", theBaseTypeDefinition.getURI());
          } else if ((!XSDConstants.isSchemaForSchemaNamespace(getTargetNamespace())) && 
            (XSDConstants.isAnySimpleType(theItemTypeDefinition))) {
            createDiagnostic(XSDDiagnosticSeverity.ERROR_LITERAL, "cos-st-retricts.0.1", theItemTypeDefinition.getURI());
          }
        }
        if (!isCircular()) {
          break;
        }
        reportConstraintViolation(
          "http://www.w3.org/TR/xmlschema-2/", 
          "st-props-correct.2", 
          getElement(), 
          "itemType", 
          new Object[0]);
        
        break;
      case 2: 
        if (!XSDConstants.isURType(theBaseTypeDefinition))
        {
          if (theBaseTypeDefinition.getFinal().contains(XSDSimpleFinal.RESTRICTION_LITERAL)) {
            createDiagnostic(XSDDiagnosticSeverity.ERROR_LITERAL, "cos-st-restricts.1.2", theBaseTypeDefinition.getURI());
          }
        }
        else {
          for (XSDSimpleTypeDefinition theMemberTypeDefinition : getMemberTypeDefinitions()) {
            if (theMemberTypeDefinition == null) {
              createDiagnostic(XSDDiagnosticSeverity.ERROR_LITERAL, "_UI_UnresolvedTypeDefinition_message", "");
            } else if (theMemberTypeDefinition.getContainer() == null) {
              createDiagnostic(
                XSDDiagnosticSeverity.ERROR_LITERAL, "_UI_UnresolvedTypeDefinition_message", theMemberTypeDefinition.getURI());
            } else if (theMemberTypeDefinition.getFinal().contains(XSDSimpleFinal.UNION_LITERAL)) {
              createDiagnostic(XSDDiagnosticSeverity.ERROR_LITERAL, "cos-st-restricts.3.0", theBaseTypeDefinition.getURI());
            }
          }
        }
        if (!isCircular()) {
          break;
        }
        reportConstraintViolation(
          "http://www.w3.org/TR/xmlschema-2/", 
          "cos-no-circular-unions", 
          getElement(), 
          "memberTypes", 
          new Object[0]);
      }
    } else if (isCircular()) {
      reportConstraintViolation(
        "http://www.w3.org/TR/xmlschema-2/", 
        "st-props-correct.2", 
        getElement(), 
        "base", 
        new Object[0]);
    }
  }
  
  protected void reconcileAttributes(Element changedElement)
  {
    switch (XSDConstants.nodeType(changedElement))
    {
    case 13: 
    case 32: 
      if (!(getContainer() instanceof XSDComplexTypeDefinition))
      {
        XSDSimpleTypeDefinition newBaseTypeDefinition = null;
        if (changedElement.hasAttributeNS(null, "base")) {
          newBaseTypeDefinition = 
            resolveSimpleTypeDefinitionURI(XSDConstants.lookupQNameForAttribute(changedElement, "base"));
        } else if (getContents().contains(getBaseTypeDefinition())) {
          newBaseTypeDefinition = getBaseTypeDefinition();
        }
        handleNewBaseTypeDefinition(newBaseTypeDefinition);
      }
      else
      {
        XSDTypeDefinition newBaseTypeDefinition = null;
        if (changedElement.hasAttributeNS(null, "base")) {
          newBaseTypeDefinition = 
            resolveTypeDefinitionURI(XSDConstants.lookupQNameForAttribute(changedElement, "base"));
        } else if (getContents().contains(getBaseTypeDefinition())) {
          newBaseTypeDefinition = getBaseTypeDefinition();
        }
        handleNewComplexBaseTypeDefinition(newBaseTypeDefinition);
      }
      break;
    case 22: 
      XSDSimpleTypeDefinition newItemTypeDefinition = getItemTypeDefinition();
      if (changedElement.hasAttributeNS(null, "itemType")) {
        newItemTypeDefinition = 
          resolveSimpleTypeDefinitionURI(XSDConstants.lookupQNameForAttribute(changedElement, "itemType"));
      } else if (!getContents().contains(newItemTypeDefinition)) {
        newItemTypeDefinition = resolveSimpleTypeDefinition(null, "undefined");
      }
      if (newItemTypeDefinition != getItemTypeDefinition()) {
        setItemTypeDefinition(newItemTypeDefinition);
      }
      handleNewBaseTypeDefinition(null);
      break;
    case 39: 
      List<XSDSimpleTypeDefinition> newMemberTypeDefinitions = new ArrayList();
      if (changedElement.hasAttributeNS(null, "memberTypes"))
      {
        String memberTypes = changedElement.getAttributeNS(null, "memberTypes");
        if (memberTypes != null) {
          for (StringTokenizer tokens = new StringTokenizer(memberTypes, " "); tokens.hasMoreTokens();)
          {
            String memberTypeQName = tokens.nextToken();
            XSDSimpleTypeDefinition newMemberTypeDefinition = 
              resolveSimpleTypeDefinitionURI(XSDConstants.lookupQName(changedElement, memberTypeQName));
            newMemberTypeDefinitions.add(newMemberTypeDefinition);
          }
        }
      }
      newMemberTypeDefinitions.addAll(getContents());
      
      List<XSDSimpleTypeDefinition> remainingMemberTypeDefinitions = new ArrayList(getMemberTypeDefinitions());
      remainingMemberTypeDefinitions.removeAll(newMemberTypeDefinitions);
      getMemberTypeDefinitions().removeAll(remainingMemberTypeDefinitions);
      if (!newMemberTypeDefinitions.isEmpty()) {
        setListContentAndOrder(getMemberTypeDefinitions(), newMemberTypeDefinitions);
      }
      handleNewBaseTypeDefinition(null);
      break;
    case 36: 
    case 37: 
      super.reconcileAttributes(changedElement);
      if (changedElement.hasAttributeNS(null, "final")) {
        setStringLexicalFinal(changedElement.getAttributeNS(null, "final"));
      } else if (isSetLexicalFinal()) {
        unsetLexicalFinal();
      }
      for (Node child = changedElement.getFirstChild(); child != null; child = child.getNextSibling()) {
        if (child.getNodeType() == 1) {
          reconcileAttributes((Element)child);
        }
      }
    }
  }
  
  protected void handleNewComplexBaseTypeDefinition(XSDTypeDefinition newComplexBaseTypeDefinition)
  {
    if ((getContainer() instanceof XSDComplexTypeDefinition))
    {
      XSDComplexTypeDefinitionImpl xsdComplexTypeDefinition = (XSDComplexTypeDefinitionImpl)getContainer();
      boolean oldIsReconciling = isReconciling;
      isReconciling = isReconciling;
      xsdComplexTypeDefinition.handleNewBaseTypeDefinition(newComplexBaseTypeDefinition);
      isReconciling = oldIsReconciling;
    }
  }
  
  protected XSDSimpleTypeDefinition handleNewBaseTypeDefinition(XSDSimpleTypeDefinition newBaseTypeDefinition)
  {
    if (newBaseTypeDefinition == null)
    {
      XSDSchema xsdSchema = getSchema();
      if (xsdSchema == null)
      {
        Element theElement = getElement();
        if (theElement != null) {
          newBaseTypeDefinition = 
            XSDSchemaImpl.getSchemaForSchema(theElement.getNamespaceURI()).resolveSimpleTypeDefinition("anySimpleType");
        } else {
          newBaseTypeDefinition = this;
        }
      }
      else
      {
        newBaseTypeDefinition = xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("anySimpleType");
      }
    }
    if ((eContainer instanceof XSDRedefine))
    {
      XSDSchema redefinedSchema = ((XSDRedefine)eContainer).getIncorporatedSchema();
      if (redefinedSchema != null)
      {
        Map<XSDComponent, XSDComponent> redefinitionMap = ((XSDSchemaImpl)redefinedSchema).getRedefinitionMap();
        if (redefinitionMap.containsKey(newBaseTypeDefinition))
        {
          XSDComponent replacement = (XSDComponent)redefinitionMap.get(this);
          if (replacement != null) {
            newBaseTypeDefinition = (XSDSimpleTypeDefinition)replacement;
          }
        }
      }
    }
    if (newBaseTypeDefinition != getBaseTypeDefinition()) {
      setBaseTypeDefinition(newBaseTypeDefinition);
    }
    return newBaseTypeDefinition;
  }
  
  protected Node getAdoptionParentNode(EReference eReference)
  {
    if ((eReference == XSDPackage.Literals.XSD_SIMPLE_TYPE_DEFINITION__FACET_CONTENTS) || 
      (eReference == XSDPackage.Literals.XSD_SIMPLE_TYPE_DEFINITION__CONTENTS) || 
      (eReference == XSDPackage.Literals.XSD_TYPE_DEFINITION__DERIVATION_ANNOTATION))
    {
      Element element = getElement();
      if (element == null) {
        return null;
      }
      for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) {
        switch (XSDConstants.nodeType(child))
        {
        case 13: 
        case 22: 
        case 32: 
        case 39: 
          return child;
        }
      }
    }
    return super.getAdoptionParentNode(eReference);
  }
  
  protected Collection<Element> getContentNodes(Element changedElement)
  {
    Collection<Element> result = new ArrayList();
    for (Node child = getElement().getFirstChild(); child != null; child = child.getNextSibling()) {
      switch (XSDConstants.nodeType(child))
      {
      case 1: 
        result.add((Element)child);
        break;
      case 13: 
      case 22: 
      case 32: 
      case 39: 
        for (Node grandChild = child.getFirstChild(); grandChild != null; grandChild = grandChild.getNextSibling()) {
          if (grandChild.getNodeType() == 1) {
            result.add((Element)grandChild);
          }
        }
      }
    }
    return result;
  }
  
  protected void handleUnreconciledElement(Element child, List<XSDConcreteComponent> newContents, List<XSDConcreteComponent> remainingContents)
  {
    switch (XSDConstants.nodeType(child))
    {
    case 1: 
      XSDAnnotation xsdAnnotation = XSDAnnotationImpl.createAnnotation(child);
      newContents.add(xsdAnnotation);
      break;
    case 37: 
      XSDSimpleTypeDefinition xsdSimpleTypeDefinition = createSimpleTypeDefinition(child);
      if (xsdSimpleTypeDefinition != null) {
        newContents.add(xsdSimpleTypeDefinition);
      }
      break;
    default: 
      XSDConstrainingFacet xsdConstrainingFacet = XSDConstrainingFacetImpl.createConstrainingFacet(child);
      if (xsdConstrainingFacet != null) {
        newContents.add(xsdConstrainingFacet);
      }
      break;
    }
  }
  
  protected void handleReconciliation(List<XSDConcreteComponent> newContents, List<XSDConcreteComponent> remainingContents)
  {
    if ((!newContents.isEmpty()) && (((XSDConcreteComponent)newContents.get(0)).getElement().getParentNode() == getElement())) {
      handleAnnotationReconciliation(XSDPackage.Literals.XSD_TYPE_DEFINITION__ANNOTATION, newContents, remainingContents);
    }
    handleAnnotationReconciliation(XSDPackage.Literals.XSD_TYPE_DEFINITION__DERIVATION_ANNOTATION, newContents, remainingContents);
    
    XSDSimpleTypeDefinition newBaseTypeDefinition = null;
    XSDTypeDefinition newComplexBaseTypeDefinition = null;
    
    boolean didContents = false;
    Element theElement = getElement();
    for (Node child = theElement.getFirstChild(); child != null; child = child.getNextSibling()) {
      switch (XSDConstants.nodeType(child))
      {
      case 22: 
        Element elementChild = (Element)child;
        XSDSimpleTypeDefinition newTypeContent = null;
        XSDSimpleTypeDefinition newItemTypeDefinition = null;
        if (!newContents.isEmpty())
        {
          XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)newContents.get(0);
          if ((xsdConcreteComponent instanceof XSDSimpleTypeDefinition))
          {
            newItemTypeDefinition = (XSDSimpleTypeDefinition)xsdConcreteComponent;
            newTypeContent = newItemTypeDefinition;
            newContents.remove(0);
          }
        }
        if ((elementChild.hasAttributeNS(null, "itemType")) && (newItemTypeDefinition == null)) {
          newItemTypeDefinition = 
            resolveSimpleTypeDefinitionURI(XSDConstants.lookupQNameForAttribute((Element)child, "itemType"));
        }
        if (newItemTypeDefinition == null) {
          newItemTypeDefinition = resolveSimpleTypeDefinition(null, "undefined");
        }
        getContents().removeAll(remainingContents);
        if (newTypeContent != null) {
          getContents().add(newTypeContent);
        }
        if (newItemTypeDefinition != getItemTypeDefinition()) {
          setItemTypeDefinition(newItemTypeDefinition);
        }
        didContents = true;
        break;
      case 39: 
        Element elementChild = (Element)child;
        List<XSDSimpleTypeDefinition> newMemberTypeDefinitions = new ArrayList();
        if (elementChild.hasAttributeNS(null, "memberTypes"))
        {
          String memberTypes = elementChild.getAttributeNS(null, "memberTypes");
          if (memberTypes != null) {
            for (StringTokenizer tokens = new StringTokenizer(memberTypes, " "); tokens.hasMoreTokens();)
            {
              String memberTypeQName = tokens.nextToken();
              XSDSimpleTypeDefinition newMemberTypeDefinition = 
                resolveSimpleTypeDefinitionURI(XSDConstants.lookupQName(elementChild, memberTypeQName));
              newMemberTypeDefinitions.add(newMemberTypeDefinition);
            }
          }
        }
        List<XSDSimpleTypeDefinition> newTypeContents = new ArrayList();
        for (ListIterator<XSDConcreteComponent> i = newContents.listIterator(); i.hasNext();)
        {
          XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)i.next();
          if (!(xsdConcreteComponent instanceof XSDSimpleTypeDefinition)) {
            break;
          }
          XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition)xsdConcreteComponent;
          newTypeContents.add(xsdSimpleTypeDefinition);
          newMemberTypeDefinitions.add(xsdSimpleTypeDefinition);
          i.remove();
        }
        getContents().removeAll(remainingContents);
        if (!newTypeContents.isEmpty()) {
          setListContentAndOrder(getContents(), newTypeContents);
        }
        List<XSDSimpleTypeDefinition> remainingMemberTypeDefinitions = new ArrayList(getMemberTypeDefinitions());
        remainingMemberTypeDefinitions.removeAll(newMemberTypeDefinitions);
        if (!remainingMemberTypeDefinitions.isEmpty()) {
          getMemberTypeDefinitions().removeAll(remainingMemberTypeDefinitions);
        }
        if (!newMemberTypeDefinitions.isEmpty()) {
          setListContentAndOrder(getMemberTypeDefinitions(), newMemberTypeDefinitions);
        }
        didContents = true;
        break;
      case 13: 
      case 32: 
        Element elementChild = (Element)child;
        if (!newContents.isEmpty())
        {
          XSDConcreteComponent xsdConcreteComponent = (XSDConcreteComponent)newContents.get(0);
          if ((xsdConcreteComponent instanceof XSDSimpleTypeDefinition))
          {
            XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition)xsdConcreteComponent;
            List<XSDSimpleTypeDefinition> theContents = getContents();
            if ((theContents.size() != 1) || (theContents.get(0) != xsdConcreteComponent))
            {
              if (!theContents.isEmpty())
              {
                remainingContents.removeAll(theContents);
                theContents.clear();
              }
              theContents.add(xsdSimpleTypeDefinition);
            }
            newBaseTypeDefinition = xsdSimpleTypeDefinition;
            newContents.remove(0);
          }
        }
        if (!(getContainer() instanceof XSDComplexTypeDefinition))
        {
          if ((elementChild.hasAttributeNS(null, "base")) && (newBaseTypeDefinition == null)) {
            newBaseTypeDefinition = 
              resolveSimpleTypeDefinitionURI(XSDConstants.lookupQNameForAttribute(elementChild, "base"));
          }
        }
        else if (elementChild.hasAttributeNS(null, "base")) {
          newComplexBaseTypeDefinition = 
            resolveTypeDefinitionURI(XSDConstants.lookupQNameForAttribute(elementChild, "base"));
        }
        didContents = true;
        break;
      }
    }
    if ((!didContents) && (!getContents().isEmpty())) {
      getContents().clear();
    }
    if (!remainingContents.isEmpty()) {
      getFacetContents().removeAll(remainingContents);
    }
    if (!newContents.isEmpty())
    {
      for (Iterator<?> i = newContents.iterator(); i.hasNext();) {
        if (!(i.next() instanceof XSDFacet)) {
          i.remove();
        }
      }
      List<XSDConstrainingFacet> list = newContents;
      setListContentAndOrder(getFacetContents(), list);
    }
    handleNewBaseTypeDefinition(newBaseTypeDefinition);
    handleNewComplexBaseTypeDefinition(newComplexBaseTypeDefinition);
  }
  
  protected void changeAttribute(EAttribute eAttribute)
  {
    super.changeAttribute(eAttribute);
    Element theElement = getElement();
    if ((eAttribute == null) || (eAttribute == XSDPackage.Literals.XSD_SIMPLE_TYPE_DEFINITION__LEXICAL_FINAL))
    {
      if (theElement != null) {
        niceSetAttribute(
          theElement, 
          "final", 
          getStringLexicalFinal());
      }
      if (eAttribute != null) {
        traverseToRootForPatching();
      }
    }
    if ((eAttribute == null) || (eAttribute == XSDPackage.Literals.XSD_SIMPLE_TYPE_DEFINITION__VARIETY)) {
      if ((theElement != null) && (eAttribute != null)) {
        if (analysisState != 1)
        {
          for (Node child = theElement.getFirstChild(); child != null; child = child.getNextSibling())
          {
            int childNodeType = XSDConstants.nodeType(child);
            switch (childNodeType)
            {
            case 13: 
            case 22: 
            case 32: 
            case 39: 
              if (childNodeType == getRequiredChildElementNodeType()) {
                break label171;
              }
              Element newElement = createChildElement();
              forceReplace(newElement, (Element)child);
              break label171;
            }
          }
          label171:
          traverseToRootForAnalysis();
        }
      }
    }
  }
  
  protected void changeReference(EReference eReference)
  {
    super.changeReference(eReference);
    Element theElement = getElement();
    if (theElement != null)
    {
      if ((eReference == null) || (eReference == XSDPackage.Literals.XSD_SIMPLE_TYPE_DEFINITION__BASE_TYPE_DEFINITION))
      {
        if ((!isReconciling) && (eReference != null)) {
          traverseToRootForPatching();
        }
        if ((!isReconciling) && (!(getContainer() instanceof XSDComplexTypeDefinition)))
        {
          XSDSimpleTypeDefinition theBaseTypeDefinition = getBaseTypeDefinition();
          if ((theBaseTypeDefinition != null) && (!getContents().contains(theBaseTypeDefinition))) {
            for (Node child = theElement.getFirstChild(); child != null; child = child.getNextSibling()) {
              switch (XSDConstants.nodeType(child))
              {
              case 13: 
              case 32: 
                niceSetAttributeURIValue((Element)child, "base", theBaseTypeDefinition.getURI());
                break label155;
              }
            }
          }
        }
      }
      label155:
      if ((eReference == null) || (eReference == XSDPackage.Literals.XSD_SIMPLE_TYPE_DEFINITION__ITEM_TYPE_DEFINITION))
      {
        if ((!isReconciling) && (eReference != null)) {
          traverseToRootForPatching();
        }
        XSDSimpleTypeDefinition theItemTypeDefinition = getItemTypeDefinition();
        if ((!isReconciling) && (theItemTypeDefinition != null) && (!getContents().contains(theItemTypeDefinition))) {
          for (Node child = theElement.getFirstChild(); child != null; child = child.getNextSibling()) {
            switch (XSDConstants.nodeType(child))
            {
            case 22: 
              niceSetAttributeURIValue((Element)child, "itemType", theItemTypeDefinition.getURI());
              break label279;
            }
          }
        }
      }
      label279:
      if ((eReference == null) || (eReference == XSDPackage.Literals.XSD_SIMPLE_TYPE_DEFINITION__MEMBER_TYPE_DEFINITIONS))
      {
        if ((!isReconciling) && (eReference != null)) {
          traverseToRootForPatching();
        }
        if (!isReconciling) {
          for (Node child = theElement.getFirstChild(); child != null; child = child.getNextSibling()) {
            switch (XSDConstants.nodeType(child))
            {
            case 39: 
              StringBuffer newMemberTypeDefinitions = null;
              for (XSDSimpleTypeDefinition theMemberTypeDefinition : getMemberTypeDefinitions())
              {
                if (getContents().contains(theMemberTypeDefinition)) {
                  break;
                }
                if (newMemberTypeDefinitions == null) {
                  newMemberTypeDefinitions = new StringBuffer();
                } else {
                  newMemberTypeDefinitions.append(' ');
                }
                newMemberTypeDefinitions.append(theMemberTypeDefinition.getURI());
              }
              niceSetAttributeURIValue(
                (Element)child, 
                "memberTypes", 
                newMemberTypeDefinitions == null ? null : newMemberTypeDefinitions.toString());
              return;
            }
          }
        }
      }
    }
  }
  
  protected void adoptContent(EReference eReference, XSDConcreteComponent xsdConcreteComponent)
  {
    super.adoptContent(eReference, xsdConcreteComponent);
    if ((eReference == XSDPackage.Literals.XSD_SIMPLE_TYPE_DEFINITION__CONTENTS) || 
      (eReference == XSDPackage.Literals.XSD_SIMPLE_TYPE_DEFINITION__FACET_CONTENTS)) {
      traverseToRootForPatching();
    } else if (eReference == XSDPackage.Literals.XSD_TYPE_DEFINITION__ANNOTATION) {
      getAnnotations().add(0, (XSDAnnotation)xsdConcreteComponent);
    } else if (eReference == XSDPackage.Literals.XSD_TYPE_DEFINITION__DERIVATION_ANNOTATION) {
      getAnnotations().add((XSDAnnotation)xsdConcreteComponent);
    }
  }
  
  protected void orphanContent(EReference eReference, XSDConcreteComponent xsdConcreteComponent)
  {
    super.orphanContent(eReference, xsdConcreteComponent);
    if ((eReference == XSDPackage.Literals.XSD_SIMPLE_TYPE_DEFINITION__CONTENTS) || 
      (eReference == XSDPackage.Literals.XSD_SIMPLE_TYPE_DEFINITION__FACET_CONTENTS)) {
      traverseToRootForPatching();
    } else if ((eReference == XSDPackage.Literals.XSD_TYPE_DEFINITION__ANNOTATION) || 
      (eReference == XSDPackage.Literals.XSD_TYPE_DEFINITION__DERIVATION_ANNOTATION)) {
      getAnnotations().remove(xsdConcreteComponent);
    }
  }
  
  public XSDTotalDigitsFacet getTotalDigitsFacet()
  {
    if (facetContents != null)
    {
      Object[] facets = facetContents.data();
      int i = 0;
      for (int size = facetContents.size(); i < size; i++)
      {
        Object facet = facets[i];
        if ((facet instanceof XSDTotalDigitsFacet)) {
          return (XSDTotalDigitsFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDTotalDigitsFacet getEffectiveTotalDigitsFacet()
  {
    if (facets != null)
    {
      Object[] facetData = facets.data();
      int i = 0;
      for (int size = facets.size(); i < size; i++)
      {
        Object facet = facetData[i];
        if ((facet instanceof XSDTotalDigitsFacet)) {
          return (XSDTotalDigitsFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDFractionDigitsFacet getFractionDigitsFacet()
  {
    if (facetContents != null)
    {
      Object[] facets = facetContents.data();
      int i = 0;
      for (int size = facetContents.size(); i < size; i++)
      {
        Object facet = facets[i];
        if ((facet instanceof XSDFractionDigitsFacet)) {
          return (XSDFractionDigitsFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDFractionDigitsFacet getEffectiveFractionDigitsFacet()
  {
    if (facets != null)
    {
      Object[] facetData = facets.data();
      int i = 0;
      for (int size = facets.size(); i < size; i++)
      {
        Object facet = facetData[i];
        if ((facet instanceof XSDFractionDigitsFacet)) {
          return (XSDFractionDigitsFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDLengthFacet getLengthFacet()
  {
    if (facetContents != null)
    {
      Object[] facets = facetContents.data();
      int i = 0;
      for (int size = facetContents.size(); i < size; i++)
      {
        Object facet = facets[i];
        if ((facet instanceof XSDLengthFacet)) {
          return (XSDLengthFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDLengthFacet getEffectiveLengthFacet()
  {
    if (facets != null)
    {
      Object[] facetData = facets.data();
      int i = 0;
      for (int size = facets.size(); i < size; i++)
      {
        Object facet = facetData[i];
        if ((facet instanceof XSDLengthFacet)) {
          return (XSDLengthFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDMaxLengthFacet getMaxLengthFacet()
  {
    if (facetContents != null)
    {
      Object[] facets = facetContents.data();
      int i = 0;
      for (int size = facetContents.size(); i < size; i++)
      {
        Object facet = facets[i];
        if ((facet instanceof XSDMaxLengthFacet)) {
          return (XSDMaxLengthFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDMaxLengthFacet getEffectiveMaxLengthFacet()
  {
    if (facets != null)
    {
      Object[] facetData = facets.data();
      int i = 0;
      for (int size = facets.size(); i < size; i++)
      {
        Object facet = facetData[i];
        if ((facet instanceof XSDMaxLengthFacet)) {
          return (XSDMaxLengthFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDMinLengthFacet getMinLengthFacet()
  {
    if (facetContents != null)
    {
      Object[] facets = facetContents.data();
      int i = 0;
      for (int size = facetContents.size(); i < size; i++)
      {
        Object facet = facets[i];
        if ((facet instanceof XSDMinLengthFacet)) {
          return (XSDMinLengthFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDMinLengthFacet getEffectiveMinLengthFacet()
  {
    if (facets != null)
    {
      Object[] facetData = facets.data();
      int i = 0;
      for (int size = facets.size(); i < size; i++)
      {
        Object facet = facetData[i];
        if ((facet instanceof XSDMinLengthFacet)) {
          return (XSDMinLengthFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDMaxExclusiveFacet getMaxExclusiveFacet()
  {
    if (facetContents != null)
    {
      Object[] facets = facetContents.data();
      int i = 0;
      for (int size = facetContents.size(); i < size; i++)
      {
        Object facet = facets[i];
        if ((facet instanceof XSDMaxExclusiveFacet)) {
          return (XSDMaxExclusiveFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDMaxInclusiveFacet getMaxInclusiveFacet()
  {
    if (facetContents != null)
    {
      Object[] facets = facetContents.data();
      int i = 0;
      for (int size = facetContents.size(); i < size; i++)
      {
        Object facet = facets[i];
        if ((facet instanceof XSDMaxInclusiveFacet)) {
          return (XSDMaxInclusiveFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDMaxFacet getMaxFacet()
  {
    if (facetContents != null)
    {
      Object[] facets = facetContents.data();
      int i = 0;
      for (int size = facetContents.size(); i < size; i++)
      {
        Object facet = facets[i];
        if ((facet instanceof XSDMaxFacet)) {
          return (XSDMaxFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDMaxFacet getEffectiveMaxFacet()
  {
    if (facets != null)
    {
      Object[] facetData = facets.data();
      int i = 0;
      for (int size = facets.size(); i < size; i++)
      {
        Object facet = facetData[i];
        if ((facet instanceof XSDMaxFacet)) {
          return (XSDMaxFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDMinExclusiveFacet getMinExclusiveFacet()
  {
    if (facetContents != null)
    {
      Object[] facets = facetContents.data();
      int i = 0;
      for (int size = facetContents.size(); i < size; i++)
      {
        Object facet = facets[i];
        if ((facet instanceof XSDMinExclusiveFacet)) {
          return (XSDMinExclusiveFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDMinInclusiveFacet getMinInclusiveFacet()
  {
    if (facetContents != null)
    {
      Object[] facets = facetContents.data();
      int i = 0;
      for (int size = facetContents.size(); i < size; i++)
      {
        Object facet = facets[i];
        if ((facet instanceof XSDMinInclusiveFacet)) {
          return (XSDMinInclusiveFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDMinFacet getMinFacet()
  {
    if (facetContents != null)
    {
      Object[] facets = facetContents.data();
      int i = 0;
      for (int size = facetContents.size(); i < size; i++)
      {
        Object facet = facets[i];
        if ((facet instanceof XSDMinFacet)) {
          return (XSDMinFacet)facet;
        }
      }
    }
    return null;
  }
  
  public XSDMinFacet getEffectiveMinFacet()
  {
    if (facets != null)
    {
      Object[] facetData = facets.data();
      int i = 0;
      for (int size = facets.size(); i < size; i++)
      {
        Object facet = facetData[i];
        if ((facet instanceof XSDMinFacet)) {
          return (XSDMinFacet)facet;
        }
      }
    }
    return null;
  }
  
  public EList<XSDFacet> getSyntheticFacets()
  {
    if (syntheticFacets == null) {
      syntheticFacets = new EObjectContainmentEList(XSDFacet.class, this, 60);
    }
    return syntheticFacets;
  }
  
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
    case 23: 
      return ((InternalEList)getContents()).basicRemove(otherEnd, msgs);
    case 24: 
      return ((InternalEList)getFacetContents()).basicRemove(otherEnd, msgs);
    case 27: 
      return ((InternalEList)getFundamentalFacets()).basicRemove(otherEnd, msgs);
    case 60: 
      return ((InternalEList)getSyntheticFacets()).basicRemove(otherEnd, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }
  
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
    case 19: 
      return getVariety();
    case 20: 
      return getFinal();
    case 21: 
      return getLexicalFinal();
    case 22: 
      return getValidFacets();
    case 23: 
      return getContents();
    case 24: 
      return getFacetContents();
    case 25: 
      return getFacets();
    case 26: 
      return getMemberTypeDefinitions();
    case 27: 
      return getFundamentalFacets();
    case 28: 
      return getBaseTypeDefinition();
    case 29: 
      return getPrimitiveTypeDefinition();
    case 30: 
      return getItemTypeDefinition();
    case 31: 
      return getRootTypeDefinition();
    case 32: 
      return getMinFacet();
    case 33: 
      return getMaxFacet();
    case 34: 
      return getMaxInclusiveFacet();
    case 35: 
      return getMinInclusiveFacet();
    case 36: 
      return getMinExclusiveFacet();
    case 37: 
      return getMaxExclusiveFacet();
    case 38: 
      return getLengthFacet();
    case 39: 
      return getWhiteSpaceFacet();
    case 40: 
      return getEnumerationFacets();
    case 41: 
      return getPatternFacets();
    case 42: 
      return getCardinalityFacet();
    case 43: 
      return getNumericFacet();
    case 44: 
      return getMaxLengthFacet();
    case 45: 
      return getMinLengthFacet();
    case 46: 
      return getTotalDigitsFacet();
    case 47: 
      return getFractionDigitsFacet();
    case 48: 
      return getOrderedFacet();
    case 49: 
      return getBoundedFacet();
    case 50: 
      return getEffectiveMaxFacet();
    case 51: 
      return getEffectiveWhiteSpaceFacet();
    case 52: 
      return getEffectiveMaxLengthFacet();
    case 53: 
      return getEffectiveFractionDigitsFacet();
    case 54: 
      return getEffectivePatternFacet();
    case 55: 
      return getEffectiveEnumerationFacet();
    case 56: 
      return getEffectiveTotalDigitsFacet();
    case 57: 
      return getEffectiveMinLengthFacet();
    case 58: 
      return getEffectiveLengthFacet();
    case 59: 
      return getEffectiveMinFacet();
    case 60: 
      return getSyntheticFacets();
    }
    return super.eGet(featureID, resolve, coreType);
  }
  
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
    case 19: 
      setVariety((XSDVariety)newValue);
      return;
    case 20: 
      getFinal().clear();
      getFinal().addAll((Collection)newValue);
      return;
    case 21: 
      getLexicalFinal().clear();
      getLexicalFinal().addAll((Collection)newValue);
      return;
    case 22: 
      getValidFacets().clear();
      getValidFacets().addAll((Collection)newValue);
      return;
    case 23: 
      getContents().clear();
      getContents().addAll((Collection)newValue);
      return;
    case 24: 
      getFacetContents().clear();
      getFacetContents().addAll((Collection)newValue);
      return;
    case 25: 
      getFacets().clear();
      getFacets().addAll((Collection)newValue);
      return;
    case 26: 
      getMemberTypeDefinitions().clear();
      getMemberTypeDefinitions().addAll((Collection)newValue);
      return;
    case 27: 
      getFundamentalFacets().clear();
      getFundamentalFacets().addAll((Collection)newValue);
      return;
    case 28: 
      setBaseTypeDefinition((XSDSimpleTypeDefinition)newValue);
      return;
    case 29: 
      setPrimitiveTypeDefinition((XSDSimpleTypeDefinition)newValue);
      return;
    case 30: 
      setItemTypeDefinition((XSDSimpleTypeDefinition)newValue);
      return;
    case 60: 
      getSyntheticFacets().clear();
      getSyntheticFacets().addAll((Collection)newValue);
      return;
    }
    super.eSet(featureID, newValue);
  }
  
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
    case 19: 
      unsetVariety();
      return;
    case 20: 
      getFinal().clear();
      return;
    case 21: 
      unsetLexicalFinal();
      return;
    case 22: 
      getValidFacets().clear();
      return;
    case 23: 
      getContents().clear();
      return;
    case 24: 
      getFacetContents().clear();
      return;
    case 25: 
      getFacets().clear();
      return;
    case 26: 
      getMemberTypeDefinitions().clear();
      return;
    case 27: 
      getFundamentalFacets().clear();
      return;
    case 28: 
      setBaseTypeDefinition(null);
      return;
    case 29: 
      setPrimitiveTypeDefinition(null);
      return;
    case 30: 
      setItemTypeDefinition(null);
      return;
    case 60: 
      getSyntheticFacets().clear();
      return;
    }
    super.eUnset(featureID);
  }
  
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
    case 19: 
      return isSetVariety();
    case 20: 
      return (final_ != null) && (!final_.isEmpty());
    case 21: 
      return isSetLexicalFinal();
    case 22: 
      return (validFacets != null) && (!validFacets.isEmpty());
    case 23: 
      return (contents != null) && (!contents.isEmpty());
    case 24: 
      return (facetContents != null) && (!facetContents.isEmpty());
    case 25: 
      return (facets != null) && (!facets.isEmpty());
    case 26: 
      return (memberTypeDefinitions != null) && (!memberTypeDefinitions.isEmpty());
    case 27: 
      return (fundamentalFacets != null) && (!fundamentalFacets.isEmpty());
    case 28: 
      return baseTypeDefinition != null;
    case 29: 
      return primitiveTypeDefinition != null;
    case 30: 
      return itemTypeDefinition != null;
    case 31: 
      return getRootTypeDefinition() != null;
    case 32: 
      return getMinFacet() != null;
    case 33: 
      return getMaxFacet() != null;
    case 34: 
      return getMaxInclusiveFacet() != null;
    case 35: 
      return getMinInclusiveFacet() != null;
    case 36: 
      return getMinExclusiveFacet() != null;
    case 37: 
      return getMaxExclusiveFacet() != null;
    case 38: 
      return getLengthFacet() != null;
    case 39: 
      return getWhiteSpaceFacet() != null;
    case 40: 
      return !getEnumerationFacets().isEmpty();
    case 41: 
      return !getPatternFacets().isEmpty();
    case 42: 
      return getCardinalityFacet() != null;
    case 43: 
      return getNumericFacet() != null;
    case 44: 
      return getMaxLengthFacet() != null;
    case 45: 
      return getMinLengthFacet() != null;
    case 46: 
      return getTotalDigitsFacet() != null;
    case 47: 
      return getFractionDigitsFacet() != null;
    case 48: 
      return getOrderedFacet() != null;
    case 49: 
      return getBoundedFacet() != null;
    case 50: 
      return getEffectiveMaxFacet() != null;
    case 51: 
      return getEffectiveWhiteSpaceFacet() != null;
    case 52: 
      return getEffectiveMaxLengthFacet() != null;
    case 53: 
      return getEffectiveFractionDigitsFacet() != null;
    case 54: 
      return getEffectivePatternFacet() != null;
    case 55: 
      return getEffectiveEnumerationFacet() != null;
    case 56: 
      return getEffectiveTotalDigitsFacet() != null;
    case 57: 
      return getEffectiveM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd