Skip to content

Commit cfb8d27

Browse files
committed
Add release notes wrt #715
1 parent 8bed4d8 commit cfb8d27

File tree

3 files changed

+40
-13
lines changed

3 files changed

+40
-13
lines changed

release-notes/CREDITS-2.x

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,7 @@ Andrey Somov (asomov@github)
282282
Ilya Golovin (ilgo0413@github)
283283
* Contributed #684: Add "JsonPointer#appendProperty" and "JsonPointer#appendIndex"
284284
(2.14.0)
285+
286+
Nik Everett (nik9000@github)
287+
* Contributed #715: Allow TokenFilters to keep empty arrays and objects
288+
(2.14.0)

release-notes/VERSION-2.x

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ JSON library.
1818

1919
#684: Add "JsonPointer#appendProperty" and "JsonPointer#appendIndex"
2020
(contributed by Ilya G)
21+
#715: Allow TokenFilters to keep empty arrays and objects
22+
(contributed by Nik E)
2123

2224
2.13.2 (not yet released)
2325

src/main/java/com/fasterxml/jackson/core/filter/TokenFilter.java

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
public class TokenFilter
1717
{
18-
1918
/**
2019
* Enumeration that controls how TokenFilter return values are interpreted.
2120
*
@@ -58,9 +57,9 @@ public enum Inclusion {
5857
protected TokenFilter() { }
5958

6059
/*
61-
/**********************************************************
60+
/**********************************************************************
6261
/* API, structured values
63-
/**********************************************************
62+
/**********************************************************************
6463
*/
6564

6665
/**
@@ -134,9 +133,9 @@ public void filterFinishObject() { }
134133
public void filterFinishArray() { }
135134

136135
/*
137-
/**********************************************************
136+
/**********************************************************************
138137
/* API, properties/elements
139-
/**********************************************************
138+
/**********************************************************************
140139
*/
141140

142141
/**
@@ -224,9 +223,9 @@ public TokenFilter includeRootValue(int index) {
224223
}
225224

226225
/*
227-
/**********************************************************
226+
/**********************************************************************
228227
/* API, scalar values (being read)
229-
/**********************************************************
228+
/**********************************************************************
230229
*/
231230

232231
/**
@@ -249,9 +248,9 @@ public boolean includeValue(JsonParser p) throws IOException {
249248
}
250249

251250
/*
252-
/**********************************************************
251+
/**********************************************************************
253252
/* API, scalar values (being written)
254-
/**********************************************************
253+
/**********************************************************************
255254
*/
256255

257256
/**
@@ -432,18 +431,40 @@ public boolean includeEmbeddedValue(Object value) {
432431
return _includeScalar();
433432
}
434433

434+
/**
435+
* Call made to verify whether leaf-level empty Array value
436+
* should be included in output or not.
437+
*
438+
* @param contentsFiltered True if Array had contents but they were
439+
* filtered out (NOT included); false if we had actual empty Array.
440+
*
441+
* @return True if value is to be included; false if not
442+
*
443+
* @since 2.14
444+
*/
435445
public boolean includeEmptyArray(boolean contentsFiltered) {
436446
return false;
437447
}
438448

449+
/**
450+
* Call made to verify whether leaf-level empty Object value
451+
* should be included in output or not.
452+
*
453+
* @param contentsFiltered True if Object had contents but they were
454+
* filtered out (NOT included); false if we had actual empty Object.
455+
*
456+
* @return True if value is to be included; false if not
457+
*
458+
* @since 2.14
459+
*/
439460
public boolean includeEmptyObject(boolean contentsFiltered) {
440461
return false;
441462
}
442463

443464
/*
444-
/**********************************************************
465+
/**********************************************************************
445466
/* Overrides
446-
/**********************************************************
467+
/**********************************************************************
447468
*/
448469

449470
@Override
@@ -455,9 +476,9 @@ public String toString() {
455476
}
456477

457478
/*
458-
/**********************************************************
479+
/**********************************************************************
459480
/* Other methods
460-
/**********************************************************
481+
/**********************************************************************
461482
*/
462483

463484
/**

0 commit comments

Comments
 (0)