001package com.avaje.ebean.annotation; 002 003import java.lang.annotation.ElementType; 004import java.lang.annotation.Retention; 005import java.lang.annotation.RetentionPolicy; 006import java.lang.annotation.Target; 007 008/** 009 * Similar to Jackson JsonIgnore but provides the option to just ignore serialize or deserialize. 010 * <p> 011 * This provides the same features as Expose but from the opposite perspective which is probably 012 * more common and more familiar to Jackson users. 013 * </p> 014 */ 015@Retention(RetentionPolicy.RUNTIME) 016@Target(ElementType.FIELD) 017public @interface JsonIgnore { 018 019 /** 020 * If {@code true}, the field marked with this annotation is written out in the JSON while 021 * serializing. If {@code false}, the field marked with this annotation is skipped from the 022 * serialized output. Defaults to {@code false}. 023 */ 024 boolean serialize() default false; 025 026 /** 027 * If {@code true}, the field marked with this annotation is deserialized from the JSON. 028 * If {@code false}, the field marked with this annotation is skipped during deserialization. 029 * Defaults to {@code false}. 030 */ 031 boolean deserialize() default false; 032}