Skip to content

Commit 073183c

Browse files
committed
Minor addition in preparation of #991
1 parent e85e2d5 commit 073183c

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/main/java/com/fasterxml/jackson/core/base/ParserBase.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,14 +1526,30 @@ protected Object _getSourceReference() {
15261526
* Helper method used to encapsulate logic of including (or not) of
15271527
* "content reference" when constructing {@link JsonLocation} instances.
15281528
*
1529-
* @return Source reference object, if any; {@code null} if none
1529+
* @return ContentReference object to use.
15301530
*
15311531
* @since 2.13
15321532
*/
15331533
protected ContentReference _contentReference() {
15341534
if (JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION.enabledIn(_features)) {
15351535
return _ioContext.contentReference();
15361536
}
1537+
return _contentReferenceNoSource();
1538+
}
1539+
1540+
/**
1541+
* Helper method used to encapsulate logic of providing
1542+
* "content reference" when constructing {@link JsonLocation} instances
1543+
* and source information is <b>NOT</b> to be included
1544+
* ({@code StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION} disabled).
1545+
*<p>
1546+
* Default implementation will simply return {@code ContentReference.unknown()}.
1547+
*
1548+
* @return ContentReference object to use when source is not to be included
1549+
*
1550+
* @since 2.16
1551+
*/
1552+
protected ContentReference _contentReferenceNoSource() {
15371553
return ContentReference.unknown();
15381554
}
15391555

0 commit comments

Comments
 (0)