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() {
42
42
*/
43
43
public PrettyPrinter getPrettyPrinter ();
44
44
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
+
45
55
public SerializableString getRootValueSeparator (SerializableString defaultSeparator );
46
56
47
57
public int getStreamWriteFeatures (int defaults );
@@ -114,6 +124,11 @@ public static class Base implements ObjectWriteContext {
114
124
@ Override
115
125
public PrettyPrinter getPrettyPrinter () { return null ; }
116
126
127
+ @ Override
128
+ public boolean hasPrettyPrinter () {
129
+ return getPrettyPrinter () != null ;
130
+ }
131
+
117
132
@ Override
118
133
public SerializableString getRootValueSeparator (SerializableString defaultSeparator ) {
119
134
return defaultSeparator ;
You can’t perform that action at this time.
0 commit comments