public void expect() throws IOException { if (event instanceof DocumentStartEvent) { DocumentStartEvent ev = (DocumentStartEvent) event; if ((ev.getVersion() != null || ev.getTags() != null) && openEnded) { writeIndicator("...", true, false, false); writeIndent(); if (ev.getTags() != null) { Set<String> handles = new TreeSet<String>(ev.getTags().keySet()); for (String handle : handles) { String prefix = ev.getTags().get(handle); tagPrefixes.put(prefix, handle); String handleText = prepareTagHandle(handle); && (ev.getTags() == null || ev.getTags().isEmpty()) && !checkEmptyDocument(); if (!implicit) {
public void expect() throws IOException { if (event instanceof DocumentStartEvent) { DocumentStartEvent ev = (DocumentStartEvent) event; if ((ev.getVersion() != null || ev.getTags() != null) && openEnded) { writeIndicator("...", true, false, false); writeIndent(); if (ev.getTags() != null) { Set<String> handles = new TreeSet<String>(ev.getTags().keySet()); for (String handle : handles) { String prefix = ev.getTags().get(handle); tagPrefixes.put(prefix, handle); String handleText = prepareTagHandle(handle); && (ev.getTags() == null || ev.getTags().isEmpty()) && !checkEmptyDocument(); if (!implicit) {
public void expect() throws IOException { if (event instanceof DocumentStartEvent) { DocumentStartEvent ev = (DocumentStartEvent) event; if ((ev.getVersion() != null || ev.getTags() != null) && openEnded) { writeIndicator("...", true, false, false); writeIndent(); if (ev.getTags() != null) { Set<String> handles = new TreeSet<String>(ev.getTags().keySet()); for (String handle : handles) { String prefix = ev.getTags().get(handle); tagPrefixes.put(prefix, handle); String handleText = prepareTagHandle(handle); && (ev.getTags() == null || ev.getTags().isEmpty()) && !checkEmptyDocument(); if (!implicit) {
public void expect() throws IOException { if (event instanceof DocumentStartEvent) { DocumentStartEvent ev = (DocumentStartEvent) event; if ((ev.getVersion() != null || ev.getTags() != null) && openEnded) { writeIndicator("...", true, false, false); writeIndent(); if (ev.getTags() != null) { Set<String> handles = new TreeSet<String>(ev.getTags().keySet()); for (String handle : handles) { String prefix = ev.getTags().get(handle); tagPrefixes.put(prefix, handle); String handleText = prepareTagHandle(handle); && (ev.getTags() == null || ev.getTags().isEmpty()) && !checkEmptyDocument(); if (!implicit) {
private void handleDocumentStart(ThreadContext context, DocumentStartEvent dse, boolean tainted, IRubyObject handler) { Ruby runtime = context.runtime; DumperOptions.Version _version = dse.getVersion(); Integer[] versionInts = _version == null ? null : _version.getArray(); IRubyObject version = versionInts == null ? RubyArray.newArray(runtime) : RubyArray.newArray(runtime, runtime.newFixnum(versionInts[0]), runtime.newFixnum(versionInts[1])); Map<String, String> tagsMap = dse.getTags(); RubyArray tags = RubyArray.newArray(runtime); if (tagsMap != null && tagsMap.size() > 0) { for (Map.Entry<String, String> tag : tagsMap.entrySet()) { IRubyObject key = stringFor(runtime, tag.getKey(), tainted); IRubyObject value = stringFor(runtime, tag.getValue(), tainted); tags.append(RubyArray.newArray(runtime, key, value)); } } IRubyObject notExplicit = runtime.newBoolean(!dse.getExplicit()); invoke(context, handler, "start_document", version, tags, notExplicit); }
private void handleDocumentStart(ThreadContext context, DocumentStartEvent dse, boolean tainted, IRubyObject handler) { Ruby runtime = context.runtime; DumperOptions.Version _version = dse.getVersion(); Integer[] versionInts = _version == null ? null : _version.getArray(); IRubyObject version = versionInts == null ? RubyArray.newArray(runtime) : RubyArray.newArray(runtime, runtime.newFixnum(versionInts[0]), runtime.newFixnum(versionInts[1])); Map<String, String> tagsMap = dse.getTags(); RubyArray tags = RubyArray.newArray(runtime); if (tagsMap != null && tagsMap.size() > 0) { for (Map.Entry<String, String> tag : tagsMap.entrySet()) { IRubyObject key = stringFor(runtime, tag.getKey(), tainted); IRubyObject value = stringFor(runtime, tag.getValue(), tainted); tags.append(RubyArray.newArray(runtime, key, value)); } } IRubyObject notExplicit = runtime.newBoolean(!dse.getExplicit()); invoke(context, handler, "start_document", version, tags, notExplicit); }