public override void ProcessAttribute(string name, string attribValue) { if (HasSubImporter()) { SpecHierarchyImporter specHierarchySubImporter = (SpecHierarchyImporter)subImporter; if (!specHierarchySubImporter.IsImportCompleted()) { PassAttributeToSubImporter(name, attribValue); return; } } switch (name) { case isEditableAttributeName: ((SpecHierarchy)identifiableElementUnderConstruction).IsEditable = true; break; case isTableInternalAttributeName: ((SpecHierarchy)identifiableElementUnderConstruction).IsTableInternal = true; break; default: base.ProcessAttribute(name, attribValue); break; } }
private void CreateSubImporterForChildElements() { Specification specification = ((Specification)identifiableElementUnderConstruction); specification.SpecHierarchies = new SortedList(); SortedList nestedSpecHierarchies = specification.SpecHierarchies; subImporter = new SpecHierarchyImporter(ref nestedSpecHierarchies); }
public override void ProcessTextNode(string text) { if (HasSubImporter()) { SpecHierarchyImporter specHierarchySubImporter = (SpecHierarchyImporter)subImporter; if (!specHierarchySubImporter.IsImportCompleted()) { PassTextNodeToSubImporter(text); return; } } if (processingElement == ProcessingElement.SpecObjectReference) { ((SpecHierarchy)identifiableElementUnderConstruction).SpecObjectReference = text; } else { PassTextNodeToSubImporter(text); } }
public override void ProcessElementStartNode(string name) { switch (name) { case specificationNodeName: processingElement = ProcessingElement.Specification; identifiableElementUnderConstruction = new Specification(); break; case alternativeIdNodeName: if (processingElement == ProcessingElement.Specification) { processingElement = ProcessingElement.AlternativeId; } break; case valuesNodeName: if (processingElement == ProcessingElement.Specification) { processingElement = ProcessingElement.Values; } break; case typeNodeName: if (processingElement == ProcessingElement.Specification) { processingElement = ProcessingElement.Type; } break; case specificationTypeRefNodeName: if (processingElement == ProcessingElement.Type) { processingElement = ProcessingElement.SpecificationTypeRef; } break; case childrenNodeName: { if (HasSubImporter()) { SpecHierarchyImporter specHierarchySubImporter = (SpecHierarchyImporter)subImporter; if (!specHierarchySubImporter.IsImportCompleted()) { PassElementStartNodeToSubImporter(name); } } else { if (processingElement == ProcessingElement.Specification) { processingElement = ProcessingElement.Children; CreateSubImporterForChildElements(); } } } break; default: if (HasSubImporter()) { PassElementStartNodeToSubImporter(name); break; } else { throw new ParserFailureException(unexpectedElementNodeErrorText + name + "'."); } } }
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 + "'."); } }
public override void ProcessElementEndNode(string name) { if (HasSubImporter()) { SpecHierarchyImporter specHierarchySubImporter = (SpecHierarchyImporter)subImporter; if (!specHierarchySubImporter.IsImportCompleted()) { PassElementEndNodeToSubImporter(name); return; } } switch (name) { case alternativeIdNodeName: if (processingElement == ProcessingElement.AlternativeId) { processingElement = ProcessingElement.SpecHierarchy; } break; case specObjectRefNodeName: if (processingElement == ProcessingElement.SpecObjectReference) { processingElement = ProcessingElement.Object; } break; case objectNodeName: if (processingElement == ProcessingElement.Object) { processingElement = ProcessingElement.SpecHierarchy; } break; case childrenNodeName: if (HasSubImporter()) { SpecHierarchyImporter specHierarchySubImporter = (SpecHierarchyImporter)subImporter; if (!specHierarchySubImporter.IsImportCompleted()) { PassElementEndNodeToSubImporter(name); } else { if (processingElement == ProcessingElement.Children) { processingElement = ProcessingElement.SpecHierarchy; subImporter = null; } } } else { if (processingElement == ProcessingElement.Children) { processingElement = ProcessingElement.SpecHierarchy; } } break; case specHierarchyNodeName: if (processingElement == ProcessingElement.SpecHierarchy) { processingElement = ProcessingElement.Undefined; FlagImportAsCompleted(); FinalizeIdentifiableElementUnderConstruction(); } break; default: throw new ParserFailureException(unexpectedElementNodeErrorText + name + "'."); } }