@@ -35,6 +35,17 @@ public class ContentReference
35
35
protected final static ContentReference UNKNOWN_CONTENT =
36
36
new ContentReference (false , null );
37
37
38
+ /**
39
+ * As content will be redacted by default in Jackson 2.16 and later,
40
+ * we'll use a new marker reference for slightly different description
41
+ * from "unknown", to indicate explicit removal of source/content reference
42
+ * (as opposed to it missing from not being available or so)
43
+ *
44
+ * @since 2.16
45
+ */
46
+ protected final static ContentReference REDACTED_CONTENT =
47
+ new ContentReference (false , null );
48
+
38
49
/**
39
50
* Include at most first 500 characters/bytes from contents; should be enough
40
51
* to give context, but not cause unfortunate side effects in things like
@@ -100,6 +111,20 @@ public static ContentReference unknown() {
100
111
return UNKNOWN_CONTENT ;
101
112
}
102
113
114
+ /**
115
+ * Accessor for getting a placeholder when actual content
116
+ * is not to be exposed: different from {@link #unknown()} where
117
+ * content is not available to be referenced.
118
+ *
119
+ * @return Placeholder instance to use in cases where reference is explicitly
120
+ * blocked, usually for security reasons.
121
+ *
122
+ * @since 2.16
123
+ */
124
+ public static ContentReference redacted () {
125
+ return REDACTED_CONTENT ;
126
+ }
127
+
103
128
public static ContentReference construct (boolean isContentTextual , Object rawContent ) {
104
129
return new ContentReference (isContentTextual , rawContent );
105
130
}
0 commit comments