@JsonGetter

/**
标记注解可以用来定义一个非静,无参,无返回值的方法作为逻辑上的"getter"
它可以作为更适用的可选的替代{@link JsonPrroperty}注解(在通常情况下是
推荐的选择)
Getter表示当序列化一个对象实例时具有这样的方法,通过调用此方法,返回要被序列
化的值作为属性
*/
@Target({ElementType.ANNOTATION_TYPE, ElementType,METHOD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotation
public @interface JsonGetter{

    /**
    Defines name of the logical property this method
    is used to access ("get"); empty String names that
    name should be derived from the underlying method
    (using standard Bean name detection rules) 
    */
    String value() default "";

}

results matching ""

    No results matching ""