juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [juneau] branch master updated: Replace SERIALIZER_trimNullProperties with SERIALIZER_keepNullProperties.
Date Thu, 09 Apr 2020 18:35:46 GMT
This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new 300bf06  Replace SERIALIZER_trimNullProperties with SERIALIZER_keepNullProperties.
300bf06 is described below

commit 300bf06f1c82d9984a00c1463ebd41d5c2149d29
Author: JamesBognar <jamesbognar@apache.org>
AuthorDate: Thu Apr 9 14:35:27 2020 -0400

    Replace SERIALIZER_trimNullProperties with
    SERIALIZER_keepNullProperties.
---
 .../test/java/org/apache/juneau/BeanMapTest.java   |  6 +-
 .../java/org/apache/juneau/DynaBeanComboTest.java  |  2 +-
 .../juneau/SerializerPropertiesComboTest.java      | 33 +++++++++++
 .../a/rttests/RoundTripLargeObjectsTest.java       | 18 +++---
 .../org/apache/juneau/a/rttests/RoundTripTest.java | 38 ++++++------
 .../java/org/apache/juneau/html/CommonTest.java    |  6 +-
 .../java/org/apache/juneau/jena/CommonTest.java    |  4 +-
 .../java/org/apache/juneau/json/CommonTest.java    |  6 +-
 .../test/java/org/apache/juneau/json/JsonTest.java |  6 +-
 .../juneau/serializer/ReaderObjectComboTest.java   |  2 +-
 .../serializer/SerializerConfigAnnotationTest.java | 12 ++--
 .../org/apache/juneau/testutils/TestUtils.java     |  4 +-
 .../juneau/transforms/BeanDictionaryComboTest.java |  2 +-
 .../apache/juneau/transforms/BuilderComboTest.java |  2 +-
 .../transforms/ByteArrayBase64SwapComboTest.java   |  2 +-
 .../java/org/apache/juneau/uon/Common_UonTest.java |  4 +-
 .../juneau/urlencoding/Common_UrlEncodingTest.java |  4 +-
 .../java/org/apache/juneau/xml/CommonTest.java     |  4 +-
 .../java/org/apache/juneau/xml/XmlContentTest.java |  8 +--
 .../test/java/org/apache/juneau/xml/XmlTest.java   |  8 +--
 .../apache/juneau/jena/RdfSerializerBuilder.java   | 16 ++++-
 .../apache/juneau/jena/RdfSerializerSession.java   |  4 +-
 .../src/main/java/org/apache/juneau/BeanMap.java   | 12 ++--
 .../apache/juneau/csv/CsvSerializerBuilder.java    | 16 ++++-
 .../juneau/html/HtmlDocSerializerBuilder.java      | 16 ++++-
 .../juneau/html/HtmlSchemaSerializerBuilder.java   | 16 ++++-
 .../apache/juneau/html/HtmlSerializerBuilder.java  | 16 ++++-
 .../apache/juneau/html/HtmlSerializerSession.java  |  2 +-
 .../html/HtmlStrippedDocSerializerBuilder.java     | 16 ++++-
 .../apache/juneau/jso/JsoSerializerBuilder.java    | 16 ++++-
 .../juneau/json/JsonSchemaSerializerBuilder.java   |  2 +-
 .../apache/juneau/json/JsonSerializerBuilder.java  | 16 ++++-
 .../apache/juneau/json/JsonSerializerSession.java  |  2 +-
 .../juneau/json/SimpleJsonSerializerBuilder.java   | 16 ++++-
 .../juneau/msgpack/MsgPackSerializerBuilder.java   | 16 ++++-
 .../juneau/msgpack/MsgPackSerializerSession.java   |  8 +--
 .../juneau/oapi/OpenApiSerializerBuilder.java      | 16 ++++-
 .../juneau/oapi/OpenApiSerializerSession.java      |  2 +-
 .../plaintext/PlainTextSerializerBuilder.java      | 16 ++++-
 .../serializer/OutputStreamSerializerBuilder.java  | 16 ++++-
 .../org/apache/juneau/serializer/Serializer.java   | 69 +++++++++++++++++++---
 .../juneau/serializer/SerializerBuilder.java       | 41 +++++++++++++
 .../juneau/serializer/SerializerGroupBuilder.java  | 37 ++++++++++++
 .../juneau/serializer/SerializerSession.java       | 14 ++---
 .../juneau/serializer/WriterSerializerBuilder.java | 16 ++++-
 .../serializer/annotation/SerializerConfig.java    | 32 ++++++++++
 .../annotation/SerializerConfigApply.java          |  3 +
 .../juneau/soap/SoapXmlSerializerBuilder.java      | 16 ++++-
 .../apache/juneau/uon/UonSerializerBuilder.java    | 16 ++++-
 .../apache/juneau/uon/UonSerializerSession.java    |  2 +-
 .../urlencoding/UrlEncodingSerializerBuilder.java  | 16 ++++-
 .../urlencoding/UrlEncodingSerializerSession.java  |  2 +-
 .../apache/juneau/xml/XmlSerializerBuilder.java    | 16 ++++-
 .../apache/juneau/xml/XmlSerializerSession.java    |  6 +-
 .../examples/core/xml/XmlConfigurationExample.java |  2 +-
 .../org/apache/juneau/examples/rest/TestUtils.java |  4 +-
 .../apache/juneau/rest/client2/RestClientTest.java | 41 +++++++++++--
 .../juneau/rest/client2/RestClientBuilder.java     | 39 ++++++++++++
 .../apache/juneau/rest/mock2/MockRestClient.java   | 16 ++++-
 59 files changed, 649 insertions(+), 150 deletions(-)

diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/BeanMapTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/BeanMapTest.java
index 707dd43..2aa5732 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/BeanMapTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/BeanMapTest.java
@@ -2068,16 +2068,16 @@ public class BeanMapTest {
 		Z z = new Z();
 		BeanMap<Z> bm = BeanContext.DEFAULT.createSession().toBeanMap(z);
 
-		Iterator i = bm.getValues(true).iterator();
+		Iterator i = bm.getValues(false).iterator();
 		assertFalse(i.hasNext());
 
 		z.b = "";
-		i = bm.getValues(true).iterator();
+		i = bm.getValues(false).iterator();
 		assertTrue(i.hasNext());
 		i.next();
 		assertFalse(i.hasNext());
 
-		i = bm.getValues(false).iterator();
+		i = bm.getValues(true).iterator();
 		assertTrue(i.hasNext());
 		i.next();
 		assertTrue(i.hasNext());
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/DynaBeanComboTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/DynaBeanComboTest.java
index 25aff7f..45a7677 100644
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/DynaBeanComboTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/DynaBeanComboTest.java
@@ -251,7 +251,7 @@ public class DynaBeanComboTest extends ComboRoundTripTest {
 
 	@Override
 	protected Serializer applySettings(Serializer s) throws Exception {
-		return s.builder().trimNullProperties(false).build();
+		return s.builder().keepNullProperties().build();
 	}
 
 	@Override
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/SerializerPropertiesComboTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/SerializerPropertiesComboTest.java
index 0fe0272..03467d8 100644
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/SerializerPropertiesComboTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/SerializerPropertiesComboTest.java
@@ -48,6 +48,10 @@ public class SerializerPropertiesComboTest extends ComboRoundTripTest {
 		public OMap f2 = OMap.of();
 	}
 
+	public static class T7 {
+		public String f;
+	}
+
 	@Parameterized.Parameters
 	public static Collection<Object[]> getParameters() {
 		return Arrays.asList(new Object[][] {
@@ -254,6 +258,35 @@ public class SerializerPropertiesComboTest extends ComboRoundTripTest {
 				)
 				.properties(OMap.of(SERIALIZER_trimEmptyMaps, true))
 			},
+			{ 	/* 7 */
+				new ComboInput<>(
+					"SERIALIZER_keepNullProperties",
+					T7.class,
+					new T7(),
+					/* Json */		"{f:null}",
+					/* JsonT */		"{f:null}",
+					/* JsonR */		"{\n\tf: null\n}",
+					/* Xml */		"<object><f _type='null'/></object>",
+					/* XmlT */		"<object><f t='null'/></object>",
+					/* XmlR */		"<object>\n\t<f _type='null'/>\n</object>\n",
+					/* XmlNs */		"<object><f _type='null'/></object>",
+					/* Html */		"<table><tr><td>f</td><td><null/></td></tr></table>",
+					/* HtmlT */		"<table><tr><td>f</td><td><null/></td></tr></table>",
+					/* HtmlR */		"<table>\n\t<tr>\n\t\t<td>f</td>\n\t\t<td><null/></td>\n\t</tr>\n</table>\n",
+					/* Uon */		"(f=null)",
+					/* UonT */		"(f=null)",
+					/* UonR */		"(\n\tf=null\n)",
+					/* UrlEnc */	"f=null",
+					/* UrlEncT */	"f=null",
+					/* UrlEncR */	"f=null",
+					/* MsgPack */	"81A166C0",
+					/* MsgPackT */	"81A166C0",
+					/* RdfXml */	"<rdf:RDF>\n<rdf:Description>\n<jp:f rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlT */	"<rdf:RDF>\n<rdf:Description>\n<jp:f rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n</rdf:Description>\n</rdf:RDF>\n",
+					/* RdfXmlR */	"<rdf:RDF>\n  <rdf:Description>\n    <jp:f rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/>\n  </rdf:Description>\n</rdf:RDF>\n"
+				)
+				.properties(OMap.of(SERIALIZER_keepNullProperties, true))
+			},
 		});
 	}
 
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
index af718ef..cfc5e3a 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
@@ -49,55 +49,55 @@ public class RoundTripLargeObjectsTest extends RoundTripTest {
 			// Full round-trip testing
 			{ /* 0 */
 				"Json DEFAULT",
-				JsonSerializer.create().trimNullProperties(false),
+				JsonSerializer.create().keepNullProperties(),
 				JsonParser.create(),
 				0
 			},
 			{ /* 1 */
 				"SimpleJson DEFAULT",
-				JsonSerializer.create().ssq().trimNullProperties(false),
+				JsonSerializer.create().ssq().keepNullProperties(),
 				JsonParser.create(),
 				0
 			},
 			{ /* 2 */
 				"Json DEFAULT_SQ",
-				JsonSerializer.create().ssq().trimNullProperties(false),
+				JsonSerializer.create().ssq().keepNullProperties(),
 				JsonParser.create(),
 				0
 			},
 			{ /* 3 */
 				"Xml DEFAULT w/namespaces,validation",
-				XmlSerializer.create().sq().ns().trimNullProperties(false).addNamespaceUrisToRoot().useWhitespace(),
+				XmlSerializer.create().sq().ns().keepNullProperties().addNamespaceUrisToRoot().useWhitespace(),
 				XmlParser.create(),
 				CHECK_XML_WHITESPACE | VALIDATE_XML
 			},
 			{ /* 4 */
 				"Xml DEFAULT wo/namespaces,validation",
-				XmlSerializer.create().sq().trimNullProperties(false),
+				XmlSerializer.create().sq().keepNullProperties(),
 				XmlParser.create(),
 				CHECK_XML_WHITESPACE
 			},
 			{ /* 5 */
 				"Html",
-				HtmlSerializer.create().trimNullProperties(false),
+				HtmlSerializer.create().keepNullProperties(),
 				HtmlParser.create(),
 				CHECK_XML_WHITESPACE
 			},
 			{ /* 6 */
 				"UrlEncoding",
-				UrlEncodingSerializer.create().trimNullProperties(false),
+				UrlEncodingSerializer.create().keepNullProperties(),
 				UrlEncodingParser.create(),
 				0
 			},
 			{ /* 7 */
 				"Uon",
-				UonSerializer.create().trimNullProperties(false),
+				UonSerializer.create().keepNullProperties(),
 				UonParser.create(),
 				0
 			},
 			{ /* 8 */
 				"MsgPack",
-				MsgPackSerializer.create().trimNullProperties(false),
+				MsgPackSerializer.create().keepNullProperties(),
 				MsgPackParser.create(),
 				0
 			},
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java
index 0974ec4..1362570 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/a/rttests/RoundTripTest.java
@@ -50,43 +50,43 @@ public abstract class RoundTripTest {
 			// Full round-trip testing
 			{ /* 0 */
 				"Json - default",
-				JsonSerializer.create().trimNullProperties(false).addBeanTypes().addRootType(),
+				JsonSerializer.create().keepNullProperties().addBeanTypes().addRootType(),
 				JsonParser.create(),
 				0
 			},
 			{ /* 1 */
 				"Json - lax",
-				JsonSerializer.create().ssq().trimNullProperties(false).addBeanTypes().addRootType(),
+				JsonSerializer.create().ssq().keepNullProperties().addBeanTypes().addRootType(),
 				JsonParser.create(),
 				0
 			},
 			{ /* 2 */
 				"Json - lax, readable",
-				JsonSerializer.create().ssq().ws().trimNullProperties(false).addBeanTypes().addRootType(),
+				JsonSerializer.create().ssq().ws().keepNullProperties().addBeanTypes().addRootType(),
 				JsonParser.create(),
 				0
 			},
 			{ /* 3 */
 				"Xml - namespaces, validation, readable",
-				XmlSerializer.create().ns().sq().trimNullProperties(false).addNamespaceUrisToRoot().useWhitespace().addBeanTypes().addRootType(),
+				XmlSerializer.create().ns().sq().keepNullProperties().addNamespaceUrisToRoot().useWhitespace().addBeanTypes().addRootType(),
 				XmlParser.create(),
 				CHECK_XML_WHITESPACE | VALIDATE_XML
 			},
 			{ /* 4 */
 				"Xml - no namespaces, validation",
-				XmlSerializer.create().sq().trimNullProperties(false).addBeanTypes().addRootType(),
+				XmlSerializer.create().sq().keepNullProperties().addBeanTypes().addRootType(),
 				XmlParser.create(),
 				CHECK_XML_WHITESPACE
 			},
 			{ /* 5 */
 				"Html - default",
-				HtmlSerializer.create().trimNullProperties(false).addBeanTypes().addRootType(),
+				HtmlSerializer.create().keepNullProperties().addBeanTypes().addRootType(),
 				HtmlParser.create(),
 				CHECK_XML_WHITESPACE
 			},
 			{ /* 6 */
 				"Html - readable",
-				HtmlSerializer.create().sq().ws().trimNullProperties(false).addBeanTypes().addRootType(),
+				HtmlSerializer.create().sq().ws().keepNullProperties().addBeanTypes().addRootType(),
 				HtmlParser.create(),
 				CHECK_XML_WHITESPACE
 			},
@@ -98,31 +98,31 @@ public abstract class RoundTripTest {
 			},
 			{ /* 8 */
 				"Uon - default",
-				UonSerializer.create().trimNullProperties(false).addBeanTypes().addRootType(),
+				UonSerializer.create().keepNullProperties().addBeanTypes().addRootType(),
 				UonParser.create(),
 				0
 			},
 			{ /* 9 */
 				"Uon - readable",
-				UonSerializer.create().ws().trimNullProperties(false).addBeanTypes().addRootType(),
+				UonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType(),
 				UonParser.create(),
 				0
 			},
 			{ /* 10 */
 				"Uon - encoded",
-				UonSerializer.create().encoding().trimNullProperties(false).addBeanTypes().addRootType(),
+				UonSerializer.create().encoding().keepNullProperties().addBeanTypes().addRootType(),
 				UonParser.create().decoding(),
 				0
 			},
 			{ /* 11 */
 				"UrlEncoding - default",
-				UrlEncodingSerializer.create().trimNullProperties(false).addBeanTypes().addRootType(),
+				UrlEncodingSerializer.create().keepNullProperties().addBeanTypes().addRootType(),
 				UrlEncodingParser.create(),
 				0
 			},
 			{ /* 12 */
 				"UrlEncoding - readable",
-				UrlEncodingSerializer.create().ws().trimNullProperties(false).addBeanTypes().addRootType(),
+				UrlEncodingSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType(),
 				UrlEncodingParser.create(),
 				0
 			},
@@ -134,37 +134,37 @@ public abstract class RoundTripTest {
 			},
 			{ /* 14 */
 				"Rdf.Xml",
-				RdfXmlSerializer.create().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
+				RdfXmlSerializer.create().keepNullProperties().addLiteralTypes().addBeanTypes().addRootType(),
 				RdfXmlParser.create(),
 				0
 			},
 			{ /* 15 */
 				"Rdf.XmlAbbrev",
-				RdfXmlAbbrevSerializer.create().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
+				RdfXmlAbbrevSerializer.create().keepNullProperties().addLiteralTypes().addBeanTypes().addRootType(),
 				RdfXmlParser.create(),
 				0
 			},
 			{ /* 16 */
 				"Rdf.Turtle",
-				TurtleSerializer.create().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
+				TurtleSerializer.create().keepNullProperties().addLiteralTypes().addBeanTypes().addRootType(),
 				TurtleParser.create(),
 				0
 			},
 			{ /* 17 */
 				"Rdf.NTriple",
-				NTripleSerializer.create().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
+				NTripleSerializer.create().keepNullProperties().addLiteralTypes().addBeanTypes().addRootType(),
 				NTripleParser.create(),
 				0
 			},
 			{ /* 18 */
 				"Rdf.N3",
-				N3Serializer.create().trimNullProperties(false).addLiteralTypes().addBeanTypes().addRootType(),
+				N3Serializer.create().keepNullProperties().addLiteralTypes().addBeanTypes().addRootType(),
 				N3Parser.create(),
 				0
 			},
 			{ /* 19 */
 				"MsgPack",
-				MsgPackSerializer.create().trimNullProperties(false).addBeanTypes().addRootType(),
+				MsgPackSerializer.create().keepNullProperties().addBeanTypes().addRootType(),
 				MsgPackParser.create(),
 				0
 			},
@@ -172,7 +172,7 @@ public abstract class RoundTripTest {
 			// Validation testing only
 			{ /* 20 */
 				"Json schema",
-				JsonSchemaSerializer.create().trimNullProperties(false).addBeanTypes().addRootType(),
+				JsonSchemaSerializer.create().keepNullProperties().addBeanTypes().addRootType(),
 				null,
 				RETURN_ORIGINAL_OBJECT
 			},
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/html/CommonTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/html/CommonTest.java
index cf3df4c..d72fb00 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/html/CommonTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/html/CommonTest.java
@@ -36,13 +36,13 @@ public class CommonTest {
 		HtmlParser p = HtmlParser.DEFAULT;
 		A t1 = A.create(), t2;
 
-		s.trimNullProperties(false);
+		s.keepNullProperties();
 		String r = s.build().serialize(t1);
 		assertEquals("<table><tr><th>key</th><th>value</th></tr><tr><td>s1</td><td><null/></td></tr><tr><td>s2</td><td>s2</td></tr></table>", r);
 		t2 = p.parse(r, A.class);
 		assertEqualObjects(t1, t2);
 
-		s.trimNullProperties(true);
+		s.keepNullProperties(false);
 		r = s.build().serialize(t1);
 		assertEquals("<table><tr><th>key</th><th>value</th></tr><tr><td>s2</td><td>s2</td></tr></table>", r);
 		t2 = p.parse(r, A.class);
@@ -439,7 +439,7 @@ public class CommonTest {
 	//====================================================================================================
 	@Test
 	public void testBasicBean() throws Exception {
-		WriterSerializer s = HtmlSerializer.create().sq().trimNullProperties(false).sortProperties().addKeyValueTableHeaders().build();
+		WriterSerializer s = HtmlSerializer.create().sq().keepNullProperties().sortProperties().addKeyValueTableHeaders().build();
 
 		J a = new J();
 		a.setF1("J");
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/jena/CommonTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/jena/CommonTest.java
index 799f700..f7a9275 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/jena/CommonTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/jena/CommonTest.java
@@ -50,13 +50,13 @@ public class CommonTest {
 		RdfParser p = RdfXmlParser.DEFAULT;
 		A t1 = A.create(), t2;
 
-		s.trimNullProperties(false);
+		s.keepNullProperties();
 		String r = s.build().serialize(t1);
 		assertEquals("<rdf:Description><jp:s1 rdf:resource='http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'/><jp:s2>s2</jp:s2></rdf:Description>", strip(r));
 		t2 = p.parse(r, A.class);
 		assertEqualObjects(t1, t2);
 
-		s.trimNullProperties(true);
+		s.keepNullProperties(false);
 		r = s.build().serialize(t1);
 		assertEquals("<rdf:Description><jp:s2>s2</jp:s2></rdf:Description>", strip(r));
 		t2 = p.parse(r, A.class);
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/json/CommonTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/json/CommonTest.java
index f931230..7579b26 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/json/CommonTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/json/CommonTest.java
@@ -35,13 +35,13 @@ public class CommonTest {
 		JsonParser p = JsonParser.DEFAULT;
 		A t1 = A.create(), t2;
 
-		s.trimNullProperties(false);
+		s.keepNullProperties();
 		String r = s.build().serialize(t1);
 		assertEquals("{s1:null,s2:'s2'}", r);
 		t2 = p.parse(r, A.class);
 		assertEqualObjects(t1, t2);
 
-		s.trimNullProperties(true);
+		s.keepNullProperties(false);
 		r = s.build().serialize(t1);
 		assertEquals("{s2:'s2'}", r);
 		t2 = p.parse(r, A.class);
@@ -316,7 +316,7 @@ public class CommonTest {
 	//====================================================================================================
 	@Test
 	public void testBasicBean() throws Exception {
-		JsonSerializer s = JsonSerializer.create().ssq().trimNullProperties(false).sortProperties().build();
+		JsonSerializer s = JsonSerializer.create().ssq().keepNullProperties().sortProperties().build();
 
 		J a = new J();
 		a.setF1("J");
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/json/JsonTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/json/JsonTest.java
index 8da607a..3385b1b 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/json/JsonTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/json/JsonTest.java
@@ -33,8 +33,8 @@ public class JsonTest {
 		Map<String,Object> m = new LinkedHashMap<>();
 		List<Object> l = new LinkedList<>();
 
-		WriterSerializer s1 = JsonSerializer.create().ssq().trimNullProperties(false).build();
-		WriterSerializer s2 = JsonSerializer.create().simple().trimNullProperties(false).build();
+		WriterSerializer s1 = JsonSerializer.create().ssq().keepNullProperties().build();
+		WriterSerializer s2 = JsonSerializer.create().simple().keepNullProperties().build();
 		String r;
 
 		// Null keys and values
@@ -109,7 +109,7 @@ public class JsonTest {
 	//====================================================================================================
 	@Test
 	public void testBackslashesInStrings() throws Exception {
-		JsonSerializer s = JsonSerializer.create().simple().trimNullProperties(false).build();
+		JsonSerializer s = JsonSerializer.create().simple().keepNullProperties().build();
 		String r, r2;
 
 		// [\\]
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/serializer/ReaderObjectComboTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/serializer/ReaderObjectComboTest.java
index 8ad4677..f58dd38 100644
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/serializer/ReaderObjectComboTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/serializer/ReaderObjectComboTest.java
@@ -338,7 +338,7 @@ public class ReaderObjectComboTest extends ComboSerializeTest {
 
 	@Override
 	protected Serializer applySettings(Serializer s) throws Exception {
-		return s.builder().trimNullProperties(false).build();
+		return s.builder().keepNullProperties().build();
 	}
 
 	public static class BeanWithReaderField {
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/serializer/SerializerConfigAnnotationTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/serializer/SerializerConfigAnnotationTest.java
index bb824f4..7b89bba 100644
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/serializer/SerializerConfigAnnotationTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/serializer/SerializerConfigAnnotationTest.java
@@ -86,7 +86,7 @@ public class SerializerConfigAnnotationTest {
 		check("true", x.isSortMaps());
 		check("true", x.isTrimEmptyCollections());
 		check("true", x.isTrimEmptyMaps());
-		check("true", x.isTrimNullProperties());
+		check("false", x.isKeepNullProperties());
 		check("true", x.isTrimStrings());
 		check("{absoluteAuthority:'/',absoluteContextRoot:'/',absolutePathInfo:'/',absolutePathInfoParent:'/',absoluteServletPath:'/',absoluteServletPathParent:'/',rootRelativeContextRoot:'/',rootRelativePathInfo:'/',rootRelativePathInfoParent:'/',rootRelativeServletPath:'/',rootRelativeServletPathParent:'/'}", x.getUriContext());
 		check("RESOURCE", x.getUriRelativity());
@@ -106,7 +106,7 @@ public class SerializerConfigAnnotationTest {
 		check("true", x.isSortMaps());
 		check("true", x.isTrimEmptyCollections());
 		check("true", x.isTrimEmptyMaps());
-		check("true", x.isTrimNullProperties());
+		check("false", x.isKeepNullProperties());
 		check("true", x.isTrimStrings());
 		check("{absoluteAuthority:'/',absoluteContextRoot:'/',absolutePathInfo:'/',absolutePathInfoParent:'/',absoluteServletPath:'/',absoluteServletPathParent:'/',rootRelativeContextRoot:'/',rootRelativePathInfo:'/',rootRelativePathInfoParent:'/',rootRelativeServletPath:'/',rootRelativeServletPathParent:'/'}", x.getUriContext());
 		check("RESOURCE", x.getUriRelativity());
@@ -134,7 +134,7 @@ public class SerializerConfigAnnotationTest {
 		check("false", x.isSortMaps());
 		check("false", x.isTrimEmptyCollections());
 		check("false", x.isTrimEmptyMaps());
-		check("true", x.isTrimNullProperties());
+		check("false", x.isKeepNullProperties());
 		check("false", x.isTrimStrings());
 		check("{absoluteAuthority:'/',absoluteContextRoot:'/',absolutePathInfo:'/',absolutePathInfoParent:'/',absoluteServletPath:'/',absoluteServletPathParent:'/',rootRelativeContextRoot:'/',rootRelativePathInfo:'/',rootRelativePathInfoParent:'/',rootRelativeServletPath:'/',rootRelativeServletPathParent:'/'}", x.getUriContext());
 		check("RESOURCE", x.getUriRelativity());
@@ -154,7 +154,7 @@ public class SerializerConfigAnnotationTest {
 		check("false", x.isSortMaps());
 		check("false", x.isTrimEmptyCollections());
 		check("false", x.isTrimEmptyMaps());
-		check("true", x.isTrimNullProperties());
+		check("false", x.isKeepNullProperties());
 		check("false", x.isTrimStrings());
 		check("{absoluteAuthority:'/',absoluteContextRoot:'/',absolutePathInfo:'/',absolutePathInfoParent:'/',absoluteServletPath:'/',absoluteServletPathParent:'/',rootRelativeContextRoot:'/',rootRelativePathInfo:'/',rootRelativePathInfoParent:'/',rootRelativeServletPath:'/',rootRelativeServletPathParent:'/'}", x.getUriContext());
 		check("RESOURCE", x.getUriRelativity());
@@ -181,7 +181,7 @@ public class SerializerConfigAnnotationTest {
 		check("false", x.isSortMaps());
 		check("false", x.isTrimEmptyCollections());
 		check("false", x.isTrimEmptyMaps());
-		check("true", x.isTrimNullProperties());
+		check("false", x.isKeepNullProperties());
 		check("false", x.isTrimStrings());
 		check("{absoluteAuthority:'/',absoluteContextRoot:'/',absolutePathInfo:'/',absolutePathInfoParent:'/',absoluteServletPath:'/',absoluteServletPathParent:'/',rootRelativeContextRoot:'/',rootRelativePathInfo:'/',rootRelativePathInfoParent:'/',rootRelativeServletPath:'/',rootRelativeServletPathParent:'/'}", x.getUriContext());
 		check("RESOURCE", x.getUriRelativity());
@@ -201,7 +201,7 @@ public class SerializerConfigAnnotationTest {
 		check("false", x.isSortMaps());
 		check("false", x.isTrimEmptyCollections());
 		check("false", x.isTrimEmptyMaps());
-		check("true", x.isTrimNullProperties());
+		check("false", x.isKeepNullProperties());
 		check("false", x.isTrimStrings());
 		check("{absoluteAuthority:'/',absoluteContextRoot:'/',absolutePathInfo:'/',absolutePathInfoParent:'/',absoluteServletPath:'/',absoluteServletPathParent:'/',rootRelativeContextRoot:'/',rootRelativePathInfo:'/',rootRelativePathInfoParent:'/',rootRelativeServletPath:'/',rootRelativeServletPathParent:'/'}", x.getUriContext());
 		check("RESOURCE", x.getUriRelativity());
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/testutils/TestUtils.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/testutils/TestUtils.java
index 76f1487..a2fd5a2 100644
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/testutils/TestUtils.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/testutils/TestUtils.java
@@ -37,7 +37,7 @@ public class TestUtils {
 
 	private static JsonSerializer js = JsonSerializer.create()
 		.ssq()
-		.trimNullProperties(false)
+		.keepNullProperties()
 		.addBeanTypes().addRootType()
 		.build();
 
@@ -45,7 +45,7 @@ public class TestUtils {
 		.ssq()
 		.sortCollections()
 		.sortMaps()
-		.trimNullProperties(false)
+		.keepNullProperties()
 		.addBeanTypes().addRootType()
 		.build();
 
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/transforms/BeanDictionaryComboTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/transforms/BeanDictionaryComboTest.java
index aacf72a..34a9a06 100644
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/transforms/BeanDictionaryComboTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/transforms/BeanDictionaryComboTest.java
@@ -856,7 +856,7 @@ public class BeanDictionaryComboTest extends ComboRoundTripTest {
 
 	@Override
 	protected Serializer applySettings(Serializer s) throws Exception {
-		return s.builder().trimNullProperties(false).build();
+		return s.builder().keepNullProperties().build();
 	}
 
 	@Override
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/transforms/BuilderComboTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/transforms/BuilderComboTest.java
index 9e3b905..4963da7 100644
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/transforms/BuilderComboTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/transforms/BuilderComboTest.java
@@ -250,7 +250,7 @@ public class BuilderComboTest extends ComboRoundTripTest {
 
 	@Override
 	protected Serializer applySettings(Serializer s) throws Exception {
-		return s.builder().trimNullProperties(false).build();
+		return s.builder().keepNullProperties().build();
 	}
 
 	@Override
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/transforms/ByteArrayBase64SwapComboTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/transforms/ByteArrayBase64SwapComboTest.java
index 2d49601..2bd6de9 100644
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/transforms/ByteArrayBase64SwapComboTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/transforms/ByteArrayBase64SwapComboTest.java
@@ -417,7 +417,7 @@ public class ByteArrayBase64SwapComboTest extends ComboRoundTripTest {
 
 	@Override
 	protected Serializer applySettings(Serializer s) throws Exception {
-		return s.builder().pojoSwaps(ByteArraySwap.Base64.class).trimNullProperties(false).build();
+		return s.builder().pojoSwaps(ByteArraySwap.Base64.class).keepNullProperties().build();
 	}
 
 	@Override
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/uon/Common_UonTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/uon/Common_UonTest.java
index 227bff5..063f76e 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/uon/Common_UonTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/uon/Common_UonTest.java
@@ -36,13 +36,13 @@ public class Common_UonTest {
 		UonSerializerBuilder s = UonSerializer.create().encoding();
 		A t1 = A.create(), t2;
 
-		s.trimNullProperties(false);
+		s.keepNullProperties();
 		String r = s.build().serialize(t1);
 		assertEquals("(s1=null,s2=s2)", r);
 		t2 = pe.parse(r, A.class);
 		assertEqualObjects(t1, t2);
 
-		s.trimNullProperties(true);
+		s.keepNullProperties(false);
 		r = s.build().serialize(t1);
 		assertEquals("(s2=s2)", r);
 		t2 = p.parse(r, A.class);
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/urlencoding/Common_UrlEncodingTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/urlencoding/Common_UrlEncodingTest.java
index f67f025..b4aef7c 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/urlencoding/Common_UrlEncodingTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/urlencoding/Common_UrlEncodingTest.java
@@ -35,13 +35,13 @@ public class Common_UrlEncodingTest {
 		UrlEncodingSerializerBuilder s = UrlEncodingSerializer.create();
 		A t1 = A.create(), t2;
 
-		s.trimNullProperties(false);
+		s.keepNullProperties();
 		String r = s.build().serialize(t1);
 		assertEquals("s1=null&s2=s2", r);
 		t2 = p.parse(r, A.class);
 		assertEqualObjects(t1, t2);
 
-		s.trimNullProperties(true);
+		s.keepNullProperties(false);
 		r = s.build().serialize(t1);
 		assertEquals("s2=s2", r);
 		t2 = p.parse(r, A.class);
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/xml/CommonTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/xml/CommonTest.java
index 007b804..2cdca2a 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/xml/CommonTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/xml/CommonTest.java
@@ -39,13 +39,13 @@ public class CommonTest {
 		XmlParser p = XmlParser.DEFAULT;
 		A t1 = A.create(), t2;
 
-		s.trimNullProperties(false);
+		s.keepNullProperties();
 		String r = s.build().serialize(t1);
 		assertEquals("<object><s1 _type='null'/><s2>s2</s2></object>", r);
 		t2 = p.parse(r, A.class);
 		assertEqualObjects(t1, t2);
 
-		s.trimNullProperties(true);
+		s.keepNullProperties(false);
 		r = s.build().serialize(t1);
 		assertEquals("<object><s2>s2</s2></object>", r);
 		t2 = p.parse(r, A.class);
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/xml/XmlContentTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/xml/XmlContentTest.java
index 9b5dcbf..0aac523 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/xml/XmlContentTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/xml/XmlContentTest.java
@@ -31,8 +31,8 @@ public class XmlContentTest {
 	@Test
 	public void testContentFormat() throws Exception {
 		A t = A.newInstance(), t2;
-		XmlSerializer s1 = XmlSerializer.DEFAULT_SQ.builder().trimNullProperties(false).build(),
-			s2 = XmlSerializer.create().sq().ws().enableNamespaces(false).trimNullProperties(false).build();
+		XmlSerializer s1 = XmlSerializer.DEFAULT_SQ.builder().keepNullProperties().build(),
+			s2 = XmlSerializer.create().sq().ws().enableNamespaces(false).keepNullProperties().build();
 		XmlParser p = XmlParser.DEFAULT;
 		WriterSerializerSession session;
 		String r;
@@ -139,8 +139,8 @@ public class XmlContentTest {
 	@Test
 	public void testXmlMixed() throws Exception {
 		B t = B.newInstance(), t2;
-		XmlSerializer s1 = XmlSerializer.DEFAULT_SQ.builder().trimNullProperties(false).build(),
-			s2 = XmlSerializer.create().sq().ws().enableNamespaces(false).trimNullProperties(false).build();
+		XmlSerializer s1 = XmlSerializer.DEFAULT_SQ.builder().keepNullProperties().build(),
+			s2 = XmlSerializer.create().sq().ws().enableNamespaces(false).keepNullProperties().build();
 		XmlParser p = XmlParser.DEFAULT;
 		WriterSerializerSession session;
 		String r;
diff --git a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/xml/XmlTest.java b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/xml/XmlTest.java
index 2f177be..f3ff02c 100755
--- a/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/xml/XmlTest.java
+++ b/juneau-core/juneau-core-utest/src/test/java/org/apache/juneau/xml/XmlTest.java
@@ -77,12 +77,12 @@ public class XmlTest {
 			+"</object>\n";
 
 		OMap m = (OMap) XmlParser.DEFAULT.parse(xml1, Object.class);
-		String json2 = JsonSerializer.create().simple().ws().trimNullProperties(false).build().serialize(m);
+		String json2 = JsonSerializer.create().simple().ws().keepNullProperties().build().serialize(m);
 		assertEquals(json1, json2);
 
 		m = (OMap) JsonParser.DEFAULT.parse(json1, Object.class);
 		String xml2 = XmlSerializer.create().sq().ws()
-			.trimNullProperties(false)
+			.keepNullProperties()
 			.build()
 			.serialize(m);
 		assertEquals(xml1, xml2);
@@ -136,7 +136,7 @@ public class XmlTest {
 		String r = XmlSerializer.create().ns().sq().ws()
 			.addNamespaceUrisToRoot()
 			.defaultNamespace("http://www.apache.org")
-			.trimNullProperties(false)
+			.keepNullProperties()
 			.build()
 			.serialize(m);
 		assertEquals(xml1, r);
@@ -358,7 +358,7 @@ public class XmlTest {
 		String r = null;
 		r = s.build().serialize(t);
 		assertEquals("<object f1='1' f2='2' f3='3'/>", r);
-		s.enableNamespaces(true).addNamespaceUrisToRoot().autoDetectNamespaces(true).trimNullProperties(false);
+		s.enableNamespaces(true).addNamespaceUrisToRoot().autoDetectNamespaces(true).keepNullProperties();
 		t.f1 = 4; t.f2 = 5; t.f3 = 6;
 		r = s.build().serialize(t);
 		assertEquals("<object xmlns='http://www.apache.org/2013/Juneau' xmlns:bar='http://bar' xmlns:foo='http://foo' xmlns:baz='http://baz' bar:f1='4' foo:f2='5' baz:f3='6'/>", r);
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerBuilder.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerBuilder.java
index fcedc7a..ec9040a 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerBuilder.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerBuilder.java
@@ -1690,13 +1690,25 @@ public class RdfSerializerBuilder extends WriterSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public RdfSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public RdfSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public RdfSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public RdfSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -1750,7 +1762,7 @@ public class RdfSerializerBuilder extends WriterSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public RdfSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerSession.java b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerSession.java
index ca86dd0..9f1a715 100644
--- a/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerSession.java
+++ b/juneau-core/juneau-marshall-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerSession.java
@@ -196,7 +196,7 @@ public final class RdfSerializerSession extends WriterSerializerSession {
 
 		if (o == null || sType.isChar() && ((Character)o).charValue() == 0) {
 			if (bpm != null) {
-				if (! isTrimNullProperties()) {
+				if (isKeepNullProperties()) {
 					n = m.createResource(RDF_NIL);
 				}
 			} else {
@@ -310,7 +310,7 @@ public final class RdfSerializerSession extends WriterSerializerSession {
 	}
 
 	private void serializeBeanMap(BeanMap<?> m, Resource r, String typeName) throws IOException, SerializeException {
-		List<BeanPropertyValue> l = m.getValues(isTrimNullProperties(), typeName != null ? createBeanTypeNameProperty(m, typeName) : null);
+		List<BeanPropertyValue> l = m.getValues(isKeepNullProperties(), typeName != null ? createBeanTypeNameProperty(m, typeName) : null);
 		Collections.reverse(l);
 		for (BeanPropertyValue bpv : l) {
 
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
index 04e02ec..d623756 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanMap.java
@@ -464,16 +464,16 @@ public class BeanMap<T> extends AbstractMap<String,Object> implements Delegate<T
 	 * <p>
 	 * This allows a snapshot of all values to be grabbed from a bean in one call.
 	 *
-	 * @param ignoreNulls
-	 * 	Don't return properties whose values are null.
+	 * @param keepNulls
+	 * 	Also return properties whose values are null.
 	 * @param prependVals
 	 * 	Additional bean property values to prepended to this list.
 	 * 	Any <jk>null</jk> values in this list will be ignored.
 	 * @return The list of all bean property values.
 	 */
-	public List<BeanPropertyValue> getValues(final boolean ignoreNulls, BeanPropertyValue...prependVals) {
+	public List<BeanPropertyValue> getValues(boolean keepNulls, BeanPropertyValue...prependVals) {
 		Collection<BeanPropertyMeta> properties = getProperties();
-		int capacity = (ignoreNulls && properties.size() > 10) ? 10 : properties.size() + prependVals.length;
+		int capacity = ((! keepNulls) && properties.size() > 10) ? 10 : properties.size() + prependVals.length;
 		List<BeanPropertyValue> l = new ArrayList<>(capacity);
 		for (BeanPropertyValue v : prependVals)
 			if (v != null)
@@ -486,13 +486,13 @@ public class BeanMap<T> extends AbstractMap<String,Object> implements Delegate<T
 						if (dynaMap != null) {
 							for (String pName : bpm.getDynaMap(bean).keySet()) {
 								Object val = bpm.get(this, pName);
-								if (val != null || ! ignoreNulls)
+								if (val != null || keepNulls)
 									l.add(new BeanPropertyValue(bpm, pName, val, null));
 							}
 						}
 					} else {
 						Object val = bpm.get(this, null);
-						if (val != null || ! ignoreNulls)
+						if (val != null || keepNulls)
 							l.add(new BeanPropertyValue(bpm, bpm.getName(), val, null));
 					}
 				} catch (Error e) {
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java
index da5c437..edaa35e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/csv/CsvSerializerBuilder.java
@@ -811,13 +811,25 @@ public class CsvSerializerBuilder extends WriterSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public CsvSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public CsvSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public CsvSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public CsvSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -871,7 +883,7 @@ public class CsvSerializerBuilder extends WriterSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public CsvSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerBuilder.java
index 90d7708..87ae567 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlDocSerializerBuilder.java
@@ -1337,13 +1337,25 @@ public class HtmlDocSerializerBuilder extends HtmlStrippedDocSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public HtmlDocSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public HtmlDocSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public HtmlDocSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public HtmlDocSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -1397,7 +1409,7 @@ public class HtmlDocSerializerBuilder extends HtmlStrippedDocSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public HtmlDocSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializerBuilder.java
index 487fb6f..bc3ea60 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSchemaSerializerBuilder.java
@@ -1052,13 +1052,25 @@ public class HtmlSchemaSerializerBuilder extends HtmlSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public HtmlSchemaSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public HtmlSchemaSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public HtmlSchemaSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public HtmlSchemaSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -1112,7 +1124,7 @@ public class HtmlSchemaSerializerBuilder extends HtmlSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public HtmlSchemaSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerBuilder.java
index 4338bb7..20b2d8b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerBuilder.java
@@ -985,13 +985,25 @@ public class HtmlSerializerBuilder extends XmlSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public HtmlSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public HtmlSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public HtmlSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public HtmlSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -1045,7 +1057,7 @@ public class HtmlSerializerBuilder extends XmlSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public HtmlSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java
index 84d8b27..e617660 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java
@@ -476,7 +476,7 @@ public class HtmlSerializerSession extends XmlSerializerSession {
 			out.ie(i+1).eTag("tr").nl(i+1);
 		}
 
-		for (BeanPropertyValue p : m.getValues(isTrimNullProperties())) {
+		for (BeanPropertyValue p : m.getValues(isKeepNullProperties())) {
 			BeanPropertyMeta pMeta = p.getMeta();
 			ClassMeta<?> cMeta = p.getClassMeta();
 
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializerBuilder.java
index 0e3d93b..a58259a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlStrippedDocSerializerBuilder.java
@@ -811,13 +811,25 @@ public class HtmlStrippedDocSerializerBuilder extends HtmlSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public HtmlStrippedDocSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public HtmlStrippedDocSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public HtmlStrippedDocSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public HtmlStrippedDocSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -871,7 +883,7 @@ public class HtmlStrippedDocSerializerBuilder extends HtmlSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public HtmlStrippedDocSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializerBuilder.java
index 127e699..ef90fc2 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jso/JsoSerializerBuilder.java
@@ -810,13 +810,25 @@ public class JsoSerializerBuilder extends OutputStreamSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public JsoSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public JsoSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public JsoSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public JsoSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -870,7 +882,7 @@ public class JsoSerializerBuilder extends OutputStreamSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public JsoSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializerBuilder.java
index 6366b3c..e728f99 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSchemaSerializerBuilder.java
@@ -473,7 +473,7 @@ public class JsonSchemaSerializerBuilder extends JsonSerializerBuilder {
 		return this;
 	}
 
-	@Override /* SerializerBuilder */
+	@Deprecated @Override /* SerializerBuilder */
 	public JsonSchemaSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerBuilder.java
index c84fb11..e25b230 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerBuilder.java
@@ -907,13 +907,25 @@ public class JsonSerializerBuilder extends WriterSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public JsonSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public JsonSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public JsonSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public JsonSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -967,7 +979,7 @@ public class JsonSerializerBuilder extends WriterSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public JsonSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerSession.java
index 3327eb4..8e9acf1 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/JsonSerializerSession.java
@@ -204,7 +204,7 @@ public class JsonSerializerSession extends WriterSerializerSession {
 		out.append('{');
 
 		boolean addComma = false;
-		for (BeanPropertyValue p : m.getValues(isTrimNullProperties(), typeName != null ? createBeanTypeNameProperty(m, typeName) : null)) {
+		for (BeanPropertyValue p : m.getValues(isKeepNullProperties(), typeName != null ? createBeanTypeNameProperty(m, typeName) : null)) {
 			BeanPropertyMeta pMeta = p.getMeta();
 			if (pMeta.canRead()) {
 				ClassMeta<?> cMeta = p.getClassMeta();
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/SimpleJsonSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/SimpleJsonSerializerBuilder.java
index 4f39417..e563835 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/SimpleJsonSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/json/SimpleJsonSerializerBuilder.java
@@ -810,13 +810,25 @@ public class SimpleJsonSerializerBuilder extends JsonSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public SimpleJsonSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public SimpleJsonSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public SimpleJsonSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public SimpleJsonSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -870,7 +882,7 @@ public class SimpleJsonSerializerBuilder extends JsonSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public SimpleJsonSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerBuilder.java
index 17a79ec..14548bb 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerBuilder.java
@@ -810,13 +810,25 @@ public class MsgPackSerializerBuilder extends OutputStreamSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public MsgPackSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public MsgPackSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public MsgPackSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public MsgPackSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -870,7 +882,7 @@ public class MsgPackSerializerBuilder extends OutputStreamSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public MsgPackSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerSession.java
index a6e38f0..898c0f2 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/msgpack/MsgPackSerializerSession.java
@@ -171,14 +171,14 @@ public final class MsgPackSerializerSession extends OutputStreamSerializerSessio
 
 	private void serializeBeanMap(MsgPackOutputStream out, final BeanMap<?> m, String typeName) throws IOException, SerializeException {
 
-		List<BeanPropertyValue> values = m.getValues(isTrimNullProperties(), typeName != null ? createBeanTypeNameProperty(m, typeName) : null);
+		List<BeanPropertyValue> values = m.getValues(isKeepNullProperties(), typeName != null ? createBeanTypeNameProperty(m, typeName) : null);
 
 		int size = values.size();
 		for (BeanPropertyValue p : values) {
 			if (p.getThrown() != null)
 				size--;
 			// Must handle the case where recursion occurs and property is not serialized.
-			if (isTrimNullProperties() && willRecurse(p))
+			if ((! isKeepNullProperties()) && willRecurse(p))
 				size--;
 		}
 
@@ -193,7 +193,7 @@ public final class MsgPackSerializerSession extends OutputStreamSerializerSessio
 				Throwable t = p.getThrown();
 				if (t != null) {
 					onBeanGetterException(pMeta, t);
-				} else if (isTrimNullProperties() && willRecurse(p)) {
+				} else if ((! isKeepNullProperties()) && willRecurse(p)) {
 					/* Ignored */
 				} else {
 					serializeAnything(out, key, null, null, null);
@@ -202,7 +202,7 @@ public final class MsgPackSerializerSession extends OutputStreamSerializerSessio
 			}
 		}
 	}
-	
+
 	private boolean willRecurse(BeanPropertyValue v) throws SerializeException {
 		ClassMeta<?> aType = push2(v.getName(), v.getValue(), v.getClassMeta());
 		 if (aType != null)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerBuilder.java
index fab35d1..2da8131 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerBuilder.java
@@ -811,13 +811,25 @@ public class OpenApiSerializerBuilder extends UonSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public OpenApiSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public OpenApiSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public OpenApiSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public OpenApiSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -871,7 +883,7 @@ public class OpenApiSerializerBuilder extends UonSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public OpenApiSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerSession.java
index 0115419..8d7453d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/oapi/OpenApiSerializerSession.java
@@ -221,7 +221,7 @@ public class OpenApiSerializerSession extends UonSerializerSession {
 			s = DEFAULT_SCHEMA;
 		OMap m = new OMap();
 		if (type.isBean()) {
-			for (BeanPropertyValue p : toBeanMap(o).getValues(isTrimNullProperties())) {
+			for (BeanPropertyValue p : toBeanMap(o).getValues(isKeepNullProperties())) {
 				if (p.getMeta().canRead()) {
 					Throwable t = p.getThrown();
 					if (t == null)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializerBuilder.java
index e360e5f..132682e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/plaintext/PlainTextSerializerBuilder.java
@@ -811,13 +811,25 @@ public class PlainTextSerializerBuilder extends WriterSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public PlainTextSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public PlainTextSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public PlainTextSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public PlainTextSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -871,7 +883,7 @@ public class PlainTextSerializerBuilder extends WriterSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public PlainTextSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializerBuilder.java
index 7783027..5926481 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/OutputStreamSerializerBuilder.java
@@ -849,13 +849,25 @@ public class OutputStreamSerializerBuilder extends SerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public OutputStreamSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public OutputStreamSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public OutputStreamSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public OutputStreamSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -909,7 +921,7 @@ public class OutputStreamSerializerBuilder extends SerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public OutputStreamSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
index 10e866d..a00159d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/Serializer.java
@@ -247,6 +247,57 @@ public abstract class Serializer extends BeanTraverseContext {
 	public static final String SERIALIZER_listener = PREFIX + ".listener.c";
 
 	/**
+	 * Configuration property:  Don't trim null bean property values.
+	 *
+	 * <h5 class='section'>Property:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li><b>ID:</b>  {@link org.apache.juneau.serializer.Serializer#SERIALIZER_keepNullProperties SERIALIZER_keepNullProperties}
+	 * 	<li><b>Name:</b>  <js>"Serializer.keepNullProperties.b"</js>
+	 * 	<li><b>Data type:</b>  <jk>boolean</jk>
+	 * 	<li><b>System property:</b>  <c>Serializer.keepNullProperties</c>
+	 * 	<li><b>Environment variable:</b>  <c>SERIALIZER_KEEPNULLPROPERTIES</c>
+	 * 	<li><b>Default:</b>  <jk>false</jk>
+	 * 	<li><b>Session property:</b>  <jk>false</jk>
+	 * 	<li><b>Annotations:</b>
+	 * 		<ul>
+	 * 			<li class='ja'>{@link org.apache.juneau.serializer.annotation.SerializerConfig#keepNullProperties()}
+	 * 		</ul>
+	 * 	<li><b>Methods:</b>
+	 * 		<ul>
+	 * 			<li class='jm'>{@link org.apache.juneau.serializer.SerializerBuilder#keepNullProperties()}
+	 * 			<li class='jm'>{@link org.apache.juneau.serializer.SerializerBuilder#keepNullProperties(boolean)}
+	 * 		</ul>
+	 * </ul>
+	 *
+	 * <h5 class='section'>Description:</h5>
+	 * <p>
+	 * If <jk>true</jk>, null bean values will be serialized to the output.
+	 *
+	 * <p>
+	 * Note that not enabling this setting has the following effects on parsing:
+	 * <ul class='spaced-list'>
+	 * 	<li>
+	 * 		Map entries with <jk>null</jk> values will be lost.
+	 * </ul>
+	 *
+	 * <h5 class='section'>Example:</h5>
+	 * <p class='bcode w800'>
+	 * 	<jc>// Create a serializer that serializes null properties.</jc>
+	 * 	WriterSerializer s = JsonSerializer
+	 * 		.<jsm>create</jsm>()
+	 * 		.keepNullProperties(<jk>true</jk>)
+	 * 		.build();
+	 *
+	 * 	<jc>// Same, but use property.</jc>
+	 * 	WriterSerializer s = JsonSerializer
+	 * 		.<jsm>create</jsm>()
+	 * 		.set(<jsf>SERIALIZER_keepNullProperties</jsf>, <jk>true</jk>)
+	 * 		.build();
+	 * </p>
+	 */
+	public static final String SERIALIZER_keepNullProperties = PREFIX + ".keepNullProperties.b";
+
+	/**
 	 * Configuration property:  Sort arrays and collections alphabetically.
 	 *
 	 * <h5 class='section'>Property:</h5>
@@ -495,7 +546,9 @@ public abstract class Serializer extends BeanTraverseContext {
 	 * 		.set(<jsf>SERIALIZER_trimNullProperties</jsf>, <jk>false</jk>)
 	 * 		.build();
 	 * </p>
+	 * @deprecated Use {@link #SERIALIZER_keepNullProperties}
 	 */
+	@Deprecated
 	public static final String SERIALIZER_trimNullProperties = PREFIX + ".trimNullProperties.b";
 
 	/**
@@ -744,7 +797,7 @@ public abstract class Serializer extends BeanTraverseContext {
 
 	private final boolean
 		addBeanTypes,
-		trimNullProperties,
+		keepNullProperties,
 		trimEmptyCollections,
 		trimEmptyMaps,
 		trimStrings,
@@ -790,7 +843,7 @@ public abstract class Serializer extends BeanTraverseContext {
 		super(ps);
 
 		addBeanTypes = getBooleanProperty(SERIALIZER_addBeanTypes, false);
-		trimNullProperties = getBooleanProperty(SERIALIZER_trimNullProperties, true);
+		keepNullProperties = getBooleanProperty(SERIALIZER_keepNullProperties, ! getBooleanProperty(SERIALIZER_trimNullProperties, true));
 		trimEmptyCollections = getBooleanProperty(SERIALIZER_trimEmptyCollections, false);
 		trimEmptyMaps = getBooleanProperty(SERIALIZER_trimEmptyMaps, false);
 		trimStrings = getBooleanProperty(SERIALIZER_trimStrings, false);
@@ -1055,14 +1108,14 @@ public abstract class Serializer extends BeanTraverseContext {
 	}
 
 	/**
-	 * Configuration property:  Trim null bean property values.
+	 * Configuration property:  Don't trim null bean property values.
 	 *
-	 * @see #SERIALIZER_trimNullProperties
+	 * @see #SERIALIZER_keepNullProperties
 	 * @return
-	 * 	<jk>true</jk> if null bean values are not serialized to the output.
+	 * 	<jk>true</jk> if null bean values are serialized to the output.
 	 */
-	protected final boolean isTrimNullProperties() {
-		return trimNullProperties;
+	protected final boolean isKeepNullProperties() {
+		return keepNullProperties;
 	}
 
 	/**
@@ -1118,7 +1171,7 @@ public abstract class Serializer extends BeanTraverseContext {
 		return super.toMap()
 			.a("Serializer", new DefaultFilteringOMap()
 				.a("addBeanTypes", addBeanTypes)
-				.a("trimNullProperties", trimNullProperties)
+				.a("keepNullProperties", keepNullProperties)
 				.a("trimEmptyCollections", trimEmptyCollections)
 				.a("trimEmptyMaps", trimEmptyMaps)
 				.a("trimStrings", trimStrings)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
index 9f0b9db..76e6557 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerBuilder.java
@@ -126,6 +126,43 @@ public class SerializerBuilder extends BeanTraverseBuilder {
 	}
 
 	/**
+	 * Configuration property:  Don't trim null bean property values.
+	 *
+	 * <p>
+	 * If <jk>true</jk>, null bean values will be serialized to the output.
+	 *
+	 * <ul class='seealso'>
+	 * 	<li class='jf'>{@link Serializer#SERIALIZER_keepNullProperties}
+	 * </ul>
+	 *
+	 * @param value
+	 * 	The new value for this property.
+	 * 	<br>The default is <jk>false</jk>.
+	 * @return This object (for method chaining).
+	 */
+	@ConfigurationProperty
+	public SerializerBuilder keepNullProperties(boolean value) {
+		return set(SERIALIZER_keepNullProperties, value);
+	}
+
+	/**
+	 * Configuration property:  Don't trim null bean property values.
+	 *
+	 * <p>
+	 * When enabled, null bean values will be serialized to the output.
+	 *
+	 * <ul class='seealso'>
+	 * 	<li class='jf'>{@link Serializer#SERIALIZER_keepNullProperties}
+	 * </ul>
+	 *
+	 * @return This object (for method chaining).
+	 */
+	@ConfigurationProperty
+	public SerializerBuilder keepNullProperties() {
+		return set(SERIALIZER_keepNullProperties, true);
+	}
+
+	/**
 	 * Configuration property:  Serializer listener.
 	 *
 	 * <p>
@@ -306,7 +343,9 @@ public class SerializerBuilder extends BeanTraverseBuilder {
 	 * 	The new value for this property.
 	 * 	<br>The default is <jk>true</jk>.
 	 * @return This object (for method chaining).
+	 * @deprecated Use {@link #keepNullProperties(boolean)}
 	 */
+	@Deprecated
 	@ConfigurationProperty
 	public SerializerBuilder trimNullProperties(boolean value) {
 		return set(SERIALIZER_trimNullProperties, value);
@@ -323,7 +362,9 @@ public class SerializerBuilder extends BeanTraverseBuilder {
 	 * </ul>
 	 *
 	 * @return This object (for method chaining).
+	 * @deprecated Use {@link #keepNullProperties()}
 	 */
+	@Deprecated
 	@ConfigurationProperty
 	public SerializerBuilder dontTrimNullProperties() {
 		return set(SERIALIZER_trimNullProperties, false);
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java
index ef91bb1..640137a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerGroupBuilder.java
@@ -207,6 +207,41 @@ public class SerializerGroupBuilder extends BeanTraverseBuilder {
 	}
 
 	/**
+	 * Configuration property:  Don't trim null bean property values.
+	 *
+	 * <p>
+	 * If <jk>true</jk>, null bean values will be serialized to the output.
+	 *
+	 * <ul class='seealso'>
+	 * 	<li class='jf'>{@link Serializer#SERIALIZER_keepNullProperties}
+	 * </ul>
+	 *
+	 * @param value
+	 * 	The new value for this property.
+	 * 	<br>The default is <jk>false</jk>.
+	 * @return This object (for method chaining).
+	 */
+	public SerializerGroupBuilder keepNullProperties(boolean value) {
+		return set(SERIALIZER_keepNullProperties, value);
+	}
+
+	/**
+	 * Configuration property:  Don't trim null bean property values.
+	 *
+	 * <p>
+	 * When enabled, null bean values will be serialized to the output.
+	 *
+	 * <ul class='seealso'>
+	 * 	<li class='jf'>{@link Serializer#SERIALIZER_keepNullProperties}
+	 * </ul>
+	 *
+	 * @return This object (for method chaining).
+	 */
+	public SerializerGroupBuilder keepNullProperties() {
+		return set(SERIALIZER_keepNullProperties, true);
+	}
+
+	/**
 	 * Configuration property:  Serializer listener.
 	 *
 	 * <p>
@@ -372,7 +407,9 @@ public class SerializerGroupBuilder extends BeanTraverseBuilder {
 	 * 	The new value for this property.
 	 * 	<br>The default is <jk>true</jk>.
 	 * @return This object (for method chaining).
+	 * @deprecated Use {@link #keepNullProperties(boolean)}
 	 */
+	@Deprecated
 	public SerializerGroupBuilder trimNullProperties(boolean value) {
 		return set(SERIALIZER_trimNullProperties, value);
 	}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java
index 19fc8a2..cdc7bf9 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/SerializerSession.java
@@ -327,7 +327,7 @@ public abstract class SerializerSession extends BeanTraverseSession {
 	 */
 	public final boolean canIgnoreValue(ClassMeta<?> cm, String attrName, Object value) throws SerializeException {
 
-		if (isTrimNullProperties() && value == null)
+		if (value == null && ! isKeepNullProperties())
 			return true;
 
 		if (value == null)
@@ -355,7 +355,7 @@ public abstract class SerializerSession extends BeanTraverseSession {
 		}
 
 		try {
-			if (isTrimNullProperties() && (willRecurse(attrName, value, cm) || willExceedDepth()))
+			if ((! isKeepNullProperties()) && (willRecurse(attrName, value, cm) || willExceedDepth()))
 				return true;
 		} catch (BeanRecursionException e) {
 			throw new SerializeException(e);
@@ -753,14 +753,14 @@ public abstract class SerializerSession extends BeanTraverseSession {
 	}
 
 	/**
-	 * Configuration property:  Trim null bean property values.
+	 * Configuration property:  Don't trim null bean property values.
 	 *
-	 * @see Serializer#SERIALIZER_trimNullProperties
+	 * @see Serializer#SERIALIZER_keepNullProperties
 	 * @return
-	 * 	<jk>true</jk> if null bean values are not serialized to the output.
+	 * 	<jk>true</jk> if null bean values are serialized to the output.
 	 */
-	protected final boolean isTrimNullProperties() {
-		return ctx.isTrimNullProperties();
+	protected final boolean isKeepNullProperties() {
+		return ctx.isKeepNullProperties();
 	}
 
 	/**
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializerBuilder.java
index a957233..1cf054d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/WriterSerializerBuilder.java
@@ -964,13 +964,25 @@ public class WriterSerializerBuilder extends SerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public WriterSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public WriterSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public WriterSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public WriterSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -1024,7 +1036,7 @@ public class WriterSerializerBuilder extends SerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public WriterSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfig.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfig.java
index f3975d6..1af9aa1 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfig.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfig.java
@@ -147,6 +147,36 @@ public @interface SerializerConfig {
 	String addRootType() default "";
 
 	/**
+	 * Configuration property:  Don't trim null bean property values.
+	 *
+	 * <p>
+	 * If <js>"true"</js>, null bean values will be serialized to the output.
+	 *
+	 * <p>
+	 * Note that not enabling this setting has the following effects on parsing:
+	 * <ul class='spaced-list'>
+	 * 	<li>
+	 * 		Map entries with <jk>null</jk> values will be lost.
+	 * </ul>
+	 *
+	 * <ul class='notes'>
+	 * 	<li>
+	 * 		Possible values:
+	 * 		<ul>
+	 * 			<li><js>"true"</js>
+	 * 			<li><js>"false"</js> (default)
+	 * 		</ul>
+	 * 	<li>
+	 * 		Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>).
+	 * </ul>
+	 *
+	 * <ul class='seealso'>
+	 * 	<li class='jf'>{@link Serializer#SERIALIZER_keepNullProperties}
+	 * </ul>
+	 */
+	String keepNullProperties() default "";
+
+	/**
 	 * Configuration property:  Serializer listener.
 	 *
 	 * <p>
@@ -299,7 +329,9 @@ public @interface SerializerConfig {
 	 * <ul class='seealso'>
 	 * 	<li class='jf'>{@link Serializer#SERIALIZER_trimNullProperties}
 	 * </ul>
+	 * @deprecated Use {@link #keepNullProperties()}
 	 */
+	@Deprecated
 	String trimNullProperties() default "";
 
 	/**
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfigApply.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfigApply.java
index 8460e9d..9b0718a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfigApply.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/serializer/annotation/SerializerConfigApply.java
@@ -38,6 +38,7 @@ public class SerializerConfigApply extends ConfigApply<SerializerConfig> {
 		super(c, r);
 	}
 
+	@SuppressWarnings("deprecation")
 	@Override
 	public void apply(AnnotationInfo<SerializerConfig> ai, PropertyStoreBuilder psb) {
 		SerializerConfig a = ai.getAnnotation();
@@ -45,6 +46,8 @@ public class SerializerConfigApply extends ConfigApply<SerializerConfig> {
 			psb.set(SERIALIZER_addBeanTypes, bool(a.addBeanTypes()));
 		if (! a.addRootType().isEmpty())
 			psb.set(SERIALIZER_addRootType, bool(a.addRootType()));
+		if (! a.keepNullProperties().isEmpty())
+			psb.set(SERIALIZER_keepNullProperties, bool(a.keepNullProperties()));
 		if (a.listener() != SerializerListener.Null.class)
 			psb.set(SERIALIZER_listener, a.listener());
 		if (! a.sortCollections().isEmpty())
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializerBuilder.java
index b5b6be3..1ef2500 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/soap/SoapXmlSerializerBuilder.java
@@ -831,13 +831,25 @@ public class SoapXmlSerializerBuilder extends XmlSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public SoapXmlSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public SoapXmlSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public SoapXmlSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public SoapXmlSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -891,7 +903,7 @@ public class SoapXmlSerializerBuilder extends XmlSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public SoapXmlSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerBuilder.java
index 6444d0f..e5070ee 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerBuilder.java
@@ -908,13 +908,25 @@ public class UonSerializerBuilder extends WriterSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public UonSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public UonSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public UonSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public UonSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -968,7 +980,7 @@ public class UonSerializerBuilder extends WriterSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public UonSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerSession.java
index 040d994..507aa32 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/uon/UonSerializerSession.java
@@ -211,7 +211,7 @@ public class UonSerializerSession extends WriterSerializerSession implements Htt
 
 		boolean addComma = false;
 
-		for (BeanPropertyValue p : m.getValues(isTrimNullProperties(), typeName != null ? createBeanTypeNameProperty(m, typeName) : null)) {
+		for (BeanPropertyValue p : m.getValues(isKeepNullProperties(), typeName != null ? createBeanTypeNameProperty(m, typeName) : null)) {
 			BeanPropertyMeta pMeta = p.getMeta();
 			if (pMeta.canRead()) {
 				ClassMeta<?> cMeta = p.getClassMeta();
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerBuilder.java
index 1d7ea35..4394277 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerBuilder.java
@@ -852,13 +852,25 @@ public class UrlEncodingSerializerBuilder extends UonSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public UrlEncodingSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public UrlEncodingSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public UrlEncodingSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public UrlEncodingSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -912,7 +924,7 @@ public class UrlEncodingSerializerBuilder extends UonSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public UrlEncodingSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerSession.java
index 02333f5..5767ebf 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/urlencoding/UrlEncodingSerializerSession.java
@@ -215,7 +215,7 @@ public class UrlEncodingSerializerSession extends UonSerializerSession {
 	private SerializerWriter serializeBeanMap(UonWriter out, BeanMap<?> m, String typeName) throws IOException, SerializeException {
 		boolean addAmp = false;
 
-		for (BeanPropertyValue p : m.getValues(isTrimNullProperties(), typeName != null ? createBeanTypeNameProperty(m, typeName) : null)) {
+		for (BeanPropertyValue p : m.getValues(isKeepNullProperties(), typeName != null ? createBeanTypeNameProperty(m, typeName) : null)) {
 			BeanPropertyMeta pMeta = p.getMeta();
 			if (pMeta.canRead()) {
 				ClassMeta<?> cMeta = p.getClassMeta();
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerBuilder.java
index fddd963..f38555d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerBuilder.java
@@ -1042,13 +1042,25 @@ public class XmlSerializerBuilder extends WriterSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public XmlSerializerBuilder dontTrimNullProperties() {
 		super.dontTrimNullProperties();
 		return this;
 	}
 
 	@Override /* GENERATED - SerializerBuilder */
+	public XmlSerializerBuilder keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
+	public XmlSerializerBuilder keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - SerializerBuilder */
 	public XmlSerializerBuilder listener(Class<? extends org.apache.juneau.serializer.SerializerListener> value) {
 		super.listener(value);
 		return this;
@@ -1102,7 +1114,7 @@ public class XmlSerializerBuilder extends WriterSerializerBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - SerializerBuilder */
+	@Deprecated @Override /* GENERATED - SerializerBuilder */
 	public XmlSerializerBuilder trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java
index 36e0864..3595a5f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlSerializerSession.java
@@ -207,7 +207,7 @@ public class XmlSerializerSession extends WriterSerializerSession {
 					findNsfMappings(o2);
 			}
 			if (bm != null) {
-				for (BeanPropertyValue p : bm.getValues(isTrimNullProperties())) {
+				for (BeanPropertyValue p : bm.getValues(isKeepNullProperties())) {
 
 					Namespace ns = getXmlBeanPropertyMeta(p.getMeta()).getNamespace();
 					if (ns != null && ns.uri != null)
@@ -547,7 +547,7 @@ public class XmlSerializerSession extends WriterSerializerSession {
 		boolean hasChildren = false;
 		BeanMeta<?> bm = m.getMeta();
 
-		List<BeanPropertyValue> lp = m.getValues(isTrimNullProperties());
+		List<BeanPropertyValue> lp = m.getValues(isKeepNullProperties());
 
 		XmlBeanMeta xbm = getXmlBeanMeta(bm);
 
@@ -587,7 +587,7 @@ public class XmlSerializerSession extends WriterSerializerSession {
 					} else if (n.equals(attrsProperty)) {
 						if (value instanceof BeanMap) {
 							BeanMap<?> bm2 = (BeanMap)value;
-							for (BeanPropertyValue p2 : bm2.getValues(true)) {
+							for (BeanPropertyValue p2 : bm2.getValues(false)) {
 								String key2 = p2.getName();
 								Object value2 = p2.getValue();
 								Throwable t2 = p2.getThrown();
diff --git a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/xml/XmlConfigurationExample.java b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/xml/XmlConfigurationExample.java
index dd22e92..2b0d06b 100644
--- a/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/xml/XmlConfigurationExample.java
+++ b/juneau-examples/juneau-examples-core/src/main/java/org/apache/juneau/examples/core/xml/XmlConfigurationExample.java
@@ -70,7 +70,7 @@ public class XmlConfigurationExample {
 
 		//Produces
 		//<object><id>a</id></object>
-		String nullescaped = XmlSerializer.create().trimNullProperties(true).build().serialize(nPojo);
+		String nullescaped = XmlSerializer.create().keepNullProperties(false).build().serialize(nPojo);
 		// the output will have trimmed null properties.
 		System.out.println(nullescaped);
 
diff --git a/juneau-examples/juneau-examples-rest-jetty-ftest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java b/juneau-examples/juneau-examples-rest-jetty-ftest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
index 3a12445..836c3ff 100644
--- a/juneau-examples/juneau-examples-rest-jetty-ftest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
+++ b/juneau-examples/juneau-examples-rest-jetty-ftest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
@@ -36,14 +36,14 @@ public class TestUtils {
 
 	private static JsonSerializer js = JsonSerializer.create()
 		.ssq()
-		.trimNullProperties(false)
+		.keepNullProperties()
 		.build();
 
 	private static JsonSerializer jsSorted = JsonSerializer.create()
 		.ssq()
 		.sortCollections()
 		.sortMaps()
-		.trimNullProperties(false)
+		.keepNullProperties()
 		.build();
 
 
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RestClientTest.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RestClientTest.java
index 9aa5ce4..4651a5f 100644
--- a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RestClientTest.java
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/RestClientTest.java
@@ -2415,10 +2415,43 @@ public class RestClientTest {
 
 	}
 
-//	@Test
-//	public void l20_serializer_trimNullPropertiesBoolean() throws Exception { fail(); }
-////	public RestClientBuilder trimNullProperties(boolean value) {
-//
+	public static class L20 {
+		public String f;
+	}
+
+	@Test
+	public void l20_serializer_trimNullPropertiesBoolean() throws Exception {
+		L20 x = new L20();
+
+		MockRestClient
+			.create(A.class)
+			.simpleJson()
+			.keepNullProperties()
+			.build()
+			.post("/echoBody", x)
+			.run()
+			.getBody().assertValue("{f:null}");
+
+		MockRestClient
+			.create(A.class)
+			.simpleJson()
+			.keepNullProperties(true)
+			.build()
+			.post("/echoBody", x)
+			.run()
+			.getBody().assertValue("{f:null}");
+
+		MockRestClient
+			.create(A.class)
+			.simpleJson()
+			.keepNullProperties(false)
+			.build()
+			.post("/echoBody", x)
+			.run()
+			.getBody().assertValue("{}");
+	}
+//	public RestClientBuilder trimNullProperties(boolean value) {
+
 //	@Test
 //	public void l21_serializer_trimStringsSBoolean() throws Exception { fail(); }
 ////	public RestClientBuilder trimStringsS(boolean value) {
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client2/RestClientBuilder.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client2/RestClientBuilder.java
index 95edbfc..81bc1ec 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client2/RestClientBuilder.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client2/RestClientBuilder.java
@@ -2082,6 +2082,43 @@ public class RestClientBuilder extends BeanContextBuilder {
 	}
 
 	/**
+	 * Configuration property:  Don't trim null bean property values.
+	 *
+	 * <p>
+	 * If <jk>true</jk>, null bean values will be serialized to the output.
+	 *
+	 * <ul class='seealso'>
+	 * 	<li class='jf'>{@link Serializer#SERIALIZER_keepNullProperties}
+	 * </ul>
+	 *
+	 * @param value
+	 * 	The new value for this property.
+	 * 	<br>The default is <jk>false</jk>.
+	 * @return This object (for method chaining).
+	 */
+	@ConfigurationProperty
+	public RestClientBuilder keepNullProperties(boolean value) {
+		return set(SERIALIZER_keepNullProperties, value);
+	}
+
+	/**
+	 * Configuration property:  Don't trim null bean property values.
+	 *
+	 * <p>
+	 * When enabled, null bean values will be serialized to the output.
+	 *
+	 * <ul class='seealso'>
+	 * 	<li class='jf'>{@link Serializer#SERIALIZER_keepNullProperties}
+	 * </ul>
+	 *
+	 * @return This object (for method chaining).
+	 */
+	@ConfigurationProperty
+	public RestClientBuilder keepNullProperties() {
+		return set(SERIALIZER_keepNullProperties, true);
+	}
+
+	/**
 	 * Configuration property:  Serializer listener.
 	 *
 	 * <p>
@@ -2282,7 +2319,9 @@ public class RestClientBuilder extends BeanContextBuilder {
 	 * 	The new value for this property.
 	 * 	<br>The default is <jk>true</jk>.
 	 * @return This object (for method chaining).
+	 * @deprecated Use {@link #keepNullProperties(boolean)}
 	 */
+	@Deprecated
 	@ConfigurationProperty
 	public RestClientBuilder trimNullProperties(boolean value) {
 		return set(SERIALIZER_trimNullProperties, value);
diff --git a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockRestClient.java b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockRestClient.java
index dd9d1ad..5641b38 100644
--- a/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockRestClient.java
+++ b/juneau-rest/juneau-rest-mock/src/main/java/org/apache/juneau/rest/mock2/MockRestClient.java
@@ -1155,7 +1155,7 @@ public class MockRestClient extends RestClientBuilder {
 
 	@Override /* GENERATED - RestClientBuilder */
 	@SuppressWarnings("unchecked")
-	public MockRestClient interceptors(java.lang.Class<? extends org.apache.juneau.rest.client2.RestCallInterceptor>...values) throws Exception {
+	public MockRestClient interceptors(java.lang.Class<? extends org.apache.juneau.rest.client2.RestCallInterceptor>...values) throws Exception{
 		super.interceptors(values);
 		return this;
 	}
@@ -1185,6 +1185,18 @@ public class MockRestClient extends RestClientBuilder {
 	}
 
 	@Override /* GENERATED - RestClientBuilder */
+	public MockRestClient keepNullProperties() {
+		super.keepNullProperties();
+		return this;
+	}
+
+	@Override /* GENERATED - RestClientBuilder */
+	public MockRestClient keepNullProperties(boolean value) {
+		super.keepNullProperties(value);
+		return this;
+	}
+
+	@Override /* GENERATED - RestClientBuilder */
 	public MockRestClient leakDetection() {
 		super.leakDetection();
 		return this;
@@ -1510,7 +1522,7 @@ public class MockRestClient extends RestClientBuilder {
 		return this;
 	}
 
-	@Override /* GENERATED - RestClientBuilder */
+	@Deprecated @Override /* GENERATED - RestClientBuilder */
 	public MockRestClient trimNullProperties(boolean value) {
 		super.trimNullProperties(value);
 		return this;


Mime
View raw message