forked from FasterXML/jackson-annotations
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJsonApplyView.java
More file actions
41 lines (38 loc) · 1.21 KB
/
JsonApplyView.java
File metadata and controls
41 lines (38 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.fasterxml.jackson.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotation used for specifying view that should be used to process
* the property that is defined by method or field annotated.
*<p>
* An example annotation would be:
*<pre>
* @JsonApplyView(BasicView.class)
* public MyValue value;
*</pre>
* which would specify that property annotated would be processed
* using View identified by {@code BasicView.class}.
*<p>
* Note: initially processing only covers serialization.
*
* @since 2.22
*/
@Target({ElementType.ANNOTATION_TYPE,
ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonApplyView
{
/**
* View that should be used to process annotated property, if any;
* special value {@link JsonApplyView.NONE} indicates that no View
* should used.
*/
public Class<?> value() default NONE.class;
/**
* Special view indicating no views should be used for processing annotated property.
*/
static public interface NONE {}
}