Skip to content

Commit

Permalink
Add release notes wrt #715
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 3, 2022
1 parent 8bed4d8 commit cfb8d27
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
4 changes: 4 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,7 @@ Andrey Somov (asomov@github)
Ilya Golovin (ilgo0413@github)
* Contributed #684: Add "JsonPointer#appendProperty" and "JsonPointer#appendIndex"
(2.14.0)

Nik Everett (nik9000@github)
* Contributed #715: Allow TokenFilters to keep empty arrays and objects
(2.14.0)
2 changes: 2 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ JSON library.

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

2.13.2 (not yet released)

Expand Down
47 changes: 34 additions & 13 deletions src/main/java/com/fasterxml/jackson/core/filter/TokenFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
public class TokenFilter
{

/**
* Enumeration that controls how TokenFilter return values are interpreted.
*
Expand Down Expand Up @@ -58,9 +57,9 @@ public enum Inclusion {
protected TokenFilter() { }

/*
/**********************************************************
/**********************************************************************
/* API, structured values
/**********************************************************
/**********************************************************************
*/

/**
Expand Down Expand Up @@ -134,9 +133,9 @@ public void filterFinishObject() { }
public void filterFinishArray() { }

/*
/**********************************************************
/**********************************************************************
/* API, properties/elements
/**********************************************************
/**********************************************************************
*/

/**
Expand Down Expand Up @@ -224,9 +223,9 @@ public TokenFilter includeRootValue(int index) {
}

/*
/**********************************************************
/**********************************************************************
/* API, scalar values (being read)
/**********************************************************
/**********************************************************************
*/

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

/*
/**********************************************************
/**********************************************************************
/* API, scalar values (being written)
/**********************************************************
/**********************************************************************
*/

/**
Expand Down Expand Up @@ -432,18 +431,40 @@ public boolean includeEmbeddedValue(Object value) {
return _includeScalar();
}

/**
* Call made to verify whether leaf-level empty Array value
* should be included in output or not.
*
* @param contentsFiltered True if Array had contents but they were
* filtered out (NOT included); false if we had actual empty Array.
*
* @return True if value is to be included; false if not
*
* @since 2.14
*/
public boolean includeEmptyArray(boolean contentsFiltered) {
return false;
}

/**
* Call made to verify whether leaf-level empty Object value
* should be included in output or not.
*
* @param contentsFiltered True if Object had contents but they were
* filtered out (NOT included); false if we had actual empty Object.
*
* @return True if value is to be included; false if not
*
* @since 2.14
*/
public boolean includeEmptyObject(boolean contentsFiltered) {
return false;
}

/*
/**********************************************************
/**********************************************************************
/* Overrides
/**********************************************************
/**********************************************************************
*/

@Override
Expand All @@ -455,9 +476,9 @@ public String toString() {
}

/*
/**********************************************************
/**********************************************************************
/* Other methods
/**********************************************************
/**********************************************************************
*/

/**
Expand Down

0 comments on commit cfb8d27

Please sign in to comment.