When an array type is used as a value in an annotation element, each pair of square brackets is printed twice. This means a one-dimensional array type is rendered as two-dimensional, a two-dimensional array type as four-dimensional and so on.
Example annotation interface:
--------------------------------------------------------------------
import java.lang.annotation.*;
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface MyAnnotation {
Class<?> classy();
Class<?>[] classies();
}
---------------------------------------------------------------
Example annotation host:
---------------------------------------------------------------
@MyAnnotation(classy=AnnotationHost[].class,
classies={Object[].class, int[].class})
public class AnnotationHost {}
---------------------------------------------------------------
JavaDoc output:
------------------------------------------------------------------
@MyAnnotation(classy=AnnotationHost[][].class,
classies={java.lang.Object[][].class,int[][].class})
public class AnnotationHost
extends Object
------------------------------------------------------------------