[jackson-annotations] 23/207: Add ObjectIdsGenerator.None to allow disablng of ObjectId inclusion
Timo Aaltonen
tjaalton at moszumanska.debian.org
Sat Sep 6 13:55:35 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 030d8c605625ee0e9fea74836153042acb6d25cc
Author: Tatu Saloranta <tsaloranta at gmail.com>
Date: Thu Feb 9 17:27:37 2012 -0800
Add ObjectIdsGenerator.None to allow disablng of ObjectId inclusion
---
.../com/fasterxml/jackson/annotation/JsonIdentityInfo.java | 8 ++++++++
.../com/fasterxml/jackson/annotation/ObjectIdGenerators.java | 12 +++++++++---
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonIdentityInfo.java b/src/main/java/com/fasterxml/jackson/annotation/JsonIdentityInfo.java
index 06f0fa9..9ccde66 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonIdentityInfo.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonIdentityInfo.java
@@ -22,6 +22,10 @@ import java.lang.annotation.Target;
* Object id has to be serialized as a property in case of POJOs;
* object identity is currently NOT support for JSON Array types
* (Java arrays or Lists) or Java Map types.
+ *<p>
+ * Finally, note that generator type of {@link ObjectIdGenerators.None}
+ * indicates that no Object Id should be included or used: it is included
+ * to allow suppressing Object Ids using mix-in annotations.
*
* @since 2.0
*/
@@ -48,6 +52,10 @@ public @interface JsonIdentityInfo
* either one of pre-defined generators from
* {@link ObjectIdGenerator}, or a custom generator.
* Defined as class to instantiate.
+ *<p>
+ * Note that special type
+ * {@link ObjectIdGenerators.None}
+ * can be used to disable inclusion of Object Ids.
*/
public Class<? extends ObjectIdGenerator<?>> generator();
diff --git a/src/main/java/com/fasterxml/jackson/annotation/ObjectIdGenerators.java b/src/main/java/com/fasterxml/jackson/annotation/ObjectIdGenerators.java
index 40f4215..f0ae0eb 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/ObjectIdGenerators.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/ObjectIdGenerators.java
@@ -14,10 +14,9 @@ public class ObjectIdGenerators
*/
/**
- * Helper class that implements scoped storage for Object
- * references.
+ * Helper class for implementations contained.
*/
- protected abstract static class Base<T> extends ObjectIdGenerator<T>
+ private abstract static class Base<T> extends ObjectIdGenerator<T>
{
protected final Class<?> _scope;
@@ -46,6 +45,13 @@ public class ObjectIdGenerators
*/
/**
+ * Abstract marker class used to allow explicitly specifying
+ * that no generator is used; which also implies that no
+ * Object Id is to be included or used.
+ */
+ public abstract class None extends ObjectIdGenerator<Object> { }
+
+ /**
* Abstract place-holder class which is used to denote case
* where Object Identifier to use comes from a POJO property
* (getter method or field). If so, value is written directly
--
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