Constructs an
ArrayType instance describing
open data values which are arrays with dimension
dimension of elements whose
open type is
elementType.
When invoked on an ArrayType instance, the getClassName method returns the class name of the array instances it describes (following the rules defined by the getName method of java.lang.Class), not the class name of the array elements (which is returned by a call to getElementOpenType().getClassName()).
The internal field corresponding to the type name of this ArrayType instance is also set to the class name of the array instances it describes. In other words, the methods getClassName and getTypeName return the same string value. The internal field corresponding to the description of this ArrayType instance is set to a string value which follows the following template:
- if non-primitive array:
<dimension>-dimension array of <element_class_name>
- if primitive array:
<dimension>-dimension array of <primitive_type_of_the_element_class_name>
As an example, the following piece of code:
ArrayType<String[][][]> t = new ArrayType<String[][][]>(3, SimpleType.STRING);
System.out.println("array class name = " + t.getClassName());
System.out.println("element class name = " + t.getElementOpenType().getClassName());
System.out.println("array type name = " + t.getTypeName());
System.out.println("array type description = " + t.getDescription());
would produce the following output:
array class name = [[[Ljava.lang.String;
element class name = java.lang.String
array type name = [[[Ljava.lang.String;
array type description = 3-dimension array of java.lang.String
And the following piece of code which is equivalent to the one listed above would also produce the same output:
ArrayType<String[]> t1 = new ArrayType<String[]>(1, SimpleType.STRING);
ArrayType<String[][]> t2 = new ArrayType<String[][]>(1, t1);
ArrayType<String[][][]> t3 = new ArrayType<String[][][]>(1, t2);
System.out.println("array class name = " + t3.getClassName());
System.out.println("element class name = " + t3.getElementOpenType().getClassName());
System.out.println("array type name = " + t3.getTypeName());
System.out.println("array type description = " + t3.getDescription());