@@ -58,15 +58,22 @@ public enum Feature implements FormatFeature // since 2.9
5858
5959        /** 
6060         * Do we try to force so-called canonical output or not. 
61+          * <p> 
62+          *     Ignored if you provide your own {@code DumperOptions}. 
63+          * </p> 
6164         */ 
6265        CANONICAL_OUTPUT (false ),
6366
6467        /** 
6568         * Options passed to SnakeYAML that determines whether longer textual content 
6669         * gets automatically split into multiple lines or not. 
67-          *<p> 
68-          * Feature is enabled by default to conform to SnakeYAML defaults as well as 
69-          * backwards compatibility with 2.5 and earlier versions. 
70+          * <p> 
71+          *     Feature is enabled by default to conform to SnakeYAML defaults as well as 
72+          *     backwards compatibility with 2.5 and earlier versions. 
73+          * </p> 
74+          * <p> 
75+          *     Ignored if you provide your own {@code DumperOptions}. 
76+          * </p> 
7077         * 
7178         * @since 2.6 
7279         */ 
@@ -75,10 +82,11 @@ public enum Feature implements FormatFeature // since 2.9
7582        /** 
7683         * Whether strings will be rendered without quotes (true) or 
7784         * with quotes (false, default). 
78-          *<p> 
79-          * Minimized quote usage makes for more human readable output; however, content is 
80-          * limited to printable characters according to the rules of 
81-          * <a href="http://www.yaml.org/spec/1.2/spec.html#style/block/literal">literal block style</a>. 
85+          * <p> 
86+          *     Minimized quote usage makes for more human readable output; however, content is 
87+          *     limited to printable characters according to the rules of 
88+          *     <a href="http://www.yaml.org/spec/1.2/spec.html#style/block/literal">literal block style</a>. 
89+          * </p> 
8290         * 
8391         * @since 2.7 
8492         */ 
@@ -87,10 +95,11 @@ public enum Feature implements FormatFeature // since 2.9
8795        /** 
8896         * Whether numbers stored as strings will be rendered with quotes (true) or 
8997         * without quotes (false, default) when MINIMIZE_QUOTES is enabled. 
90-          *<p> 
91-          * Minimized quote usage makes for more human readable output; however, content is 
92-          * limited to printable characters according to the rules of 
93-          * <a href="http://www.yaml.org/spec/1.2/spec.html#style/block/literal">literal block style</a>. 
98+          * <p> 
99+          *     Minimized quote usage makes for more human readable output; however, content is 
100+          *     limited to printable characters according to the rules of 
101+          *     <a href="http://www.yaml.org/spec/1.2/spec.html#style/block/literal">literal block style</a>. 
102+          * </p> 
94103         * 
95104         * @since 2.8.2 
96105         */ 
@@ -101,8 +110,9 @@ public enum Feature implements FormatFeature // since 2.9
101110         * <a href="http://www.yaml.org/spec/1.2/spec.html#style/block/literal">literal block style</a> 
102111         * should be used. This automatically enabled when {@link #MINIMIZE_QUOTES} is set. 
103112         * <p> 
104-          * The content of such strings is limited to printable characters according to the rules of 
105-          * <a href="http://www.yaml.org/spec/1.2/spec.html#style/block/literal">literal block style</a>. 
113+          *     The content of such strings is limited to printable characters according to the rules of 
114+          *     <a href="http://www.yaml.org/spec/1.2/spec.html#style/block/literal">literal block style</a>. 
115+          * </p> 
106116         * 
107117         * @since 2.9 
108118         */ 
@@ -111,17 +121,25 @@ public enum Feature implements FormatFeature // since 2.9
111121        /** 
112122         * Feature enabling of which adds indentation for array entry generation 
113123         * (default indentation being 2 spaces). 
114-          *<p> 
115-          * Default value is {@code false} for backwards compatibility 
124+          * <p> 
125+          *     Default value is {@code false} for backwards compatibility 
126+          * </p> 
127+          * <p> 
128+          *     Ignored if you provide your own {@code DumperOptions}. 
129+          * </p> 
116130         * 
117131         * @since 2.9 
118132         */ 
119133        INDENT_ARRAYS (false ),
120134        /** 
121135         * Feature enabling of which adds indentation with indicator for array entry generation 
122136         * (default indentation being 2 spaces). 
123-          *<p> 
124-          * Default value is {@code false} for backwards compatibility 
137+          * <p> 
138+          *     Default value is {@code false} for backwards compatibility 
139+          * </p> 
140+          * <p> 
141+          *     Ignored if you provide your own {@code DumperOptions}. 
142+          * </p> 
125143         * 
126144         * @since 2.12 
127145         */ 
@@ -132,7 +150,11 @@ public enum Feature implements FormatFeature // since 2.9
132150         * serialization should be same as what the default is for current platform. 
133151         * If disabled, Unix linefeed ({@code \n}) will be used. 
134152         * <p> 
135-          * Default value is {@code false} for backwards compatibility. 
153+          *     Default value is {@code false} for backwards compatibility 
154+          * </p> 
155+          * <p> 
156+          *     Ignored if you provide your own {@code DumperOptions}. 
157+          * </p> 
136158         * 
137159         * @since 2.9.6 
138160         */ 
@@ -144,8 +166,12 @@ public enum Feature implements FormatFeature // since 2.9
144166         * If disabled, the max key length is left as 128 characters: longer names 
145167         * are truncated. If enabled, limit is raised to 1024 characters. 
146168         * <p> 
147-          * Default value is {@code false} for backwards-compatibility (same as behavior 
148-          * before this feature was added). 
169+          *     Default value is {@code false} for backwards-compatibility (same as behavior 
170+          *     before this feature was added). 
171+          * </p> 
172+          * <p> 
173+          *     Ignored if you provide your own {@code DumperOptions}. 
174+          * </p> 
149175         *  
150176         * @since 2.14 
151177         */ 
@@ -283,6 +309,30 @@ public YAMLGenerator(IOContext ctxt, int jsonFeatures, int yamlFeatures,
283309        _emitStartDocument ();
284310    }
285311
312+     /** 
313+      * @since 2.14 
314+      */ 
315+     public  YAMLGenerator (IOContext  ctxt , int  jsonFeatures , int  yamlFeatures ,
316+                          StringQuotingChecker  quotingChecker ,
317+                          ObjectCodec  codec , Writer  out ,
318+                          org .yaml .snakeyaml .DumperOptions  dumperOptions )
319+             throws  IOException 
320+     {
321+         super (jsonFeatures , codec );
322+         _ioContext  = ctxt ;
323+         _formatFeatures  = yamlFeatures ;
324+         _quotingChecker  = (quotingChecker  == null )
325+                 ? StringQuotingChecker .Default .instance () : quotingChecker ;
326+         _writer  = out ;
327+         _docVersion  = dumperOptions .getVersion ();
328+         _outputOptions  = dumperOptions ;
329+ 
330+         _emitter  = new  Emitter (_writer , _outputOptions );
331+         // should we start output now, or try to defer? 
332+         _emit (new  StreamStartEvent (null , null ));
333+         _emitStartDocument ();
334+     }
335+ 
286336    @ Deprecated  // since 2.12 
287337    public  YAMLGenerator (IOContext  ctxt , int  jsonFeatures , int  yamlFeatures ,
288338            ObjectCodec  codec , Writer  out ,
0 commit comments