|
10 | 10 |
|
11 | 11 | import org.yaml.snakeyaml.DumperOptions;
|
12 | 12 | import org.yaml.snakeyaml.DumperOptions.FlowStyle;
|
| 13 | +import org.yaml.snakeyaml.DumperOptions.ScalarStyle; |
13 | 14 | import org.yaml.snakeyaml.emitter.Emitter;
|
14 | 15 | import org.yaml.snakeyaml.events.*;
|
15 | 16 | import org.yaml.snakeyaml.nodes.Tag;
|
@@ -173,7 +174,7 @@ private Feature(boolean defaultState) {
|
173 | 174 |
|
174 | 175 | // Which flow style to use for Base64? Maybe basic quoted?
|
175 | 176 | // 29-Nov-2017, tatu: Actually SnakeYAML uses block style so:
|
176 |
| - private final static Character STYLE_BASE64 = STYLE_LITERAL; |
| 177 | + private final static ScalarStyle STYLE_BASE64 = ScalarStyle.createStyle(STYLE_LITERAL); |
177 | 178 |
|
178 | 179 | private final static Character STYLE_PLAIN = null;
|
179 | 180 |
|
@@ -428,7 +429,7 @@ public final void writeStartArray() throws IOException
|
428 | 429 | {
|
429 | 430 | _verifyValueWrite("start an array");
|
430 | 431 | _outputContext = _outputContext.createChildArrayContext();
|
431 |
| - Boolean style = _outputOptions.getDefaultFlowStyle().getStyleBoolean(); |
| 432 | + FlowStyle style = _outputOptions.getDefaultFlowStyle(); |
432 | 433 | String yamlTag = _typeId;
|
433 | 434 | boolean implicit = (yamlTag == null);
|
434 | 435 | String anchor = _objectId;
|
@@ -456,7 +457,7 @@ public final void writeStartObject() throws IOException
|
456 | 457 | {
|
457 | 458 | _verifyValueWrite("start an object");
|
458 | 459 | _outputContext = _outputContext.createChildObjectContext();
|
459 |
| - Boolean style = _outputOptions.getDefaultFlowStyle().getStyleBoolean(); |
| 460 | + FlowStyle style = _outputOptions.getDefaultFlowStyle(); |
460 | 461 | String yamlTag = _typeId;
|
461 | 462 | boolean implicit = (yamlTag == null);
|
462 | 463 | String anchor = _objectId;
|
@@ -799,6 +800,6 @@ protected ScalarEvent _scalarEvent(String value, Character style)
|
799 | 800 | // 29-Nov-2017, tatu: Not 100% sure why we don't force explicit tags for
|
800 | 801 | // type id, but trying to do so seems to double up tag output...
|
801 | 802 | return new ScalarEvent(anchor, yamlTag, NO_TAGS, value,
|
802 |
| - null, null, style); |
| 803 | + null, null, ScalarStyle.createStyle(style)); |
803 | 804 | }
|
804 | 805 | }
|
0 commit comments