private void CreateSubImporterForChildElements()
        {
            SpecHierarchy specHierarchy = ((SpecHierarchy)identifiableElementUnderConstruction);

            specHierarchy.NestedSpecHierarchies = new SortedList();
            SortedList nestedSpecHierarchies = specHierarchy.NestedSpecHierarchies;

            subImporter = new SpecHierarchyImporter(ref nestedSpecHierarchies);
        }
 private void CreateRequirements(Package specificationPackage,
                                 SortedList specHierarchies,
                                 EnterpriseArchitectModelElementFactory factory)
 {
     if (specHierarchies.Count > 0)
     {
         foreach (DictionaryEntry specHierarchyEntry in specHierarchies)
         {
             SpecHierarchy specHierarchy = (SpecHierarchy)specHierarchyEntry.Value;
             SpecObject    specObject    = (SpecObject)specificationObjects[specHierarchy.SpecObjectReference];
             if ((object)specObject != null)
             {
                 Element requirement = factory.CreateRequirement(specificationPackage, specObject.LongName);
                 AddTaggedValuesToRequirement(specObject, requirement);
             }
             else
             {
                 throw new ParserFailureException();
             }
         }
     }
 }
        public override void ProcessElementStartNode(string name)
        {
            if (HasSubImporter())
            {
                SpecHierarchyImporter specHierarchySubImporter = (SpecHierarchyImporter)subImporter;
                if (!specHierarchySubImporter.IsImportCompleted())
                {
                    PassElementStartNodeToSubImporter(name);
                    return;
                }
            }

            switch (name)
            {
            case specHierarchyNodeName:
                processingElement = ProcessingElement.SpecHierarchy;
                identifiableElementUnderConstruction = new SpecHierarchy();
                break;

            case childrenNodeName:
                if (HasSubImporter())
                {
                    SpecHierarchyImporter specHierarchySubImporter = (SpecHierarchyImporter)subImporter;
                    if (!specHierarchySubImporter.IsImportCompleted())
                    {
                        PassElementStartNodeToSubImporter(name);
                    }
                }
                else
                {
                    if (processingElement == ProcessingElement.SpecHierarchy)
                    {
                        processingElement = ProcessingElement.Children;
                        CreateSubImporterForChildElements();
                    }
                }
                break;

            case objectNodeName:
                if (processingElement == ProcessingElement.SpecHierarchy)
                {
                    processingElement = ProcessingElement.Object;
                }
                break;

            case specObjectRefNodeName:
                if (processingElement == ProcessingElement.Object)
                {
                    processingElement = ProcessingElement.SpecObjectReference;
                }
                break;

            case alternativeIdNodeName:
                if (processingElement == ProcessingElement.SpecHierarchy)
                {
                    processingElement = ProcessingElement.AlternativeId;
                }
                break;

            default:
                throw new ParserFailureException(unexpectedElementNodeErrorText + name + "'.");
            }
        }