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 value-returning (non-void) method to be used as a "getter" 11 * for a logical property. 12 * It can be used as an alternative to more general 13 * {@link JsonProperty} annotation (which is the recommended choice in 14 * general case). 15 *<p> 16 * Getter means that when serializing Object instance of class that has 17 * this method (possibly inherited from a super class), a call is made 18 * through the method, and return value will be serialized as value of 19 * the property. 20 */ 21 @Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD}) 22 @Retention(RetentionPolicy.RUNTIME) 23 @JacksonAnnotation 24 public @interface JsonGetter 25 { 26 /** 27 * Defines name of the logical property this 28 * method is used to access ("get"); empty String means that 29 * name should be derived from the underlying method (using 30 * standard Bean name detection rules) 31 * 32 * @return Name of the logical property (or "" to use 'default', 33 * if available) 34 */ value()35 String value() default ""; 36 } 37