File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/main/java/com/fasterxml/jackson/core Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,16 @@ public static ObjectWriteContext empty() {
4242 */
4343 public PrettyPrinter getPrettyPrinter ();
4444
45+ /**
46+ * Accessor similar to {@link #getPrettyPrinter()} but which only indicates whether
47+ * a non-{@code null} instance would be constructed if requested, or not.
48+ * This is useful for backends that have custom pretty-printing instead of relying on
49+ * Jackson standard mechanism.
50+ *
51+ * @return True if {@link #getPrettyPrinter()} would return non-{@code null}; false otherwise.
52+ */
53+ public boolean hasPrettyPrinter ();
54+
4555 public SerializableString getRootValueSeparator (SerializableString defaultSeparator );
4656
4757 public int getStreamWriteFeatures (int defaults );
@@ -114,6 +124,11 @@ public static class Base implements ObjectWriteContext {
114124 @ Override
115125 public PrettyPrinter getPrettyPrinter () { return null ; }
116126
127+ @ Override
128+ public boolean hasPrettyPrinter () {
129+ return getPrettyPrinter () != null ;
130+ }
131+
117132 @ Override
118133 public SerializableString getRootValueSeparator (SerializableString defaultSeparator ) {
119134 return defaultSeparator ;
You can’t perform that action at this time.
0 commit comments