xref: /aosp_15_r20/external/jackson-annotations/src/main/java/com/fasterxml/jackson/annotation/JsonFilter.java (revision 2bf6642460ffb10303bd46207a4555f36d9e5945)
1 package com.fasterxml.jackson.annotation;
2 
3 import java.lang.annotation.ElementType;
4 import java.lang.annotation.Retention;
5 import java.lang.annotation.RetentionPolicy;
6 import java.lang.annotation.Target;
7 
8 /**
9  * Annotation used to indicate which logical filter is to be used
10  * for filtering out properties of type (class) annotated;
11  * association made by this annotation declaring ids of filters,
12  * and  <code>com.fasterxml.jackson.databind.ObjectMapper</code> (or objects
13  * it delegates to) providing matching filters by id.
14  *<p>
15  * Filters to use are usually of type
16  * <code>com.fasterxml.jackson.databind.ser.PropertyFilter</code> and
17  * are registered through <code>com.fasterxml.jackson.databind.ObjectMapper</code>
18  *<p>
19  * Since 2.3, this annotation can also be used on properties (fields, methods,
20  * constructor parameters).
21  */
22 @Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE,
23     ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER // new in 2.3
24 })
25 @Retention(RetentionPolicy.RUNTIME)
26 @com.fasterxml.jackson.annotation.JacksonAnnotation
27 public @interface JsonFilter
28 {
29     /**
30      * Id of filter to use; if empty String (""), no filter is to be used.
31      */
value()32     public String value();
33 }
34