How to create an annotation that is a group of Jackson annotations?

For Jackson, this can be done with @JacksonAnnotationsInside meta-annotation. See this article for more, but code snippet from there is:

@Retention(RetentionPolicy.RUNTIME) // IMPORTANT
@JacksonAnnotationsInside
@JsonInclude(Include.NON_NULL)
@JsonPropertyOrder({ "id", "name" }) 
public @interface MyStdAnnotations

and from thereon you can use this type for your own classes like so:

@MyStdAnnotations
public class MyBean {
   public String name, id;
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)