-
- All Superinterfaces:
AnnotationTarget
,Type
public interface ArrayType extends Type
An array type is created from a component type. For a component typeT
, the array type is writtenT[]
. A component type may itself be an array type. For a component typeT[]
, the array type is writtenT[][]
. 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 ofString
.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ArrayType
asArray()
Returns this type as an array type.Type
componentType()
Returns the component type of this array type, as defined by The Java™ Language Specification.default Type.Kind
kind()
Returns the kind of this type.-
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 Detail
-
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
default Type.Kind kind()
Description copied from interface:Type
Returns the kind of this type.
-
-