Top Description Methods
jakarta.enterprise.lang.model.types

public Interface ArrayType

extends 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

Method Summary

Modifier and TypeMethod and Description
public default ArrayType
asArray()

Overrides default jakarta.enterprise.lang.model.types.Type.asArray.

Returns this type as an array type.
public Type

Returns:

the component type, never null
componentType
()

Returns the component type of this array type, as defined by The Java™ Language Specification.

public default Type.Kind
kind()

Implements jakarta.enterprise.lang.model.types.Type.kind.

Returns the kind of this type.
Inherited from jakarta.enterprise.lang.model.types.Type:
asClassasDeclarationasParameterizedTypeasPrimitiveasTypeasTypeVariableasVoidasWildcardTypeisArrayisClassisDeclarationisParameterizedTypeisPrimitiveisTypeisTypeVariableisVoidisWildcardType

Method Detail

asArrayback to summary
public default ArrayType asArray()

Overrides default jakarta.enterprise.lang.model.types.Type.asArray.

Doc from jakarta.enterprise.lang.model.types.Type.asArray.

Returns this type as an array type.

Returns:ArrayType

this array type, never null

Annotations
@Override
componentTypeback to summary
public 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 the int type. The component type of String[][] is the String[] array type, whose component type is the String type.

Each dimension of the array type may be annotated independently.

Returns:Type

the component type, never null

kindback to summary
public default Type.Kind kind()

Implements jakarta.enterprise.lang.model.types.Type.kind.

Doc from jakarta.enterprise.lang.model.types.Type.kind.

Returns the kind of this type.

Returns:Type.Kind

the kind of this type

Annotations
@Override