Exemplo n.º 1
0
 public override void OnAlias(Alias pair)
 {
     PrintNodeName(pair);
     PrintNodeStart(pair);
     base.OnAlias(pair);
     PrintNodeEnd(pair);
 }
Exemplo n.º 2
0
        /// <inheritdoc />
        public override void Visit(Alias alias)
        {
            var aliasDef = ((DOM.Mapped.Alias)alias).AliasDefinition;

            if (aliasDef.IsValueNode)
            {
                CheckBlockStartForValueAlias();
                OnValue(ResolveValueAlias((DOM.Mapped.Alias)alias, out var valueType), valueType);
            }

            AliasContext.Push(new AliasContextInfo((DOM.Mapped.Alias)alias, CurrentModuleMember));
            if (!EnterChoiceContainer((DOM.Mapped.Alias)alias, aliasDef.Entities, aliasDef))
            {
                if (BlockState.Count > 0 && BlockState.Peek() == BlockStateEnum.Array && aliasDef.BlockType == BlockType.JsonObject)
                {
                    if (BlockIsStarting)
                    {
                        JsonWriter.WriteStartArray();
                    }
                    BlockState.Push(BlockStateEnum.Object);
                    JsonWriter.WriteStartObject();
                    Visit(aliasDef.Entities.Where(e => !(e is Attribute)));
                    JsonWriter.WriteEndObject();
                    BlockState.Pop();
                }
                else
                {
                    Visit(aliasDef.Entities.Where(e => !(e is Attribute)));
                }
            }
            AliasContext.Pop();
        }
Exemplo n.º 3
0
 public override void Visit(Alias pair)
 {
     PrintNodeName(pair);
     PrintNodeStart(pair);
     base.Visit(pair);
     PrintNodeEnd(pair);
 }
Exemplo n.º 4
0
        /// <inheritdoc />
        public override void Visit(Alias alias)
        {
            var aliasDef = ((DOM.Mapped.Alias)alias).AliasDefinition;

            AliasContext.Push(new AliasContextInfo((DOM.Mapped.Alias)alias, CurrentModuleMember));
            CurrentModuleMember = aliasDef;
            if (aliasDef.IsValueNode)
            {
                OnValue(ResolveValueAlias((DOM.Mapped.Alias)alias, out var valueType), valueType);
            }

            if (!EnterChoiceContainer((DOM.Mapped.Alias)alias, aliasDef.Entities, aliasDef))
            {
                Visit(aliasDef.Entities.Where(e => !(e is DOM.Attribute)));
            }

            CurrentModuleMember = AliasContext.Pop().ModuleMember;
        }
Exemplo n.º 5
0
        public override void OnAlias(Alias alias)
        {
            var aliasDef = ((DOM.Mapped.Alias)alias).AliasDefinition;

            if (aliasDef.IsValueNode)
            {
                CheckBlockStartForAlias();
                ValueType valueType;
                OnValue(ResolveValueAlias((DOM.Mapped.Alias)alias, out valueType), valueType);
            }


            AliasContext.Push(new AliasContext()
            {
                AliasDefinition = aliasDef, Alias = (DOM.Mapped.Alias)alias, AliasNsInfo = GetContextNsInfo()
            });
            if (!EnterChoiceContainer((DOM.Mapped.Alias)alias, aliasDef.Entities))
            {
                Visit(aliasDef.Entities.Where(e => !(e is DOM.Attribute)));
            }
            AliasContext.Pop();
        }
Exemplo n.º 6
0
        public override void OnAlias(Alias alias)
        {
            var aliasDef = ((DOM.Mapped.Alias)alias).AliasDefinition;
            var prevCurrentModuleMember = _currentModuleMember;

            _currentModuleMember = aliasDef;
            if (aliasDef.IsValueNode)
            {
                ValueType valueType;
                OnValue(ResolveValueAlias((DOM.Mapped.Alias)alias, out valueType), valueType);
            }
            AliasContext.Push(new AliasContext()
            {
                AliasDefinition = aliasDef, Alias = (DOM.Mapped.Alias)alias, AliasNsInfo = GetContextNsInfo()
            });
            if (!EnterChoiceContainer((DOM.Mapped.Alias)alias, aliasDef.Entities, aliasDef))
            {
                Visit(aliasDef.Entities.Where(e => !(e is DOM.Attribute)));
            }
            AliasContext.Pop();
            _currentModuleMember = prevCurrentModuleMember;
        }