You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2017/11/16 00:33:58 UTC

juneau-website git commit: Serializer builders using named properties.

Repository: juneau-website
Updated Branches:
  refs/heads/asf-site 1f6a69582 -> 16f6d2cb1


Serializer builders using named properties.

Project: http://git-wip-us.apache.org/repos/asf/juneau-website/repo
Commit: http://git-wip-us.apache.org/repos/asf/juneau-website/commit/16f6d2cb
Tree: http://git-wip-us.apache.org/repos/asf/juneau-website/tree/16f6d2cb
Diff: http://git-wip-us.apache.org/repos/asf/juneau-website/diff/16f6d2cb

Branch: refs/heads/asf-site
Commit: 16f6d2cb12fca0eae18c629fdd2c2e867e4ae5b4
Parents: 1f6a695
Author: JamesBognar <ja...@apache.org>
Authored: Wed Nov 15 19:33:54 2017 -0500
Committer: JamesBognar <ja...@apache.org>
Committed: Wed Nov 15 19:33:54 2017 -0500

----------------------------------------------------------------------
 content/marshall.html | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/juneau-website/blob/16f6d2cb/content/marshall.html
----------------------------------------------------------------------
diff --git a/content/marshall.html b/content/marshall.html
index 0b58c7f..2a6ea27 100644
--- a/content/marshall.html
+++ b/content/marshall.html
@@ -197,6 +197,26 @@
 		.debug(<jk>true</jk>)  <jc>// Add debug output</jc>
 		.build();
 	   
+	<jc>// Same as above, but using named properties.</jc>
+	JsonSerializer serializer = JsonSerializer.<jsm>create</jsm>()
+		.property(<jsf>JSON_simpleMode</jsf>, <jk>true</jk>) 
+		.property(<jsf>SERIALIZER_quoteChar</jsf>, <js>'\''</js>)
+		.property(<jsf>BEAN_pojoSwaps_add</jsf>, IteratorSwap.<jk>class</jk>)
+		.property(<jsf>BEAN_pojoSwaps_add</jsf>, ByteArrayBase64Swap.<jk>class</jk>)
+		.property(<jsf>BEAN_pojoSwaps_add</jsf>, CalendarSwap.ISO8601DT.<jk>class</jk>)
+		.property(<jsf>BEAN_beanFilters_add</jsf>, MyBeanFilter.<jk>class</jk>) 
+		.property(<jsf>BEAN_timeZone</jsf>, TimeZone.<jsf>GMT</jsf>)
+		.property(<jsf>BEAN_locale</jsf>, Locale.<jsf>JAPAN</jsf>)
+		.property(<jsf>SERIALIZER_sortCollections</jsf>, <jk>true</jk>)
+		.property(<jsf>BEAN_sortProperties</jsf>, <jk>true</jk>)
+		.property(<jsf>SERIALIZER_trimNullProperties</jsf>, <jk>true</jk>)
+		.property(<jsf>SERIALIZER_trimStrings</jsf>, <jk>true</jk>)
+		.property(<jsf>BEAN_methodVisibility</jsf>, <jsf>PROTECTED</jsf>)
+		.property(<jsf>BEAN_beanDictionary_add</jsf>, MyBeanA.<jk>class</jk>) 
+		.property(<jsf>BEAN_beanDictionary_add</jsf>, MyBeanB.<jk>class</jk>)
+		.property(<jsf>BEAN_debug</jsf>, <jk>true</jk>)
+		.build();
+
 	<jc>// Clone an existing serializer and modify it to use single-quotes</jc>
 	JsonSerializer serializer = JsonSerializer.<jsf>DEFAULT</jsf>.builder()
 		.sq()