[jackson-annotations] 181/207: Implement #33, add `@JsonRootName.alwaysWrap`

Timo Aaltonen tjaalton at moszumanska.debian.org
Sat Sep 6 13:55:53 UTC 2014


This is an automated email from the git hooks/post-receive script.

tjaalton pushed a commit to branch master
in repository jackson-annotations.

commit df34a31b6ab515f1f2c987c2384353bb543ead95
Author: Tatu Saloranta <tatu.saloranta at iki.fi>
Date:   Wed May 7 18:25:04 2014 -0700

    Implement #33, add `@JsonRootName.alwaysWrap`
---
 release-notes/VERSION                                 |  4 ++++
 .../fasterxml/jackson/annotation/JsonRootName.java    | 19 +++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/release-notes/VERSION b/release-notes/VERSION
index bca6050..0717df8 100644
--- a/release-notes/VERSION
+++ b/release-notes/VERSION
@@ -6,7 +6,11 @@ NOTE: Annotations module will never contain changes in patch versions,
 
 #31: Allow use of `@JsonPropertyOrder` for properties (not just classes)
 #32: Add `@JsonProperty.index`
+#33: Add `@JsonRootName.alwaysWrap`
 - Add `JsonFormat.Value#timeZoneAsString` (needed by Joda module)
+- Add `@JsonRootName.namespace` to allow specifying of namespace with
+  standard Jackson annotations (not just XML-specific ones that dataformat-xml
+  provides)
 
 ------------------------------------------------------------------------
 === History: ===
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonRootName.java b/src/main/java/com/fasterxml/jackson/annotation/JsonRootName.java
index e8e5732..b282de7 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonRootName.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonRootName.java
@@ -22,4 +22,23 @@ public @interface JsonRootName
      */
     public String value();
 
+    /**
+     * Optioanl marker property that can be defined as <code>true</code> to force
+     * wrapping of root element, regardless of whether globally
+     * "root wrapping" is enabled or not.
+     *<p>
+     * Note that value of <code>false</code> is taken to mean "use defaults",
+     * and will not block use of wrapper if use is indicated by global features.
+     *
+     * @since 2.4
+     */
+    public boolean alwaysWrap() default false;
+    
+    /**
+     * Optional namespace to use with data formats that support such
+     * concept (specifically XML).
+     *
+     * @since 2.4
+     */
+    public String namespace() default "";
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jackson-annotations.git



More information about the pkg-java-commits mailing list