this.bestWidth = opts.getWidth(); this.bestLineBreak = opts.getLineBreak().getString().toCharArray(); this.splitLines = opts.getSplitLines();
public static LineBreak getPlatformLineBreak() { String platformLineBreak = System.getProperty("line.separator"); for (LineBreak lb : values()) { if (lb.lineBreak.equals(platformLineBreak)) { return lb; } } return LineBreak.UNIX; } }
this.bestWidth = opts.getWidth(); this.bestLineBreak = opts.getLineBreak().getString().toCharArray(); this.splitLines = opts.getSplitLines();
this.bestWidth = opts.getWidth(); this.bestLineBreak = opts.getLineBreak().getString().toCharArray(); this.splitLines = opts.getSplitLines();
this.bestWidth = opts.getWidth(); this.bestLineBreak = opts.getLineBreak().getString().toCharArray(); this.splitLines = opts.getSplitLines();
dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); dumperOptions.setPrettyFlow(true); dumperOptions.setLineBreak(DumperOptions.LineBreak.getPlatformLineBreak()); Yaml yaml = new Yaml(dumperOptions); return yaml.dump(skipperConfigValuesMap);
dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); dumperOptions.setPrettyFlow(true); dumperOptions.setLineBreak(DumperOptions.LineBreak.getPlatformLineBreak()); Yaml yaml = new Yaml(dumperOptions); return yaml.dump(skipperConfigValuesMap);
protected DumperOptions buildDumperOptions(int streamWriteFeatures, int yamlFeatures, org.yaml.snakeyaml.DumperOptions.Version version) { DumperOptions opt = new DumperOptions(); // would we want canonical? if (Feature.CANONICAL_OUTPUT.enabledIn(_formatWriteFeatures)) { opt.setCanonical(true); } else { opt.setCanonical(false); // if not, MUST specify flow styles opt.setDefaultFlowStyle(FlowStyle.BLOCK); } // split-lines for text blocks? opt.setSplitLines(Feature.SPLIT_LINES.enabledIn(_formatWriteFeatures)); // array indentation? if (Feature.INDENT_ARRAYS.enabledIn(_formatWriteFeatures)) { // But, wrt [dataformats-text#34]: need to set both to diff values to work around bug // (otherwise indentation level is "invisible". Note that this should NOT be necessary // but is needed up to at least SnakeYAML 1.18. // Also looks like all kinds of values do work, except for both being 2... weird. opt.setIndicatorIndent(1); opt.setIndent(2); } // 14-May-2018: [dataformats-text#84] allow use of platform linefeed if (Feature.USE_PLATFORM_LINE_BREAKS.enabledIn(_formatWriteFeatures)) { opt.setLineBreak(DumperOptions.LineBreak.getPlatformLineBreak()); } return opt; }
public static LineBreak getPlatformLineBreak() { String platformLineBreak = System.getProperty("line.separator"); for (LineBreak lb : values()) { if (lb.lineBreak.equals(platformLineBreak)) { return lb; } } return LineBreak.UNIX; } }
@Override public String toString() { return "Line break: " + name(); }
@Override public String toString() { return "Line break: " + name(); }
@Override public String toString() { return "Line break: " + name(); }
@Override public void setLineBreak(LineBreak lineBreak) { super.setLineBreak(LineBreak.getPlatformLineBreak()); } }
public static LineBreak getPlatformLineBreak() { String platformLineBreak = System.getProperty("line.separator"); for (LineBreak lb : values()) { if (lb.lineBreak.equals(platformLineBreak)) { return lb; } } return LineBreak.UNIX; } }
public static LineBreak getPlatformLineBreak() { String platformLineBreak = System.getProperty("line.separator"); for (LineBreak lb : values()) { if (lb.lineBreak.equals(platformLineBreak)) { return lb; } } return LineBreak.UNIX; } }
protected DumperOptions buildDumperOptions(int jsonFeatures, int yamlFeatures, org.yaml.snakeyaml.DumperOptions.Version version) { DumperOptions opt = new DumperOptions(); // would we want canonical? if (Feature.CANONICAL_OUTPUT.enabledIn(_formatFeatures)) { opt.setCanonical(true); } else { opt.setCanonical(false); // if not, MUST specify flow styles opt.setDefaultFlowStyle(FlowStyle.BLOCK); } // split-lines for text blocks? opt.setSplitLines(Feature.SPLIT_LINES.enabledIn(_formatFeatures)); // array indentation? if (Feature.INDENT_ARRAYS.enabledIn(_formatFeatures)) { // But, wrt [dataformats-text#34]: need to set both to diff values to work around bug // (otherwise indentation level is "invisible". Note that this should NOT be necessary // but is needed up to at least SnakeYAML 1.18. // Also looks like all kinds of values do work, except for both being 2... weird. opt.setIndicatorIndent(1); opt.setIndent(2); } // 14-May-2018: [dataformats-text#84] allow use of platform linefeed if (Feature.USE_PLATFORM_LINE_BREAKS.enabledIn(_formatFeatures)) { opt.setLineBreak(DumperOptions.LineBreak.getPlatformLineBreak()); } return opt; }
protected DumperOptions buildDumperOptions(int jsonFeatures, int yamlFeatures, org.yaml.snakeyaml.DumperOptions.Version version) { DumperOptions opt = new DumperOptions(); // would we want canonical? if (Feature.CANONICAL_OUTPUT.enabledIn(_formatFeatures)) { opt.setCanonical(true); } else { opt.setCanonical(false); // if not, MUST specify flow styles opt.setDefaultFlowStyle(FlowStyle.BLOCK); } // split-lines for text blocks? opt.setSplitLines(Feature.SPLIT_LINES.enabledIn(_formatFeatures)); // array indentation? if (Feature.INDENT_ARRAYS.enabledIn(_formatFeatures)) { // But, wrt [dataformats-text#34]: need to set both to diff values to work around bug // (otherwise indentation level is "invisible". Note that this should NOT be necessary // but is needed up to at least SnakeYAML 1.18. // Also looks like all kinds of values do work, except for both being 2... weird. opt.setIndicatorIndent(1); opt.setIndent(2); } // 14-May-2018: [dataformats-text#84] allow use of platform linefeed if (Feature.USE_PLATFORM_LINE_BREAKS.enabledIn(_formatFeatures)) { opt.setLineBreak(DumperOptions.LineBreak.getPlatformLineBreak()); } return opt; }
@Override public String toString() { return "Line break: " + name(); }