How to implement java composite annotations?

for example, there are two annotations, both of which are method annotations, which can only be used on methods
@ A (value= "aaa")
@ B (path= "/ bbb")

.

how to combine into an annotation
@ C (value= "aaa", path= "/ bbb")

Mar.06,2021

are the @ A and @ B comments defined by you or by others?
if it is someone else's comment, there is no way to combine it unless someone else defines a @ C .
if you define it yourself, then define another @ C .

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface C {
    String value();

    String path();
}
Menu