You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@johnzon.apache.org by rm...@apache.org on 2019/05/20 07:21:54 UTC

[johnzon] branch master updated (09e0369 -> 1176a1d)

This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/johnzon.git.


    from 09e0369  JOHNZON-210 reworking JsonObject/JsonArray#toString to use JsonGenerator
     new c437f30  Bump findbugs to 3.0.4 for mvn 3.6
     new 1176a1d  Fix documentation for @JohnzonAny

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml                    |  2 +-
 src/site/markdown/index.md | 22 ++++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)


[johnzon] 01/02: Bump findbugs to 3.0.4 for mvn 3.6

Posted by rm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c437f30820bdcbf6d25b7242ed129345184620f0
Author: Frank Vanderham <tw...@gmail.com>
AuthorDate: Sun May 19 14:28:46 2019 -0600

    Bump findbugs to 3.0.4 for mvn 3.6
    
    Increase findbugs-maven-plugin to 3.0.4 for Maven 3.6 to fix
    error:
    "Unable to parse configuration of mojo
    org.codehaus.mojo:findbugs-maven-plugin:3.0.0:findbugs for
    parameter pluginArtifacts".
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 4159c37..e1ddbed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -430,7 +430,7 @@
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>findbugs-maven-plugin</artifactId>
-        <version>3.0.0</version>
+        <version>3.0.4</version>
         <configuration>
           <xmlOutput>true</xmlOutput>
           <!-- Optional directory to put findbugs xdoc xml report -->


[johnzon] 02/02: Fix documentation for @JohnzonAny

Posted by rm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1176a1d7e002d241b3143174e94cf1136ce83efd
Author: Frank Vanderham <tw...@gmail.com>
AuthorDate: Sun May 19 14:41:16 2019 -0600

    Fix documentation for @JohnzonAny
    
    Fixed the documentation for @JohnzonAny by replacing the @Any
    annotations with @JohnzonAny and clarifying the mix between regular
    serialization and the use of @JohnzonAny.
---
 src/site/markdown/index.md | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md
index db026f0..58058c3 100644
--- a/src/site/markdown/index.md
+++ b/src/site/markdown/index.md
@@ -183,13 +183,19 @@ public class MyModel {
 
 #### @JohnzonAny
 
-If you don't fully know you model but want to handle all keys you can use @JohnzonAny to capture/serialize them all:
+If you don't fully know your model but want to handle all keys you can use @JohnzonAny to capture/serialize them all:
 
 <pre class="prettyprint linenums"><![CDATA[
 public class AnyMe {
-    @JohnzonAny // ignore normal serialization of this field
-    private String name; // known
-    private Map<String, Object> any = new TreeMap<String, Object>(); // unknown
+    private String name; // Regular serialization for the known 'name' field
+
+    /* This example uses a TreeMap to store and retrieve the other unknown
+       fields for the @JohnzonAny annotated methods, but you can choose
+       anything you want. Use @JohnzonIgnore to avoid exposing this as
+       an actual 'unknownFields' property in JSON.
+    */
+    @JohnzonIgnore
+    private Map<String, Object> unknownFields = new TreeMap<String, Object>();
 
     public String getName() {
         return name;
@@ -199,14 +205,14 @@ public class AnyMe {
         this.name = name;
     }
 
-    @Any
+    @JohnzonAny
     public Map<String, Object> getAny() {
-        return any;
+        return unknownFields;
     }
 
-    @Any
+    @JohnzonAny
     public void handle(final String key, final Object val) {
-        any.put(key, val);
+        this.unknownFields.put(key, val);
     }
 }
 ]]></pre>