@@ -253,21 +253,30 @@ public void initGenerator() throws JacksonException
253253
254254 /*
255255 /**********************************************************************
256- /* Overridden output state handling methods
256+ /* Overrides: capability introspection
257257 /**********************************************************************
258258 */
259-
260- @ Override
261- public final TokenStreamContext streamWriteContext () { return _streamWriteContext ; }
259+
260+ @ Override // @since 3.2
261+ public boolean canWriteComments () { return true ; }
262+
263+ // Base class impl fine:
264+ //@Override public boolean canWriteObjectId() { return false; }
265+
266+ // Base class impl fine:
267+ //@Override public boolean canOmitProperties() { return true; }
268+
269+ // Base class impl fine:
270+ //@Override public boolean canWriteTypeId() { return false; }
262271
263272 @ Override
264- public final Object currentValue ( ) {
265- return _streamWriteContext . currentValue ( );
273+ public boolean has ( StreamWriteCapability capability ) {
274+ return DEFAULT_TEXTUAL_WRITE_CAPABILITIES . isEnabled ( capability );
266275 }
267276
268277 @ Override
269- public final void assignCurrentValue ( Object v ) {
270- _streamWriteContext . assignCurrentValue ( v ) ;
278+ public JacksonFeatureSet < StreamWriteCapability > streamWriteCapabilities ( ) {
279+ return DEFAULT_TEXTUAL_WRITE_CAPABILITIES ;
271280 }
272281
273282 /*
@@ -297,6 +306,25 @@ public int streamWriteOutputBuffered() {
297306 return -1 ;
298307 }
299308
309+ /*
310+ /**********************************************************************
311+ /* Overridden output state handling methods
312+ /**********************************************************************
313+ */
314+
315+ @ Override
316+ public final TokenStreamContext streamWriteContext () { return _streamWriteContext ; }
317+
318+ @ Override
319+ public final Object currentValue () {
320+ return _streamWriteContext .currentValue ();
321+ }
322+
323+ @ Override
324+ public final void assignCurrentValue (Object v ) {
325+ _streamWriteContext .assignCurrentValue (v );
326+ }
327+
300328 /*
301329 /**********************************************************************
302330 /* Extended API, configuration
@@ -316,16 +344,6 @@ public ToXmlGenerator configure(XmlWriteFeature f, boolean state) {
316344 return this ;
317345 }
318346
319- @ Override
320- public boolean has (StreamWriteCapability capability ) {
321- return DEFAULT_TEXTUAL_WRITE_CAPABILITIES .isEnabled (capability );
322- }
323-
324- @ Override
325- public JacksonFeatureSet <StreamWriteCapability > streamWriteCapabilities () {
326- return DEFAULT_TEXTUAL_WRITE_CAPABILITIES ;
327- }
328-
329347 public boolean inRoot () {
330348 return _streamWriteContext .inRoot ();
331349 }
@@ -906,6 +924,27 @@ public JsonGenerator writeRaw(char c) throws JacksonException
906924 return writeRaw (String .valueOf (c ));
907925 }
908926
927+ /*
928+ /**********************************************************************
929+ /* Output method implementations, comments
930+ /**********************************************************************
931+ */
932+
933+ @ Override // @since 3.2
934+ public JsonGenerator writeComment (String comment ) throws JacksonException
935+ {
936+ try {
937+ if (comment != null ) {
938+ _xmlWriter .writeComment (comment );
939+ } else {
940+ _xmlWriter .writeSpace ("\n " );
941+ }
942+ } catch (XMLStreamException e ) {
943+ StaxUtil .throwAsWriteException (e , this );
944+ }
945+ return this ;
946+ }
947+
909948 /*
910949 /**********************************************************************
911950 /* Output method implementations, base64-encoded binary
0 commit comments