Interface ArrayType
- All Superinterfaces:
AnnotationTarget
,Type
An array type is created from a component type.
For a component type
T
, the array type is written T[]
.
A component type may itself be an array type. For a component type T[]
,
the array type is written T[][]
. Such array type is also called
multi-dimensional array type.
Array types also have an element type, which is obtained by repeatedly
asking for the component type until a non-array type is returned. For example,
the String[][]
array type has an element type of String
.
- Since:
- 4.0
-
Nested Class Summary
-
Method Summary
Methods inherited from interface jakarta.enterprise.lang.model.AnnotationTarget
annotation, annotations, annotations, hasAnnotation, hasAnnotation, repeatableAnnotation
Methods inherited from interface jakarta.enterprise.lang.model.types.Type
asClass, asDeclaration, asParameterizedType, asPrimitive, asType, asTypeVariable, asVoid, asWildcardType, isArray, isClass, isDeclaration, isParameterizedType, isPrimitive, isType, isTypeVariable, isVoid, isWildcardType
-
Method Details
-
componentType
Type componentType()Returns the component type of this array type, as defined by The Java™ Language Specification. That is, in case of a single-dimensional array, the element type of the array, and in case of a multi-dimensional array, an array type with one less dimension.For example, the component type of
int[]
is theint
type. The component type ofString[][]
is theString[]
array type, whose component type is theString
type.Each dimension of the array type may be annotated independently.
- Returns:
- the component type, never
null
-
kind
Description copied from interface:Type
Returns the kind of this type. -
asArray
Description copied from interface:Type
Returns this type as an array type.
-