@Override public final void writeStartArray() throws IOException { _verifyValueWrite("start an array"); _writeContext = _writeContext.createChildArrayContext(); Boolean style = _outputOptions.getDefaultFlowStyle().getStyleBoolean(); String yamlTag = _typeId; boolean implicit = (yamlTag == null); String anchor = _objectId; if (anchor != null) { _objectId = null; } _emitter.emit(new SequenceStartEvent(anchor, yamlTag, implicit, null, null, style)); }
protected Node composeSequenceNode(String anchor) { SequenceStartEvent startEvent = (SequenceStartEvent) parser.getEvent(); String tag = startEvent.getTag(); Tag nodeTag; boolean resolved = false; if (tag == null || tag.equals("!")) { nodeTag = resolver.resolve(NodeId.sequence, null, startEvent.getImplicit()); resolved = true; } else { nodeTag = new Tag(tag); } final ArrayList<Node> children = new ArrayList<Node>(); SequenceNode node = new SequenceNode(nodeTag, resolved, children, startEvent.getStartMark(), null, startEvent.getFlowStyle()); if (anchor != null) { anchors.put(anchor, node); } while (!parser.checkEvent(Event.ID.SequenceEnd)) { children.add(composeNode(node)); } Event endEvent = parser.getEvent(); node.setEndMark(endEvent.getEndMark()); return node; }
private void expectNode(boolean root, boolean mapping, boolean simpleKey) throws IOException { rootContext = root; mappingContext = mapping; simpleKeyContext = simpleKey; if (event instanceof AliasEvent) { expectAlias(); } else if (event instanceof ScalarEvent || event instanceof CollectionStartEvent) { processAnchor("&"); processTag(); if (event instanceof ScalarEvent) { expectScalar(); } else if (event instanceof SequenceStartEvent) { if (flowLevel != 0 || canonical || ((SequenceStartEvent) event).isFlow() || checkEmptySequence()) { expectFlowSequence(); } else { expectBlockSequence(); } } else {// MappingStartEvent if (flowLevel != 0 || canonical || ((MappingStartEvent) event).isFlow() || checkEmptyMapping()) { expectFlowMapping(); } else { expectBlockMapping(); } } } else { throw new EmitterException("expected NodeEvent, but got " + event); } }
private void handleSequenceStart(ThreadContext context, SequenceStartEvent sse, boolean tainted, IRubyObject handler) { Ruby runtime = context.runtime; IRubyObject anchor = stringOrNilFor(runtime, sse.getAnchor(), tainted); IRubyObject tag = stringOrNilFor(runtime, sse.getTag(), tainted); IRubyObject implicit = runtime.newBoolean(sse.getImplicit()); IRubyObject style = runtime.newFixnum(translateFlowStyle(sse.getFlowStyle())); invoke(context, handler, "start_sequence", anchor, tag, implicit, style); }
@Override public void sequence(SequenceStartEvent evt, YsldValidateContext context) { if (state == State.NEW) { state = State.STARTED; } else { context.error("Unexpected Start of Sequence", evt.getStartMark()); } }
private void expectNode(boolean root, boolean mapping, boolean simpleKey) throws IOException { rootContext = root; mappingContext = mapping; simpleKeyContext = simpleKey; if (event instanceof AliasEvent) { expectAlias(); } else if (event instanceof ScalarEvent || event instanceof CollectionStartEvent) { processAnchor("&"); processTag(); if (event instanceof ScalarEvent) { expectScalar(); } else if (event instanceof SequenceStartEvent) { if (flowLevel != 0 || canonical || ((SequenceStartEvent) event).getFlowStyle() || checkEmptySequence()) { expectFlowSequence(); } else { expectBlockSequence(); } } else {// MappingStartEvent if (flowLevel != 0 || canonical || ((MappingStartEvent) event).getFlowStyle() || checkEmptyMapping()) { expectFlowMapping(); } else { expectBlockMapping(); } } } else { throw new EmitterException("expected NodeEvent, but got " + event); } }
private void handleSequenceStart(ThreadContext context, SequenceStartEvent sse, boolean tainted, IRubyObject handler) { Ruby runtime = context.runtime; IRubyObject anchor = stringOrNilFor(runtime, sse.getAnchor(), tainted); IRubyObject tag = stringOrNilFor(runtime, sse.getTag(), tainted); IRubyObject implicit = runtime.newBoolean(sse.getImplicit()); IRubyObject style = runtime.newFixnum(translateFlowStyle(sse.getFlowStyle())); invoke(context, handler, "start_sequence", anchor, tag, implicit, style); }
@Override public void sequence(SequenceStartEvent evt, YsldValidateContext context) { if (state == State.NEW) { state = State.STARTED; } else if (state == State.STARTED) { YsldValidateHandler sub = getSubValidator(); if (sub instanceof TupleValidator) { ((TupleValidator) sub).reset(); } else if (sub instanceof SequenceValidator) { ((SequenceValidator) sub).reset(); } context.push(sub); sub.sequence(evt, context); } else { context.error("Unexpected Start of Sequence", evt.getStartMark()); } }
private void expectNode(boolean root, boolean mapping, boolean simpleKey) throws IOException { rootContext = root; mappingContext = mapping; simpleKeyContext = simpleKey; if (event instanceof AliasEvent) { expectAlias(); } else if (event instanceof ScalarEvent || event instanceof CollectionStartEvent) { processAnchor("&"); processTag(); if (event instanceof ScalarEvent) { expectScalar(); } else if (event instanceof SequenceStartEvent) { if (flowLevel != 0 || canonical || ((SequenceStartEvent) event).getFlowStyle() || checkEmptySequence()) { expectFlowSequence(); } else { expectBlockSequence(); } } else {// MappingStartEvent if (flowLevel != 0 || canonical || ((MappingStartEvent) event).getFlowStyle() || checkEmptyMapping()) { expectFlowMapping(); } else { expectBlockMapping(); } } } else { throw new EmitterException("expected NodeEvent, but got " + event); } }
protected Node composeSequenceNode(String anchor) { SequenceStartEvent startEvent = (SequenceStartEvent) parser.getEvent(); String tag = startEvent.getTag(); Tag nodeTag; boolean resolved = false; if (tag == null || tag.equals("!")) { nodeTag = resolver.resolve(NodeId.sequence, null, startEvent.getImplicit()); resolved = true; } else { nodeTag = new Tag(tag); } final ArrayList<Node> children = new ArrayList<Node>(); SequenceNode node = new SequenceNode(nodeTag, resolved, children, startEvent.getStartMark(), null, startEvent.getFlowStyle()); if (anchor != null) { anchors.put(anchor, node); } while (!parser.checkEvent(Event.ID.SequenceEnd)) { children.add(composeNode(node)); } Event endEvent = parser.getEvent(); node.setEndMark(endEvent.getEndMark()); return node; }
@Override public final void writeStartArray() throws IOException { _verifyValueWrite("start an array"); _writeContext = _writeContext.createChildArrayContext(); Boolean style = _outputOptions.getDefaultFlowStyle().getStyleBoolean(); String yamlTag = _typeId; boolean implicit = (yamlTag == null); String anchor = _objectId; if (anchor != null) { _objectId = null; } _emitter.emit(new SequenceStartEvent(anchor, yamlTag, implicit, null, null, style)); }
@Override public void sequence(SequenceStartEvent evt, YsldValidateContext context) { if (state == State.NEW) { state = State.STARTED; } else { context.error("Unexpected Start of Sequence", evt.getStartMark()); } }
private void expectNode(boolean root, boolean mapping, boolean simpleKey) throws IOException { rootContext = root; mappingContext = mapping; simpleKeyContext = simpleKey; if (event instanceof AliasEvent) { expectAlias(); } else if (event instanceof ScalarEvent || event instanceof CollectionStartEvent) { processAnchor("&"); processTag(); if (event instanceof ScalarEvent) { expectScalar(); } else if (event instanceof SequenceStartEvent) { if (flowLevel != 0 || canonical || ((SequenceStartEvent) event).isFlow() || checkEmptySequence()) { expectFlowSequence(); } else { expectBlockSequence(); } } else {// MappingStartEvent if (flowLevel != 0 || canonical || ((MappingStartEvent) event).isFlow() || checkEmptyMapping()) { expectFlowMapping(); } else { expectBlockMapping(); } } } else { throw new EmitterException("expected NodeEvent, but got " + event); } }
protected Node composeSequenceNode(String anchor) { SequenceStartEvent startEvent = (SequenceStartEvent) parser.getEvent(); String tag = startEvent.getTag(); Tag nodeTag; boolean resolved = false; if (tag == null || tag.equals("!")) { nodeTag = resolver.resolve(NodeId.sequence, null, startEvent.getImplicit()); resolved = true; } else { nodeTag = new Tag(tag); } final ArrayList<Node> children = new ArrayList<Node>(); SequenceNode node = new SequenceNode(nodeTag, resolved, children, startEvent.getStartMark(), null, startEvent.getFlowStyle()); if (anchor != null) { anchors.put(anchor, node); } while (!parser.checkEvent(Event.ID.SequenceEnd)) { children.add(composeNode(node)); } Event endEvent = parser.getEvent(); node.setEndMark(endEvent.getEndMark()); return node; }
public SldTransformContext sequence() throws IOException { yaml.emit( new SequenceStartEvent( null, null, true, null, null, DumperOptions.FlowStyle.BLOCK)); return this; }
@Override public void sequence(SequenceStartEvent evt, YsldValidateContext context) { if (state == State.NEW) { state = State.STARTED; } else if (state == State.STARTED) { YsldValidateHandler sub = getSubValidator(); if (sub instanceof TupleValidator) { ((TupleValidator) sub).reset(); } else if (sub instanceof SequenceValidator) { ((SequenceValidator) sub).reset(); } context.push(sub); sub.sequence(evt, context); } else { context.error("Unexpected Start of Sequence", evt.getStartMark()); } }
private Node composeSequenceNode(String anchor) { SequenceStartEvent startEvent = (SequenceStartEvent) parser.getEvent(); String tag = startEvent.getTag(); Tag nodeTag; boolean resolved = false; if (tag == null || tag.equals("!")) { nodeTag = resolver.resolve(NodeId.sequence, null, startEvent.getImplicit()); resolved = true; } else { nodeTag = new Tag(tag); } final ArrayList<Node> children = new ArrayList<Node>(); SequenceNode node = new SequenceNode(nodeTag, resolved, children, startEvent.getStartMark(), null, startEvent.getFlowStyle()); if (anchor != null) { anchors.put(anchor, node); } while (!parser.checkEvent(Event.ID.SequenceEnd)) { children.add(composeNode(node)); } Event endEvent = parser.getEvent(); node.setEndMark(endEvent.getEndMark()); return node; }
if (indentlessSequence && scanner.checkToken(Token.ID.BlockEntry)) { endMark = scanner.peekToken().getEndMark(); event = new SequenceStartEvent(anchor, tag, implicit, startMark, endMark, DumperOptions.FlowStyle.BLOCK); state = new ParseIndentlessSequenceEntry(); } else if (scanner.checkToken(Token.ID.FlowSequenceStart)) { endMark = scanner.peekToken().getEndMark(); event = new SequenceStartEvent(anchor, tag, implicit, startMark, endMark, DumperOptions.FlowStyle.FLOW); state = new ParseFlowSequenceFirstEntry(); } else if (block && scanner.checkToken(Token.ID.BlockSequenceStart)) { endMark = scanner.peekToken().getStartMark(); event = new SequenceStartEvent(anchor, tag, implicit, startMark, endMark, DumperOptions.FlowStyle.BLOCK); state = new ParseBlockSequenceFirstEntry();
boolean implicitS = node.getTag().equals(this.resolver.resolve(NodeId.sequence, null, true)); this.emitter.emit(new SequenceStartEvent(tAlias, node.getTag().getValue(), implicitS, null, null, seqNode.getFlowStyle())); List<Node> list = seqNode.getValue();
public SldTransformContext sequence() throws IOException { yaml.emit(new SequenceStartEvent(null, null, true, null, null, false)); return this; }