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;
}