Example #1
0
        public override void ProcessTextNode(string text)
        {
            SpecRelation specRelation = (SpecRelation)identifiableElementUnderConstruction;

            switch (processingElement)
            {
            case ProcessingElement.SourceSpecObjectRef:
                specRelation.SourceSpecObjectIdentifier = text;
                break;

            case ProcessingElement.TargetSpecObjectRef:
                specRelation.TargetSpecObjectIdentifier = text;
                break;

            case ProcessingElement.SpecRelationTypeRef:
                specRelation.SpecRelationTypeIdentifier = text;
                break;

            default:
                throw new ParserFailureException(unexpectedTextNodeError);
            }
        }
        public override void ProcessElementStartNode(string name)
        {
            switch (name)
            {
                case specRelationNodeName:
                    processingElement = ProcessingElement.SpecRelation;
                    identifiableElementUnderConstruction = new SpecRelation();
                    break;

                case alternativeIdNodeName:
                    if (processingElement == ProcessingElement.SpecRelation)
                        processingElement = ProcessingElement.AlternativeId;
                    break;

                case valuesNodeName:
                    if (processingElement == ProcessingElement.SpecRelation)
                        processingElement = ProcessingElement.Values;
                    break;

                case typeNodeName:
                    if (processingElement == ProcessingElement.SpecRelation)
                        processingElement = ProcessingElement.Type;
                    break;

                case sourceNodeName:
                    if (processingElement == ProcessingElement.SpecRelation)
                        processingElement = ProcessingElement.Source;
                    break;

                case targetNodeName:
                    if (processingElement == ProcessingElement.SpecRelation)
                        processingElement = ProcessingElement.Target;
                    break;

                case specObjectRefNodeName:
                    if (processingElement == ProcessingElement.Source)
                        processingElement = ProcessingElement.SourceSpecObjectRef;
                    else if (processingElement == ProcessingElement.Target)
                        processingElement = ProcessingElement.TargetSpecObjectRef;
                    break;

                case specRelationTypeRefNodeName:
                    if (processingElement == ProcessingElement.Type)
                        processingElement = ProcessingElement.SpecRelationTypeRef;
                    break;

                default:
                    throw new ParserFailureException(unexpectedElementNodeErrorText + name + "'.");
            }
        }
Example #3
0
        public override void ProcessElementStartNode(string name)
        {
            switch (name)
            {
            case specRelationNodeName:
                processingElement = ProcessingElement.SpecRelation;
                identifiableElementUnderConstruction = new SpecRelation();
                break;

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

            case valuesNodeName:
                if (processingElement == ProcessingElement.SpecRelation)
                {
                    processingElement = ProcessingElement.Values;
                }
                break;

            case typeNodeName:
                if (processingElement == ProcessingElement.SpecRelation)
                {
                    processingElement = ProcessingElement.Type;
                }
                break;

            case sourceNodeName:
                if (processingElement == ProcessingElement.SpecRelation)
                {
                    processingElement = ProcessingElement.Source;
                }
                break;

            case targetNodeName:
                if (processingElement == ProcessingElement.SpecRelation)
                {
                    processingElement = ProcessingElement.Target;
                }
                break;

            case specObjectRefNodeName:
                if (processingElement == ProcessingElement.Source)
                {
                    processingElement = ProcessingElement.SourceSpecObjectRef;
                }
                else if (processingElement == ProcessingElement.Target)
                {
                    processingElement = ProcessingElement.TargetSpecObjectRef;
                }
                break;

            case specRelationTypeRefNodeName:
                if (processingElement == ProcessingElement.Type)
                {
                    processingElement = ProcessingElement.SpecRelationTypeRef;
                }
                break;

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