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 * Marker annotation that can be used to define a non-static, 10 * no-argument method to be an "any getter"; accessor for getting 11 * a set of key/value pairs, to be serialized as part of containing POJO 12 * (similar to unwrapping) along with regular property values it has. 13 * This typically serves as a counterpart 14 * to "any setter" mutators (see {@link JsonAnySetter}). 15 * Note that the return type of annotated methods <b>must</b> be 16 * {@link java.util.Map}). 17 *<p> 18 * As with {@link JsonAnySetter}, only one property should be annotated 19 * with this annotation; if multiple methods are annotated, an exception 20 * may be thrown. 21 */ 22 @Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD}) 23 @Retention(RetentionPolicy.RUNTIME) 24 @JacksonAnnotation 25 public @interface JsonAnyGetter 26 { 27 /** 28 * Optional argument that defines whether this annotation is active 29 * or not. The only use for value 'false' if for overriding purposes. 30 * Overriding may be necessary when used 31 * with "mix-in annotations" (aka "annotation overrides"). 32 * For most cases, however, default value of "true" is just fine 33 * and should be omitted. 34 * 35 * @return True if annotation is enabled (normal case); false if it is to 36 * be ignored (only useful for mix-in annotations to "mask" annotation 37 * 38 * @since 2.9 39 */ enabled()40 boolean enabled() default true; 41 } 42