public override void OnAlias(Alias pair) { PrintNodeName(pair); PrintNodeStart(pair); base.OnAlias(pair); PrintNodeEnd(pair); }
/// <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(); }
public override void Visit(Alias pair) { PrintNodeName(pair); PrintNodeStart(pair); base.Visit(pair); PrintNodeEnd(pair); }
/// <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; }
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(); }
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; }