[jackson-annotations] 11/207: Make all annotations applicable for annotations; needed for annotation bundling
Timo Aaltonen
tjaalton at moszumanska.debian.org
Sat Sep 6 13:55:34 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 1dbeb48252bbb3432bfdbe47859c551109a169b4
Author: Tatu Saloranta <tsaloranta at gmail.com>
Date: Tue Jan 17 09:04:05 2012 -0800
Make all annotations applicable for annotations; needed for annotation bundling
---
src/main/java/com/fasterxml/jackson/annotation/JacksonInject.java | 2 +-
src/main/java/com/fasterxml/jackson/annotation/JsonAnyGetter.java | 4 +---
src/main/java/com/fasterxml/jackson/annotation/JsonAnySetter.java | 2 +-
.../java/com/fasterxml/jackson/annotation/JsonAutoDetect.java | 2 +-
.../java/com/fasterxml/jackson/annotation/JsonBackReference.java | 2 +-
src/main/java/com/fasterxml/jackson/annotation/JsonCreator.java | 2 +-
src/main/java/com/fasterxml/jackson/annotation/JsonFilter.java | 2 +-
src/main/java/com/fasterxml/jackson/annotation/JsonGetter.java | 7 +------
src/main/java/com/fasterxml/jackson/annotation/JsonIgnore.java | 2 +-
.../com/fasterxml/jackson/annotation/JsonIgnoreProperties.java | 4 +---
.../java/com/fasterxml/jackson/annotation/JsonIgnoreType.java | 4 +---
src/main/java/com/fasterxml/jackson/annotation/JsonInclude.java | 3 ++-
.../com/fasterxml/jackson/annotation/JsonManagedReference.java | 2 +-
src/main/java/com/fasterxml/jackson/annotation/JsonProperty.java | 8 +-------
.../java/com/fasterxml/jackson/annotation/JsonPropertyOrder.java | 8 ++++----
src/main/java/com/fasterxml/jackson/annotation/JsonRawValue.java | 4 +---
src/main/java/com/fasterxml/jackson/annotation/JsonRootName.java | 2 +-
src/main/java/com/fasterxml/jackson/annotation/JsonSetter.java | 2 +-
src/main/java/com/fasterxml/jackson/annotation/JsonSubTypes.java | 5 ++---
src/main/java/com/fasterxml/jackson/annotation/JsonTypeInfo.java | 5 ++---
src/main/java/com/fasterxml/jackson/annotation/JsonTypeName.java | 4 +---
src/main/java/com/fasterxml/jackson/annotation/JsonUnwrapped.java | 2 +-
src/main/java/com/fasterxml/jackson/annotation/JsonValue.java | 2 +-
src/main/java/com/fasterxml/jackson/annotation/JsonView.java | 2 +-
24 files changed, 30 insertions(+), 52 deletions(-)
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JacksonInject.java b/src/main/java/com/fasterxml/jackson/annotation/JacksonInject.java
index 74663d8..dc03135 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JacksonInject.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JacksonInject.java
@@ -15,7 +15,7 @@ import com.fasterxml.jackson.annotation.JacksonAnnotation;
* to have injected value as default and still allow optional override
* from JSON.
*/
- at Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JacksonInject
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonAnyGetter.java b/src/main/java/com/fasterxml/jackson/annotation/JsonAnyGetter.java
index faecfdb..42199b3 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonAnyGetter.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonAnyGetter.java
@@ -14,10 +14,8 @@ import java.lang.annotation.Target;
* of the bean that contains method/field with this annotations.
* As with {@link JsonAnySetter}, only one property should be annotated
* with this annotation.
- *
- * @since 1.6
*/
- at Target(ElementType.METHOD)
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonAnyGetter
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonAnySetter.java b/src/main/java/com/fasterxml/jackson/annotation/JsonAnySetter.java
index cd88945..dd78d0c 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonAnySetter.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonAnySetter.java
@@ -16,7 +16,7 @@ import java.lang.annotation.Target;
* If used, all otherwise unmapped key-value pairs from Json Object
* structs are added to the property (of type Map or bean).
*/
- at Target(ElementType.METHOD)
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonAnySetter
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonAutoDetect.java b/src/main/java/com/fasterxml/jackson/annotation/JsonAutoDetect.java
index b1e9f84..66af2ae 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonAutoDetect.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonAutoDetect.java
@@ -30,7 +30,7 @@ import java.lang.reflect.Modifier;
* are different for different types (getters need to be public; setters can
* have any access modifier, for example).
*/
- at Target(ElementType.TYPE)
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonAutoDetect
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonBackReference.java b/src/main/java/com/fasterxml/jackson/annotation/JsonBackReference.java
index 0391d70..ec5f036 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonBackReference.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonBackReference.java
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
*
* @author tatu
*/
- at Target({ElementType.FIELD, ElementType.METHOD})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonBackReference
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonCreator.java b/src/main/java/com/fasterxml/jackson/annotation/JsonCreator.java
index 2b5cb66..910f5cb 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonCreator.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonCreator.java
@@ -10,7 +10,7 @@ import java.lang.annotation.Target;
* methods as one to use for instantiating new instances of the associated
* class.
*/
- at Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonCreator
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonFilter.java b/src/main/java/com/fasterxml/jackson/annotation/JsonFilter.java
index 29ac851..1f1ee93 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonFilter.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonFilter.java
@@ -15,7 +15,7 @@ import java.lang.annotation.Target;
* {@link com.fasterxml.jackson.databind.ser.BeanPropertyFilter} and
* are registered through {@link com.fasterxml.jackson.databind.ObjectMapper}
*/
- at Target(ElementType.TYPE)
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@com.fasterxml.jackson.annotation.JacksonAnnotation
public @interface JsonFilter
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonGetter.java b/src/main/java/com/fasterxml/jackson/annotation/JsonGetter.java
index 800a561..0e14495 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonGetter.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonGetter.java
@@ -16,13 +16,8 @@ import java.lang.annotation.Target;
* this method (possibly inherited from a super class), a call is made
* through the method, and return value will be serialized as value of
* the property.
- *<p>
- * Note that this annotation was deprecated in versions 1.5 - 1.9; but
- * is not deprecated for Jackson 2.0. This is because we may consider
- * allowing getters that take contextual (injectable) arguments; as
- * well as cases where get-/settable name may differ.
*/
- at Target(ElementType.METHOD)
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
@Deprecated
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonIgnore.java b/src/main/java/com/fasterxml/jackson/annotation/JsonIgnore.java
index 235680d..17ba509 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonIgnore.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonIgnore.java
@@ -40,7 +40,7 @@ import java.lang.annotation.Target;
*<p>
* Annotation is similar to {@link javax.xml.bind.annotation.XmlTransient}
*/
- at Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonIgnore
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonIgnoreProperties.java b/src/main/java/com/fasterxml/jackson/annotation/JsonIgnoreProperties.java
index d64a9f7..6fd6f08 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonIgnoreProperties.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonIgnoreProperties.java
@@ -20,10 +20,8 @@ import java.lang.annotation.Target;
*</pre>
*<p>
* Only applicable to classes, not for properties (getters, setters, fields).
- *
- * @since 1.4
*/
- at Target({ElementType.TYPE})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonIgnoreProperties
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonIgnoreType.java b/src/main/java/com/fasterxml/jackson/annotation/JsonIgnoreType.java
index 476a722..c05877e 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonIgnoreType.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonIgnoreType.java
@@ -12,10 +12,8 @@ import java.lang.annotation.Target;
* Note: annotation does have boolean 'value' property (which defaults
* to 'true'), so that it is actually possible to override value
* using mix-in annotations.
- *
- * @since 1.7
*/
- at Target({ElementType.TYPE})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonIgnoreType
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonInclude.java b/src/main/java/com/fasterxml/jackson/annotation/JsonInclude.java
index d80b72b..e48f0a4 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonInclude.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonInclude.java
@@ -15,7 +15,8 @@ import java.lang.annotation.Target;
*
* @since 2.0
*/
- at Target({ElementType.METHOD, ElementType.FIELD, ElementType.TYPE, ElementType.PARAMETER})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD,
+ ElementType.TYPE, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@com.fasterxml.jackson.annotation.JacksonAnnotation
public @interface JsonInclude
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonManagedReference.java b/src/main/java/com/fasterxml/jackson/annotation/JsonManagedReference.java
index 745479f..71d1cb7 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonManagedReference.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonManagedReference.java
@@ -26,7 +26,7 @@ import java.lang.annotation.Target;
*
* @author tatu
*/
- at Target({ElementType.FIELD, ElementType.METHOD})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonManagedReference
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonProperty.java b/src/main/java/com/fasterxml/jackson/annotation/JsonProperty.java
index 392ab10..d2a0ca6 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonProperty.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonProperty.java
@@ -17,14 +17,8 @@ import java.lang.annotation.Target;
* can be specified to non-empty value to specify different
* name. Property name refers to name used externally, as
* the field name in Json objects.
- *<p>
- * NOTE: since version 1.1, annotation has also been applicable
- * to fields (not with 1.0).
- *<p>
- * NOTE: since version 1.2, annotation has also been applicable
- * to (constructor) parameters
*/
- at Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonProperty
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonPropertyOrder.java b/src/main/java/com/fasterxml/jackson/annotation/JsonPropertyOrder.java
index 989312c..861b798 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonPropertyOrder.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonPropertyOrder.java
@@ -22,11 +22,11 @@ import java.lang.annotation.Target;
* <div>@</div>JsonPropertyOrder(alphabetic=true)
*</pre>
*<p>
- * This annotation has no effect on deserialization.
- *
- * @since 1.4
+ * This annotation may or may not have effect on deserialization: for basic JSON
+ * handling there is no effect, but for other supported data types (or structural
+ * conventions) there may be.
*/
- at Target({ElementType.TYPE})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonPropertyOrder
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonRawValue.java b/src/main/java/com/fasterxml/jackson/annotation/JsonRawValue.java
index 0b0b51b..e33d123 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonRawValue.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonRawValue.java
@@ -13,10 +13,8 @@ import java.lang.annotation.Target;
* passing javascript function definitions from server to a javascript client.
*<p>
* Warning: the resulting JSON stream may be invalid depending on your input value.
- *
- * @since 1.7.0
*/
- at Target( { ElementType.METHOD, ElementType.FIELD })
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonRawValue
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonRootName.java b/src/main/java/com/fasterxml/jackson/annotation/JsonRootName.java
index 08c1d93..e8e5732 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonRootName.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonRootName.java
@@ -12,7 +12,7 @@ import java.lang.annotation.Target;
* be used; but if it is, name used for serialization should be name
* specified here, and deserializer will expect the name as well.
*/
- at Target(ElementType.TYPE)
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@com.fasterxml.jackson.annotation.JacksonAnnotation
public @interface JsonRootName
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonSetter.java b/src/main/java/com/fasterxml/jackson/annotation/JsonSetter.java
index 4fd5de2..ada41d3 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonSetter.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonSetter.java
@@ -19,7 +19,7 @@ import java.lang.annotation.Target;
* different name when reading and writing JSON), and more importantly to
* allow multi-argument setter method in future.
*/
- at Target(ElementType.METHOD)
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonSetter
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonSubTypes.java b/src/main/java/com/fasterxml/jackson/annotation/JsonSubTypes.java
index 65578c3..861e522 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonSubTypes.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonSubTypes.java
@@ -9,10 +9,9 @@ import java.lang.annotation.Target;
* Annotation used with {@link JsonTypeInfo} to indicate sub types of serializable
* polymorphic types, and to associate logical names used within JSON content
* (which is more portable than using physical Java class names).
- *
- * @since 1.5 (but available to fields, methods and constructor params only since 1.8)
*/
- at Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.FIELD,
+ ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonSubTypes {
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonTypeInfo.java b/src/main/java/com/fasterxml/jackson/annotation/JsonTypeInfo.java
index 1daf07c..3fcdd53 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonTypeInfo.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonTypeInfo.java
@@ -38,11 +38,10 @@ import java.lang.annotation.*;
*
* @see org.codehaus.jackson.map.annotate.JsonTypeResolver
*
- * @since 1.5 (but available to fields, methods and constructor parameters since 1.7)
- *
* @author tatu
*/
- at Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE,
+ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonTypeInfo
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonTypeName.java b/src/main/java/com/fasterxml/jackson/annotation/JsonTypeName.java
index d78d18a..45d6713 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonTypeName.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonTypeName.java
@@ -12,11 +12,9 @@ import java.lang.annotation.Target;
* {@link JsonTypeInfo#use} property) to establish relationship
* between type names and types.
*
- * @since 1.5
- *
* @author tatu
*/
- at Target({ElementType.TYPE})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonTypeName {
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonUnwrapped.java b/src/main/java/com/fasterxml/jackson/annotation/JsonUnwrapped.java
index 73bf88e..a3cca4d 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonUnwrapped.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonUnwrapped.java
@@ -61,7 +61,7 @@ import java.lang.annotation.Target;
* </li>
* </ul>
*/
- at Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonUnwrapped
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonValue.java b/src/main/java/com/fasterxml/jackson/annotation/JsonValue.java
index 5fd4277..9286d2a 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonValue.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonValue.java
@@ -37,7 +37,7 @@ import java.lang.annotation.Target;
* to define mapping, but can not be done in general for POJO types; as such,
* this is not used for POJO deserialization.
*/
- at Target({ElementType.METHOD})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonValue
diff --git a/src/main/java/com/fasterxml/jackson/annotation/JsonView.java b/src/main/java/com/fasterxml/jackson/annotation/JsonView.java
index 8d72a2e..0043bce 100644
--- a/src/main/java/com/fasterxml/jackson/annotation/JsonView.java
+++ b/src/main/java/com/fasterxml/jackson/annotation/JsonView.java
@@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JacksonAnnotation;
* If multiple View class identifiers are included, property will
* be part of all of them.
*/
- at Target({ElementType.METHOD, ElementType.FIELD})
+ at Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonView {
--
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